# 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