util  makerules at [689acafd82]

File makerules artifact 8c92429cd1 part of check-in 689acafd82


# vim: ft=make

MC = ocamlopt.opt
mc-opt = 3
mc-flags = $(if $(debug),-g,-O$(mc-opt))
mc = $(MC) $(mc-flags)

SC = chicken-csc
sc-opt = 5
sc-flags = $(if $(debug),-d3,-O$(sc-opt))
sc = $(SC) $(sc-flags)

cc-opt = fast
cc-flags = $(if $(debug),-g,-O$(cc-opt))
cc = $(CC) $(cc-flags)

post = $(if $(debug),, && strip $@)
cc-post = $(post)
sc-post = $(post)
mc-post = $(post)

%: %.c
	$(cc) $< -o$@ $(cc-post)

%: %.ml
	$(mc) $< -o $@ $(mc-post)

%: %.scm
	$(sc) $< -o $@ $(sc-post)

%.proj: %/makefile
	cd $* && make $*

%.proj: %/make.sh
	cd $* && ./make.sh