diff options
| author | Christian Eppler <c.eppler@linutonix.de> | 2013-05-17 09:10:08 +0200 |
|---|---|---|
| committer | Christian Eppler <c.eppler@linutonix.de> | 2013-05-17 09:10:08 +0200 |
| commit | 65d86095c97fcb71541e110d9541e4017bd88ad9 (patch) | |
| tree | b58b44f73478d8d09b5918c74ec1c8a5e37b9005 /Makefile | |
| parent | 4bff7250e06b60e6546b0bb3ac6c43afc7518bcc (diff) | |
Cleanup Makefiles
Signed-off-by: Christian Eppler <c.eppler@linutonix.de>
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 34 |
1 files changed, 16 insertions, 18 deletions
@@ -1,3 +1,4 @@ +# If no .config on main folder i have to create one NONE := $(shell touch .config) include .config @@ -15,27 +16,25 @@ HANDOUT :=$(DEPLOY)/$(HANDOUT_FOLDER) BUILD_COMMAND := pdflatex BUILD_COMMAND_BIB := bibtex BUILD_DEBUG := -halt-on-error -BUILD_ARGS := $(BUILD_DEBUG) --interaction=patchmode -BUILD := $(BUILD_COMMAND) $(BUILD_ARGS) +BUILD_ARGS := --interaction=patchmode +BUILD := $(BUILD_COMMAND) $(BUILD_DEBUG) $(BUILD_ARGS) BUILD_BIB := $(BUILD_COMMAND_BIB) KCONFIG_PATH := ./kconfig-frontends/frontends KCONFIG := $(KCONFIG_PATH)/conf/conf KMCONFIG := $(KCONFIG_PATH)/mconf/mconf -LATEX_CONFIG := $(TOP_DIR)/config/ - MASTER_PRES := tmp_master_pres MASTER_HANDOUT := tmp_master_handout MASTER_END := .tex +# Folder that should not include to build paths EXCLUDE_PATH := grep -v ./kconfig-frontends | grep -v ./.git | grep -v ./kernel-devel/module-basics/vain | grep -v ./kernel-devel/module-basics/vain_pci | grep -v ./kernel-devel/module-basics/vain_plat -# Sesrch for all folders with Makfile + +# Search for all folders with Makfile MAKE_FILES = $(shell find . -mindepth 2 -name Makefile | $(EXCLUDE_PATH)) PATHS = $(dir $(MAKE_FILES)) -FIRST_FOLDER_LEVEL := $(shell find . -maxdepth 1 -mindepth 1 -type d | $(EXCLUDE_PATH)) - export build: @@ -50,7 +49,6 @@ ifdef CONFIG_BUILD_MASTER_HANDOUT ($(MAKE) -C ./ -f Makefile build_master_handout ); endif - menuconfig: $(KMCONFIG) Kconfig @@ -58,29 +56,29 @@ config: $(KCONFIG) --oldaskconfig Kconfig oldconfig: - cp $@ .config + cp $@ $(CONFIG_FILE) $(KCONFIG) --oldconfig Kconfig clean: @echo "Cleaning" rm -rf $(DEPLOY_FOLDER) - rm -f tmp_* + find -name "tmp*" -exec rm -f {} \; for dir in $(PATHS) ; do \ ($(MAKE) -C $$dir -f $(CURDIR)/modules.mk $@ ); \ done mrproper distclean: @echo "distclean" - rm -f .config - rm -f .config.old + rm -f $(CONFIG_FILE) + rm -f $(CONFIG_FILE).old rm -rf $(DEPLOY_FOLDER) - rm -f tmp_* + find -name "tmp*" -exec rm -f {} \; for dir in $(PATHS) ; do \ ($(MAKE) -C $$dir -f $(CURDIR)/modules.mk clean ); \ done build_master_pres: clean_master_pres - @echo "Build masterpres with:"$(obj-y) + @echo "Build masterpres with: "$(obj-y) for dir in $(PATHS) ; do \ ($(MAKE) -C $$dir -f $(CURDIR)/modules.mk build_master_pres ); \ ($(MAKE) -C $$dir -f $(CURDIR)/modules.mk build_master_pres_end ); \ @@ -88,19 +86,19 @@ build_master_pres: clean_master_pres clean_master_pres: ifneq ($(shell find . -name $(MASTER_PRES)*$(MASTER_END)), ) - `find . -name $(MASTER_PRES)*$(MASTER_END) -exec rm {} \;` + find . -name $(MASTER_PRES)*$(MASTER_END) -exec rm {} \; endif build_master_handout: clean_master_handout - @echo "Build master handout"$(obj-handout-y) + @echo "Build master handout with: "$(obj-handout-y) for dir in $(PATHS) ; do \ ($(MAKE) -C $$dir -f $(CURDIR)/modules.mk build_master_handout ); \ ($(MAKE) -C $$dir -f $(CURDIR)/modules.mk build_master_handout_end ); \ done - + clean_master_handout: ifneq ($(shell find . -name $(MASTER_HANDOUT)*$(MASTER_END)), ) - `find . -name $(MASTER_HANDOUT)*$(MASTER_END) -exec rm {} \;` + find . -name $(MASTER_HANDOUT)*$(MASTER_END) -exec rm {} \; endif .PHONY: config oldconfig menuconfig build clean mrproper distclean clean_master_pres build_master_handout |
