use MAKEFILE_LIST to get the name of the top make file

this way we dont assume the make file is 'Makefile' so it will
work if named 'makefile'
This commit is contained in:
anthony cantor 2013-11-21 18:53:36 -07:00
parent 51f1271b32
commit 65115b6f74

View file

@ -877,10 +877,11 @@ $(OBJDIR)/libs/%.o: $(USER_LIB_PATH)/%.c
@$(MKDIR) $(dir $@)
$(CC) -MMD -c $(CPPFLAGS) $(CFLAGS) $< -o $@
USER_MAKEFILE := $(firstword $(MAKEFILE_LIST))
ifdef COMMON_DEPS
COMMON_DEPS := $(COMMON_DEPS) Makefile
COMMON_DEPS := $(COMMON_DEPS) $(USER_MAKEFILE)
else
COMMON_DEPS := Makefile
COMMON_DEPS := $(USER_MAKEFILE)
endif
# normal local sources