1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

Make the init target safer, so it won't overwrite subdir Makefiles

This commit is contained in:
Jonas Fonseca 2006-01-29 10:41:25 +01:00 committed by Jonas Fonseca
parent ac51268514
commit a527afaacf

View File

@ -93,9 +93,10 @@ INCLUDE_ALL=1
endif
ifneq ($(findstring init,$(MAKECMDGOALS)),)
# FIXME: Detect when $(subdir)/Makefile is $(srcdir)/$(subdir)/Makefile
# and error out so the user won't overwrite the 'master' Makefiles.
INCLUDE_ALL=1
ifndef SRC
SRC = $(shell cd $(top_srcdir) && pwd)
endif
endif
ifdef INCLUDE_ALL
@ -130,7 +131,8 @@ all-default: $(LIB_O) $(PROGS) $(MAN1) $(MAN5)
init-default:
@$(foreach subdir,$(sort $(SUBDIRS)), \
$(MKINSTALLDIRS) $(subdir) >/dev/null; \
echo 'include $(SRC)/$(RELPATH)/$(subdir)/Makefile' > $(subdir)/Makefile;)
test -e "$(subdir)/Makefile" \
|| echo 'include $(SRC)/$(RELPATH)/$(subdir)/Makefile' > $(subdir)/Makefile;)
clean-default cleanall-default:
@-test -z "$(CLEAN)" || $(RM) $(CLEAN)