summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorChristian Eppler <c.eppler@linutonix.de>2013-05-13 16:22:27 +0200
committerChristian Eppler <c.eppler@linutonix.de>2013-05-13 16:22:27 +0200
commit9e05689406c83ae3020ca32a6ec6387466209138 (patch)
tree20a95a65df7e46b584c666ec74850df6d62b3045 /Makefile
parentcea5039322781f6085dd47954af5584ca3f78911 (diff)
Implement Kconfig build system
Signed-off-by: Christian Eppler <c.eppler@linutonix.de>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile115
1 files changed, 60 insertions, 55 deletions
diff --git a/Makefile b/Makefile
index 0c57970..66f002f 100644
--- a/Makefile
+++ b/Makefile
@@ -1,60 +1,65 @@
-SUBDIRS = application-devel flash-memory frameworks kernel-devel linux-basics protocols realtime security misc distribution
+NONE := $(shell touch .config)
+include .config
-default:
- make all
+TOP_DIR := $(CURDIR)
+PATHS :=
-all:
- for dir in $(SUBDIRS) ; do \
- (cd $$dir && make $@); \
+CONFIG_PATH := $(CURDIR)
+CONFIG_FILE := .config
+CONFIG := $(CONFIG_PATH)/$(CONFIG_FILE)
+DEPLOY_FOLDER := deploy
+DEPLOY := $(CONFIG_PATH)/$(DEPLOY_FOLDER)
+HANDOUT_FOLDER := handouts
+HANDOUT :=$(DEPLOY)/$(HANDOUT_FOLDER)
+
+BUILD_COMMAND := pdflatex
+BUILD_DEBUG := -halt-on-error
+BUILD_ARGS := $(BUILD_DEBUG) --interaction=patchmode
+BUILD := $(BUILD_COMMAND) $(BUILD_ARGS)
+
+KCONFIG_PATH := ./kconfig-frontends/frontends
+KCONFIG := $(KCONFIG_PATH)/conf/conf
+KMCONFIG := $(KCONFIG_PATH)/mconf/mconf
+
+LATEX_CONFIG := $(TOP_DIR)/config/
+
+EXCLUDE_PATH := grep -v ./kconfig-frontends | 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
+MAKE_FILES = $(shell find . -mindepth 2 -name Makefile | $(EXCLUDE_PATH))
+PATHS = $(dir $(MAKE_FILES))
+
+export
+
+build:
+ mkdir -p $(HANDOUT)
+ for dir in $(PATHS) ; do \
+ ($(MAKE) -C $$dir -f $(CURDIR)/modules.mk $@ ); \
done
+menuconfig:
+ $(KMCONFIG) Kconfig
+
+config:
+ $(KCONFIG) --oldaskconfig Kconfig
+
+oldconfig:
+ cp $@ .config
+ $(KCONFIG) --oldconfig Kconfig
+
clean:
- rm -rf pdf
- rm -f *.aux
- rm -f *.log
- rm -f *.nav
- rm -f *.toc
- rm -f *.pdf
- rm -f *.snm
- rm -f *.bbl
- rm -f *.blg
- rm -f *.out
- rm -f *.vrb
-pres:
- mv configpres.tex _configpres.tex
- touch configpres.tex
- mv tailpres.tex _tailpres.tex
- touch tailpres.tex
- pdflatex pres_master.tex
- bibtex pres_master.aux
- pdflatex pres_master.tex
- pdflatex pres_master.tex
- mv _configpres.tex configpres.tex
- mv _tailpres.tex tailpres.tex
- rm configpres.tex tailpres.tex
-book:
- mv confighandout.tex _confighandout.tex
- touch confighandout.tex
- mv tailhandout.tex _tailhandout.tex
- touch tailhandout.tex
- TEXINPUTS=`pwd`/wise:.:$(TEXINPUTS) pdflatex handout_master.tex
- bibtex handout_master.tex
- TEXINPUTS=`pwd`/wise:.:$(TEXINPUTS) pdflatex handout_master.tex
- TEXINPUTS=`pwd`/wise:.:$(TEXINPUTS) pdflatex handout_master.tex
- rm confighandout.tailhandout.tex
- mv _confighandout.tex confighandout.tex
- mv _tailhandout.tex tailhandout.tex
-pdf:
- rm -rf pdf
- mkdir -p pdf/pres
- mkdir -p pdf/handout
- mkdir -p pdf/hints
- find . -name pres_*.pdf | xargs cp -t pdf/pres
- find . -name hints_*.pdf | xargs cp -t pdf/hints
- find . -name handout_*.pdf | xargs cp -t pdf/handout
- cd pdf/pres && \
- pdfsam-console -o `pwd`/../pres.pdf -d `pwd` concat
- cd pdf/hints && \
- pdfsam-console -o `pwd`/../hints.pdf -d `pwd` concat
- cd pdf/handout && \
- pdfsam-console -o `pwd`/../handout.pdf -d `pwd` concat
+ @echo "Cleaning"
+ rm -rf $(DEPLOY_FOLDER)
+ 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 -rf $(DEPLOY_FOLDER)
+ for dir in $(PATHS) ; do \
+ ($(MAKE) -C $$dir -f $(CURDIR)/modules.mk clean ); \
+ done
+
+.PHONY: config oldconfig menuconfig build clean mrproper distclean