From b87e747713d6fcf2e67e9e187527fb2b040a5979 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 15 Sep 2011 21:56:28 +0200 Subject: use define instead of sed for VERSION expansion in helper Signed-off-by: Florian Pritz --- Makefile | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'Makefile') 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) -- cgit v1.2.3-24-g4f1b