use a makefile for processing files according two Suffix Rules -
i have docroot folder containing source files need built .usp -> .so .htt -> .html
currently makefile has following : .suffixes: .usp .htt
sources = $(wildcard docroot/*.usp) $(wildcard docroot/*.htt) objects = $(sources:.usp=.so) $(sources:.htt=.html) : ${objects} .phony : %.usp: %.so usp_compile_incl.sh -i ~/projects/concise-ile/include $< %.htt: %.html gpp -i~/projects/concise-ile/include -c $< -o $@ .phony: clean clean: rm -f docroot/*.so docroot/*.html
make: *** no rule make target 'docroot/fortune.so', needed 'all'. stop.
solution per sauerburger
.suffixes: .usp .htt sources_usp = $(wildcard docroot/*.usp) sources_htt = $(wildcard docroot/*.htt) objects = $(sources_usp:.usp=.so) $(sources_htt:.htt=.html) : ${objects} .phony : %.so: %.usp usp_compile_incl.sh -i ~/projects/concise-ile/include $< %.html: %.htt gpp -i~/projects/concise-ile/include -c $< -o $@
the build rules .so
, .html
wrong way round. should work:
%.so: %.usp usp_compile_incl.sh -i ~/projects/concise-ile/include $< %.html: %.htt gpp -i~/projects/concise-ile/include -c $< -o $@
the syntax of rules target: dependencies
.
you should split sources variable
sources_usp = $(wildcard docroot/*.usp) sources_htt = $(wildcard docroot/*.htt) objects = $(sources_usp:.usp=.so) $(sources_htt:.htt=.html)
otherwise end mixed objects list. first replacement include *.htt
files, , second include *.ups
files.
Comments
Post a Comment