From 682b4ba85c22ab9862304cb883a7234373e3f893 Mon Sep 17 00:00:00 2001 From: DJ Delorie Date: Tue, 3 Jul 2012 17:52:57 -0400 Subject: script->make, ccache move Convert build iteration logic (stage 2) from list driven to Makefile driven. Add actual dependencies to recipe files and use them to control build sequence. ccache is moved to stage1 and configured to be used in stage2. --- script2makefile | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 script2makefile (limited to 'script2makefile') diff --git a/script2makefile b/script2makefile new file mode 100644 index 0000000..63701a5 --- /dev/null +++ b/script2makefile @@ -0,0 +1,38 @@ +#!/usr/bin/make + +SCRIPTDIR := recipe.d +FRAGDIR := recipe.mk +RCFILE := ./scripts.rc + +SCRIPTS := $(sort $(wildcard ${SCRIPTDIR}/*[0-9A-Za-z])) +FRAGS := $(addsuffix .mk,$(addprefix ${FRAGDIR}/,$(notdir $(SCRIPTS)))) + +${FRAGDIR}/%.mk : ${SCRIPTDIR}/% + @( \ + if grep '^#skip' $< >/dev/null ; then true; else \ + deps=`grep '^#requires ' $< | sed 's@#requires @done\/@'` ;\ + deps=`echo $$deps` ;\ + base=`echo $* | sed 's/^[0-9][0-9][0-9][0-9]-//'` ;\ + echo TARGETS += done/$$base ;\ + echo ".PHONY: $$base" ;\ + echo "$$base : done/$$base" ;\ + echo " @true" ;\ + echo "done/$$base : $$deps" ;\ + echo " @echo " ;\ + echo " @echo Building $$base" ;\ + echo " @echo " ;\ + echo " @bash --rcfile ${RCFILE} -i ${SCRIPTDIR}/$*" ;\ + echo " @true > done/$$base" ;\ + fi \ + ) > $@ + +all.first : all.targets + @true + +TARGETS := + +include ${FRAGS} + +all.targets : ${TARGETS} + @echo + @echo 'done!' -- cgit