summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile10
-rw-r--r--fb-helper.c (renamed from fb-helper.c.in)2
3 files changed, 4 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index 5afae78..e25dfe7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,4 +2,3 @@ dist
fb.1
fb
fb-helper
-fb-helper.c
diff --git a/Makefile b/Makefile
index b976361..2ffeeb5 100644
--- a/Makefile
+++ b/Makefile
@@ -12,18 +12,14 @@ fb: fb.in
sed 's|@VERSION@|$(VERSION)|; s|@LIBDIR@|$(LIBDIR)|' $< > $@
chmod 755 $@
-%:: %.in
- @[ -n "$(VERSION)" ] || (echo "Error: version detection failed"; exit 1)
- sed 's|@VERSION@|$(VERSION)|; s|@LIBDIR@|$(LIBDIR)|' $< > $@
-
fb-helper: fb-helper.c
- $(CC) $(CFLAGS) -lcurl -o $@ $<
+ $(CC) $(CFLAGS) -lcurl -DVERSION=\"$(VERSION)\" -o $@ $<
fb.1: fb.pod
pod2man -c "" $< $@
clean:
- rm -f fb.1 fb fb-helper.c fb-helper
+ rm -f fb.1 fb fb-helper
rm -rf dist
install: all
@@ -39,7 +35,7 @@ uninstall:
dist: all
@[ -n "$(VERSION)" ] || (echo "Error: version detection failed"; exit 1)
mkdir -p dist/fb-$(VERSION)
- cp -a fb-helper.c{,.in} fb{,.in} fb.pod fb.1 COPYING Makefile dist/fb-$(VERSION)
+ cp -a fb-helper.c fb{,.in} fb.pod fb.1 COPYING Makefile dist/fb-$(VERSION)
sed -i 's/^VERSION:=.*$$/VERSION:='$(VERSION)'/' dist/fb-$(VERSION)/Makefile
cd dist; tar -czf fb-$(VERSION).tar.gz fb-$(VERSION)
diff --git a/fb-helper.c.in b/fb-helper.c
index 75553a2..81428fa 100644
--- a/fb-helper.c.in
+++ b/fb-helper.c
@@ -141,7 +141,7 @@ int main(int argc, char *argv[])
CURL *curl;
CURLcode res;
- char *userAgent = "fb-client/@VERSION@";
+ char *userAgent = "fb-client/"VERSION;
struct progressData cb_data = {
.starttime = {.tv_sec = 0, .tv_usec = 0},