diff options
Diffstat (limited to 'modules.mk')
| -rw-r--r-- | modules.mk | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/modules.mk b/modules.mk new file mode 100644 index 0000000..d6c5bd1 --- /dev/null +++ b/modules.mk @@ -0,0 +1,111 @@ +#Include all selected obj-y files from folder +include Makefile + +BASE_NAME = $(shell basename $(dir $(CURDIR))) + +build: + for files in $(obj-y) ; do \ + ($(MAKE) -C ./ -f $(TOP_DIR)/modules.mk $$files ); \ + cp $$files $(DEPLOY)/ ; \ + done + +ifdef CONFIG_BUILD_HANDOUTS + for files in $(obj-handout-y) ; do \ + ($(MAKE) -C ./ -f $(TOP_DIR)/modules.mk $$files ); \ + cp $$files $(HANDOUT)/ ; \ + done +endif + +%.pdf: %.tex + echo "Build" $@ + TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) $(BUILD) $(subst .pdf,.tex,$@) +ifneq ($(CONFIG_BUILD_FAST_BUILD),y) + TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) $(BUILD_BIB) $(subst .pdf,.tex,$@) + TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) $(BUILD) $(subst .pdf,.tex,$@) + TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) $(BUILD) $(subst .pdf,.tex,$@) +endif + +# DON'T delete this empty target! Need for incremental build +%.tex: + + +clean: + 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 + +build_master_pres: +ifneq ($(filter $(PRES_PREFIX)%,$(obj-y)), ) + `echo "\input{$(dir $(CURDIR))section.tex}" >> ../$(MASTER_PRES)$(MASTER_END)` + for files in $(subst .pdf,.tex,$(filter $(PRES_PREFIX)%,$(obj-y))) ; do \ + `echo "\input{$(CURDIR)/$$files}" >> ../$(MASTER_PRES)$(MASTER_END)` ; \ + done +endif + +# Dirty for now the master_handout is build every time not only one time +build_master_$(PRES_PREFIX)end: +ifneq ($(filter $(PRES_PREFIX)%,$(obj-y)), ) + echo "\input{configmasterpres}" > ../$(MASTER_PRES)_$(BASE_NAME)$(MASTER_END) + cat ../$(MASTER_PRES)$(MASTER_END) >> ../$(MASTER_PRES)_$(BASE_NAME)$(MASTER_END) + echo "\input{tailmasterpres}" >> ../$(MASTER_PRES)_$(BASE_NAME)$(MASTER_END) + # Only for TESTING dirty hack *********************************** + mv $(TOP_DIR)/configpres.tex $(TOP_DIR)/_configpres.tex + mv $(TOP_DIR)/tailpres.tex $(TOP_DIR)/_tailpres.tex + touch $(TOP_DIR)/configpres.tex + touch $(TOP_DIR)/tailpres.tex + # *************************************************************** + TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) $(BUILD) ../$(MASTER_PRES)_$(BASE_NAME)$(MASTER_END) + +ifndef CONFIG_BUILD_FAST_BUILD + TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) $(BUILD) ../$(MASTER_PRES)_$(BASE_NAME)$(MASTER_END) + TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) $(BUILD) ../$(MASTER_PRES)_$(BASE_NAME)$(MASTER_END) +endif + # Only for TESTING dirty hack *********************************** + mv $(TOP_DIR)/_configpres.tex $(TOP_DIR)/configpres.tex + mv $(TOP_DIR)/_tailpres.tex $(TOP_DIR)/tailpres.tex + # *************************************************************** + cp $(MASTER_PRES)_$(BASE_NAME).pdf $(DEPLOY)/$(subst tmp_,,$(MASTER_PRES))_$(BASE_NAME).pdf +endif + +build_master_handout: +ifneq ($(filter $(HANDOUT_PREFIX)%,$(obj-handout-y)), ) + `echo "\input{$(dir $(CURDIR))section.tex}" >> ../$(MASTER_HANDOUT)$(MASTER_END)` + for files in $(subst .pdf,.tex,$(filter $(HANDOUT_PREFIX)%,$(obj-handout-y))) ; do \ + `echo "\input{$(CURDIR)/$$files}" >> ../$(MASTER_HANDOUT)$(MASTER_END)` ; \ + done +endif + +# Dirty for now the master_handout is build every time not only one time +build_master_$(HANDOUT_PREFIX)end: +ifneq ($(filter $(HANDOUT_PREFIX)%,$(obj-handout-y)), ) + echo "\input{configmasterhandout}" > ../$(MASTER_HANDOUT)_$(BASE_NAME)$(MASTER_END) + cat ../$(MASTER_HANDOUT)$(MASTER_END) >> ../$(MASTER_HANDOUT)_$(BASE_NAME)$(MASTER_END) + echo "\input{tailmasterhandout}" >> ../$(MASTER_HANDOUT)_$(BASE_NAME)$(MASTER_END) + # Only for TESTING dirty hack *********************************** + mv $(TOP_DIR)/confighandout.tex $(TOP_DIR)/_confighandout.tex + mv $(TOP_DIR)/tailhandout.tex $(TOP_DIR)/_tailhandout.tex + touch $(TOP_DIR)/confighandout.tex + touch $(TOP_DIR)/tailhandout.tex + # *************************************************************** + TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) $(BUILD) ../$(MASTER_HANDOUT)_$(BASE_NAME)$(MASTER_END) + +ifndef CONFIG_BUILD_FAST_BUILD + TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) $(BUILD) ../$(MASTER_HANDOUT)_$(BASE_NAME)$(MASTER_END) + TEXINPUTS=`pwd`/../..:.:..:$(TEXINPUTS) $(BUILD) ../$(MASTER_HANDOUT)_$(BASE_NAME)$(MASTER_END) +endif + # Only for TESTING dirty hack *********************************** + mv $(TOP_DIR)/_confighandout.tex $(TOP_DIR)/confighandout.tex + mv $(TOP_DIR)/_tailhandout.tex $(TOP_DIR)/tailhandout.tex + # *************************************************************** + cp $(MASTER_HANDOUT)_$(BASE_NAME).pdf $(HANDOUT)/$(subst tmp_,,$(MASTER_HANDOUT)_$(BASE_NAME).pdf) +endif + +.PHONY: clean build_master_$(PRES_PREFIX)end build_master_pres build_master_$(HANDOUT_PREFIX)end build_master_handout build + |
