makefile, add verbose options
This commit is contained in:
parent
5b02acc863
commit
4d59d22c13
@ -1,9 +1,9 @@
|
||||
FW_DIRS = $(wildcard fw_*)
|
||||
COMMON_DIRS = lib
|
||||
PROJECT_DEFAULT = atlys
|
||||
PROJECT_NAME ?= $(PROJECT_DEFAULT)
|
||||
PROJECT_DIR = fw_$(PROJECT_NAME)
|
||||
DIRS = $(COMMON_DIRS) $(PROJECT_DIR)
|
||||
FW_DIRS = $(wildcard fw_*)
|
||||
COMMON_DIRS = lib
|
||||
DIRS = $(COMMON_DIRS) $(PROJECT_DIR)
|
||||
|
||||
##### PRINT ###################################
|
||||
PW=\033[1m\033[0m
|
||||
@ -12,22 +12,26 @@ WH=\E[40;37m
|
||||
B=\033[1m
|
||||
pr_info = "$(B) $(GR)[$(1)]\t $(WH)$(2)$(PW)"
|
||||
|
||||
MAKE = $(if $(V),make, make -s)
|
||||
TARGETS = help build clean build_all distclean
|
||||
##### BUILD RULES #############################
|
||||
.PHONY: help build clean build_all distclean
|
||||
.SILENT: help $(if $(V),,$(TARGETS))
|
||||
.PHONY: $(TARGETS)
|
||||
|
||||
help:
|
||||
@echo -e "$$ make PROJECT_NAME=<top-file> <rule>"
|
||||
@echo -e "\tprojects (*=default) .. : $(shell echo $(FW_DIRS) | sed 's/fw_//g' | sed 's/$(PROJECT_DEFAULT)/\*$(PROJECT_DEFAULT)/')"
|
||||
@echo -e "\trule .................. : help build clean build_all distclean"
|
||||
echo -e "$$ make PROJECT_NAME=<top-file> <rule> [V=1]"
|
||||
echo -e "\tprojects (*=default) .. : $(subst $(PROJECT_DEFAULT),*$(PROJECT_DEFAULT),$(subst fw_,,$(FW_DIRS)))"
|
||||
echo -e "\trule .................. : $(TARGETS)"
|
||||
echo -e "\tV ..................... : verbose"
|
||||
|
||||
build: $(DIRS)
|
||||
@$(foreach dir,$^, echo -e $(call pr_info,MK,Building $(dir)); $(MAKE) -C $(dir) || exit 1;)
|
||||
$(foreach dir,$^, echo -e $(call pr_info,MK,Building $(dir)); $(MAKE) -C $(dir) || exit 1;)
|
||||
|
||||
clean: $(DIRS)
|
||||
@$(foreach dir,$^, echo -e $(call pr_info,MK,Cleaning $(dir)); $(MAKE) -C $(dir) clean || exit 1;)
|
||||
$(foreach dir,$^, echo -e $(call pr_info,MK,Cleaning $(dir)); $(MAKE) -C $(dir) clean || exit 1;)
|
||||
|
||||
build_all: $(COMMON_DIRS) $(FW_DIRS)
|
||||
@$(foreach dir,$^, echo -e $(call pr_info,MK,Building $(dir)); $(MAKE) -C $(dir) || exit 1;)
|
||||
$(foreach dir,$^, echo -e $(call pr_info,MK,Building $(dir)); $(MAKE) -C $(dir) || exit 1;)
|
||||
|
||||
distclean: $(COMMON_DIRS) $(FW_DIRS)
|
||||
@$(foreach dir,$^, echo -e $(call pr_info,MK,Cleaning $(dir)); $(MAKE) -C $(dir) clean || exit 1;)
|
||||
$(foreach dir,$^, echo -e $(call pr_info,MK,Cleaning $(dir)); $(MAKE) -C $(dir) clean || exit 1;)
|
||||
|
Loading…
Reference in New Issue
Block a user