Makefile: fix some errors

* targets.mk: Repair .PHONY target.  Correctly group ORed parameters
  in find calls.  Introduce $(CLEANDIRS) and use variable instead of
  literals.  Have a command succeed at the end of `config-*´ so that
  no spurious warning is given by make.
This commit is contained in:
Achim Gratz 2012-08-19 18:54:15 +02:00
parent 226b15baa0
commit 00af0f9079
1 changed files with 10 additions and 10 deletions

View File

@ -5,6 +5,7 @@ DISTFILES_extra= Makefile request-assign-future.txt contrib etc
LISPDIRS = lisp LISPDIRS = lisp
OTHERDIRS = doc etc OTHERDIRS = doc etc
CLEANDIRS = contrib testing UTILITIES
SUBDIRS = $(OTHERDIRS) $(LISPDIRS) SUBDIRS = $(OTHERDIRS) $(LISPDIRS)
INSTSUB = $(SUBDIRS:%=install-%) INSTSUB = $(SUBDIRS:%=install-%)
ORG_MAKE_DOC ?= info html pdf ORG_MAKE_DOC ?= info html pdf
@ -25,8 +26,7 @@ endif
.PHONY: all oldorg update update2 up0 up1 up2 single $(SUBDIRS) \ .PHONY: all oldorg update update2 up0 up1 up2 single $(SUBDIRS) \
check test install $(INSTSUB) \ check test install $(INSTSUB) \
info html pdf card refcard doc docs \ info html pdf card refcard doc docs \
autoloads cleanall clean \ autoloads cleanall clean $(CLEANDIRS:%=clean%) \
cleancontrib cleantesting cleanutils
cleanrel clean-install cleanelc cleandirs \ cleanrel clean-install cleanelc cleandirs \
cleanlisp cleandoc cleandocs cleantest \ cleanlisp cleandoc cleandocs cleantest \
compile compile-dirty uncompiled \ compile compile-dirty uncompiled \
@ -57,7 +57,7 @@ config-cmd config-all::
$(info ========= Commands used by make) $(info ========= Commands used by make)
$(foreach var,$(CONF_CALL),$(info $(var) = $($(var))$(EOL))) $(foreach var,$(CONF_CALL),$(info $(var) = $($(var))$(EOL)))
config config-test config-exe config-all:: config config-test config-exe config-all::
$(info ) @echo ""
oldorg: compile info # what the old makefile did when no target was specified oldorg: compile info # what the old makefile did when no target was specified
uncompiled: cleanlisp autoloads # for developing uncompiled: cleanlisp autoloads # for developing
@ -123,11 +123,11 @@ clean: cleanrel
$(MAKE) -C doc clean $(MAKE) -C doc clean
cleanall: cleandirs cleantest cleanall: cleandirs cleantest
-$(FIND) . -name \*~ -o -name \*# -o -name .#\* -exec $(RM) {} \; -$(FIND) . \( -name \*~ -o -name \*# -o -name .#\* \) -exec $(RM) {} \;
-$(FIND) contrib testing UTILITIES -name \*~ -o -name \*.elc -exec $(RM) {} \; -$(FIND) $(CLEANDIRS) \( -name \*~ -o -name \*.elc \) -exec $(RM) {} \;
cleancontrib cleantesting cleanUTILITIES: $(CLEANDIRS:%=clean%):
-$(FIND) $(@:clean%=%) -name \*~ -o -name \*.elc -exec $(RM) {} \; -$(FIND) $(@:clean%=%) \( -name \*~ -o -name \*.elc \) -exec $(RM) {} \;
cleanutils: cleanUTILITIES cleanutils: cleanUTILITIES
@ -139,10 +139,10 @@ cleanrel:
cleanelc: cleanelc:
$(MAKE) -C lisp $@ $(MAKE) -C lisp $@
cleanlisp: cleanlisp cleandoc:
$(MAKE) -C lisp clean $(MAKE) -C $(@:clean%=%) clean
cleandoc cleandocs: cleandocs:
$(MAKE) -C doc clean $(MAKE) -C doc clean
-$(FIND) doc -name \*~ -exec $(RM) {} \; -$(FIND) doc -name \*~ -exec $(RM) {} \;