1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- export MAKEFILE_NAME := $(notdir $(realpath $(lastword $(MAKEFILE_LIST))))
- export MAKEFILE_PATH := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
- export MAKEFILE_SUBDIR := $(MAKEFILE_PATH)$(MAKEFILE_NAME).d
- export MAKEFILE_CONFIG := $(MAKEFILE_SUBDIR)/$(MAKEFILE_NAME).config
- export MAKEFILE_DIRS := $(MAKEFILE_SUBDIR)/$(MAKEFILE_NAME).dirs
- export MAKEFILE_RULES := $(MAKEFILE_SUBDIR)/$(MAKEFILE_NAME).rules
- export MAKEFILE_MASTER := $(MAKEFILE_SUBDIR)/$(MAKEFILE_NAME).master
- $(info ========================================================================)
- $(info *** Main IFS make file started $(MAKEFILE_PATH)$(MAKEFILE_NAME))
- $(info ========================================================================)
- include $(MAKEFILE_DIRS)
- comp_tmp := $(IFS_COMPONENTS)
- define dep_sequence
- ifneq (,$(word 2,$(comp_tmp)))
- $(word 2,$(comp_tmp)):$(word 1,$(comp_tmp))
- comp_tmp := $$(wordlist 2,$$(words $$(comp_tmp)),$$(comp_tmp))
- endif
- endef
- .PHONY: master lib clean realclean dep-clean $(IFS_COMPONENTS)
- lib dep-clean: $(IFS_COMPONENTS)
- clean realclean: $(IFS_COMPONENTS) master
- master: lib
- $(foreach ,$(IFS_COMPONENTS),$(eval $(dep_sequence)))
- $(IFS_COMPONENTS):
- @echo "========================================================================"
- @echo "*** Making component $@: $(MAKECMDGOALS)"
- @echo "========================================================================"
- @echo -n "--> "
- $(MAKE) -C $(MAKEFILE_PATH)$@ -f $(MAKEFILE_NAME) $(MAKECMDGOALS)
- master:
- @echo "========================================================================"
- @echo "*** Making IFS master: $(MAKECMDGOALS)"
- @echo "========================================================================"
- @echo -n "--> "
- $(MAKE) -C $(MAKEFILE_PATH) -f $(MAKEFILE_MASTER) $(MAKECMDGOALS)
|