mirror of
https://github.com/rkd77/elinks.git
synced 2025-01-03 14:57:44 -05:00
Make the init target safer, so it won't overwrite subdir Makefiles
This commit is contained in:
parent
ac51268514
commit
a527afaacf
@ -93,9 +93,10 @@ INCLUDE_ALL=1
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifneq ($(findstring init,$(MAKECMDGOALS)),)
|
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
|
INCLUDE_ALL=1
|
||||||
|
ifndef SRC
|
||||||
|
SRC = $(shell cd $(top_srcdir) && pwd)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifdef INCLUDE_ALL
|
ifdef INCLUDE_ALL
|
||||||
@ -130,7 +131,8 @@ all-default: $(LIB_O) $(PROGS) $(MAN1) $(MAN5)
|
|||||||
init-default:
|
init-default:
|
||||||
@$(foreach subdir,$(sort $(SUBDIRS)), \
|
@$(foreach subdir,$(sort $(SUBDIRS)), \
|
||||||
$(MKINSTALLDIRS) $(subdir) >/dev/null; \
|
$(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:
|
clean-default cleanall-default:
|
||||||
@-test -z "$(CLEAN)" || $(RM) $(CLEAN)
|
@-test -z "$(CLEAN)" || $(RM) $(CLEAN)
|
||||||
|
Loading…
Reference in New Issue
Block a user