[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Quilt-dev] [patch 1/4] makefile cleanup
From: |
John Vandenberg |
Subject: |
[Quilt-dev] [patch 1/4] makefile cleanup |
Date: |
Wed, 28 Sep 2005 11:54:41 +1000 |
User-agent: |
quilt/0.42-1 |
Fix rebuilds of quilt.1
Removes the phony compat-programs target
Explictly list targets to be build for `all'
Remove unnecessary use of egrep
Replace :: with :
Introduce function 'substitute' to do work for '% : %.in'
Refresh of pertainant parts of Andreas patch:
http://lists.gnu.org/archive/html/quilt-dev/2005-09/msg00254.html
Makefile.in | 45 +++++++++++++++++++++++++--------------------
1 file changed, 25 insertions(+), 20 deletions(-)
--- quilt-local.orig/Makefile.in
+++ quilt-local/Makefile.in
@@ -117,7 +117,7 @@ DIRT += $(MAN1)
LINGUAS := fr de ja
PO := quilt.pot $(LINGUAS:%=%.po)
SRC += $(PO:%=po/%)
-DIRT += po/*.mo po/*~
+DIRT += po/*.mo
SRC += $(wildcard test/*.test) test/run test/Makefile \
test/test.quiltrc
@@ -125,13 +125,14 @@ SRC += changes2changelog
#-----------------------------------------------------------------------
-all : scripts compat-programs $(if $(MSGFMT),$(LINGUAS:%=po/%.mo))
-
-.PHONY :: compat-programs
-compat-programs : $(COMPAT_PROGRAMS:%=compat/%)
- @for program in $+; do \
- test -x $$program || chmod +x $$program; \
- done
+all : $(BIN:%=bin/%) \
+ $(QUILT:%=quilt/%) \
+ $(SCRIPTS:%=scripts/%) \
+ $(LIB:%=lib/%) \
+ $(DOC:%=doc/%) \
+ $(MAN1) \
+ $(COMPAT_PROGRAMS:%=compat/%) \
+ $(if $(MSGFMT),$(LINGUAS:%=po/%.mo))
$(LIB:%=lib/%) : $(LIB_SRC:%.c=lib/%.o)
$(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
@@ -142,9 +143,6 @@ $(LIB:%=lib/%) : $(LIB_SRC:%.c=lib/%.o)
%.po : po/quilt.pot
msgmerge -o $@ $@ $^
-scripts : $(BIN:%=bin/%) $(QUILT:%=quilt/%) $(SCRIPTS:%=scripts/%) compat \
- $(LIB:%=lib/%) $(DOC:%=doc/%) $(MAN1)
-
dist : clean $(PACKAGE)-$(VERSION).tar.gz
snapshot : $(PACKAGE)-$(ISODATE).tar.bz2
@@ -173,8 +171,8 @@ doc/README : doc/README.in $(QUILT:%=qui
@echo "README.in -> README"
@while read line; do \
case "$$line" in \
- '@REFERENCE''@') \
- $(MAKE) -s reference |egrep -v '^make'\
+ @REFERENCE@) \
+ $(MAKE) -s reference | grep -v '^make' \
;; \
*) \
echo $$line \
@@ -182,7 +180,7 @@ doc/README : doc/README.in $(QUILT:%=qui
esac ; \
done 2>&1 < $< > $@
-doc/quilt.1: doc/quilt.1.in $(QUILT:%=quilt/%) compat-programs
+doc/quilt.1: doc/quilt.1.in $(QUILT:%=quilt/%)
@echo "quilt.1.in -> quilt.1"
@here=`pwd`; \
PATH="$$here/compat:$$PATH"; \
@@ -212,8 +210,8 @@ doc/quilt.1: doc/quilt.1.in $(QUILT:%=qu
esac ; \
done 2>&1 < $< > $@
-.PHONY :: reference
-reference : $(QUILT:%=quilt/%) compat-programs scripts/patchfns
+.PHONY : reference
+reference : $(QUILT:%=quilt/%) scripts/patchfns
@PATH="`pwd`/compat:$$PATH"; \
export PATH; \
dir=$(CURDIR); \
@@ -254,8 +252,7 @@ $(PACKAGE).spec : $(PACKAGE).spec.in $(P
gsub(/@CHANGELOG''@/, changelog) ; \
print }' changelog="$$changelog" $< > $@
-$(patsubst %.in,%,$(wildcard quilt/*.in scripts/*.in)) :: Makefile
-% :: %.in
+define substitute
@echo "$< -> $@" >&2
@sed -e 's:@LIB''@:$(LIB_DIR):g' \
-e 's:@QUILT''@:$(QUILT_DIR):g' \
@@ -268,8 +265,16 @@ $(patsubst %.in,%,$(wildcard quilt/*.in
-e 's:@LOCALEDIR''@:$(localedir):g' \
-e 's:@DOCSUBDIR''@:$(docdir)/$(PACKAGE)-$(VERSION):g' \
$< > $@
+endef
+
+$(patsubst %.in,%,$(wildcard */*.in)) : Makefile
+compat/% : compat/%.in
+ $(call substitute)
+ chmod +x $@
+% : %.in
+ $(call substitute)
-lib/backup-files.o :: Makefile
+lib/backup-files.o : Makefile
Makefile : Makefile.in
@echo "Please run ./configure"
@@ -348,4 +353,4 @@ uninstall ::
done
endif
-.PHONY :: all install uninstall clean distclean
+.PHONY : all install uninstall clean distclean
--
John