util  makerules at [6b40270f28]

File makerules artifact a224223f8c part of check-in 6b40270f28


# 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)

os = $(shell uname -o)

%: %.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

dep/%:
	make -C dep $*