summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorHolger Dengler <dengler@linutronix.de>2018-04-19 16:18:38 +0200
committerJohn Ogness <john.ogness@linutronix.de>2018-04-19 22:19:56 +0200
commitb9c47deaa48d17be573f036ce4c53d829ccf58dd (patch)
treef0879b5808d8f25cc54ef90b47419fe221c083a9 /Makefile
parent3a9e6ae3993f3809e2bd5faa8ccb36896d3cb01b (diff)
build: cleanup PHONY targets
Use a variable for the PHONY targets. This makes it easier and robust to maintain this list. Signed-off-by: Holger Dengler <dengler@linutronix.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile15
1 files changed, 13 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 8ebf841..e1a8ecf 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,5 @@
# If no .config on main folder i have to create one
+PHONY :=
NONE := $(shell touch .config)
include .config
@@ -66,7 +67,11 @@ PATHS = $(dir $(MAKE_FILES))
export
-build: $(BUILD_REQ)
+PHONY += all
+all: build
+
+PHONY += build
+build:
ifdef CONFIG_BUILD_HANDOUTS
$(Q)mkdir -p $(DEPLOYHANDOUT)
$(Q)$(foreach dir,$(PATHS),$(MODMK) -C $(dir) buildhandouts;)
@@ -89,25 +94,31 @@ $(KMCONFIG):
$(KCONFIG):
cd kconfig-frontends/ && ./configure && make
+PHONY += menuconfig
menuconfig: $(KMCONFIG)
$(Q)$(KMCONFIG) Kconfig
+PHONY += config
config: $(KCONFIG)
$(Q)$(KCONFIG) --oldaskconfig Kconfig
+PHONY += oldconfig
oldconfig: $(KCONFIG)
$(Q)cp $@ $(CONFIG_FILE)
$(Q)$(KCONFIG) --oldconfig Kconfig
+PHONY += clean
clean:
$(Q)$(foreach dir,$(PATHS),$(MODMK) -C $(dir) $@_texfiles;)
$(Q)rm -rf $(DEPLOY_FOLDER) .lxformat_print
+PHONY += mrproper
mrproper: clean
$(Q)echo [CLEAN] $@
$(Q)rm -f $(CONFIG)
$(Q)rm -f $(CONFIG_OLD)
+PHONY += distclean
distclean: mrproper
$(Q)echo [CLEAN] $@
$(Q)find -name "tmp*" -exec rm -f {} \;
@@ -116,4 +127,4 @@ distclean: mrproper
$(Q)cp $(DEFCONF_FOLDER)/$@ $(CONFIG_FILE)
$(Q)$(KCONFIG) --oldconfig Kconfig
-.PHONY: config oldconfig menuconfig build clean mrproper distclean
+.PHONY: $(PHONY)