# Diablo top level makefile. # Invoke using b.bat # In general, hierarchical makefile's are difficult, see: # http://aegis.sourceforge.net/auug97.pdf ("Recursive Make Considered Harmful") # # In this case, the dependancies are linear, i.e. # "scale" project depends on "libstdperiphusb" and "libcmisusb". # "libstdperiphusb" only depends on "libcmisusb" (and not "scale"). # "libcmisusb" does not depend on the other projects. # So there are no tricky circular project dependancies. # Project must be in dependancy order: #PROJECTS = bootstrap update scale2 nrf52832 PROJECTS = scale2 nrf52832 # pass into make VARIANT=ew5 or VARIANT=ew6. ifeq (x,x$(strip $(VARIANT))) # by default, build s3 VARIANT = s3 endif # object files go here... OBJ_DIR = obj/$(VARIANT) ROOT_DIR = $(CURDIR) .PHONY: clean all info $(PROJECTS) all: info $(PROJECTS) info: # @echo ' ' > build_log.log @echo Running: project.mak | tee -a build_log.log @echo Building: $(PROJECTS) | tee -a build_log.log @echo Root dir: $(ROOT_DIR) | tee -a build_log.log @echo Shell path: $$PATH | tee -a build_log.log @echo Variant: $(VARIANT) | tee -a build_log.log @echo ' ' | tee -a build_log.log @echo ' ' | tee -a build_log.log @echo ' ' | tee -a build_log.log $(PROJECTS): @echo Building $@ | tee -a build_log.log @mkdir -p $(ROOT_DIR)/$@/$(OBJ_DIR) @make --no-print-directory -r -C $(ROOT_DIR)/$@/$(OBJ_DIR) \ OBJ_DIR=$(OBJ_DIR) \ ROOT_DIR=$(ROOT_DIR) \ PROJ_DIR=$(ROOT_DIR)/$@ \ VARIANT=$(VARIANT) \ -f $(ROOT_DIR)/$@/makefile.mak 2>&1 | tee -a build_log.log @echo ' ' clean: info @echo ' ' @echo Cleaning: $(PROJECTS) for proj in $(PROJECTS); do rm -rf $(ROOT_DIR)/$$proj/obj; done; @echo ' '