2 ifeq ($(origin OCAMLPATH), undefined)
3 OCAMLFIND = OCAMLPATH=$(HOME)/svn/claudio/components/METAS ocamlfind
8 RELISE = $(MAIN:%=%_$(shell cat MakeVersion))
10 DOWNDIR = $(HOME)/svn/helm_stable/www/lambdadelta/download
12 DIRECTORIES = $(addprefix $(SRC)/,$(shell cat $(SRC)/Make))
14 INCLUDES = $(DIRECTORIES:%=-I %)
16 OCAMLDEP = $(OCAMLFIND) ocamldep -native $(INCLUDES)
17 OCAMLOPT = $(OCAMLFIND) opt $(OCAMLOPTIONS) -linkpkg -package "$(REQUIRES)" $(INCLUDES)
18 OCAMLLEX = ocamllex.opt
19 OCAMLYACC = ocamlyacc -v
20 TAR = tar -czf etc/$(MAIN:%=%.tgz)
23 MODULES += $$(addprefix $(1)/,$$(shell cat $(1)/Make))
27 SOURCES += $$(if $$(wildcard $(1).ml[yi]),$(1).mli $(1).ml,$(1).ml)
29 CLEAN += $(1).cmi $(1).cmx $(1).o
30 CLEAN += $$(if $$(wildcard $(1).ml[ly]),$(1).ml,)
31 CLEAN += $$(if $$(wildcard $(1).mly),$(1).mli $(1).output,)
32 KEEP += $$(if $$(wildcard $(1).mly),$(1).mly,\
33 $$(if $$(wildcard $(1).mll),$(1).mll,\
34 $$(if $$(wildcard $(1).mli),$(1).mli $(1).ml,$(1).ml)\
39 define INCLUDE_TEMPLATE
40 ifeq ($(MAKECMDGOALS), $(1))
45 $(foreach DIR, $(DIRECTORIES), $(eval $(call DIR_TEMPLATE, $(DIR))))
46 $(foreach MOD, $(MODULES), $(eval $(call MOD_TEMPLATE, $(MOD))))
48 OBJECTS = $(patsubst %.ml,%.cmx,$(SOURCES:%.mli=%.cmi))
52 @$(MAKE) --no-print-directory $(MAIN).opt
54 $(MAIN).opt: $(OBJECTS)
55 @echo " OCAMLOPT -o $(MAIN).opt"
56 $(H)$(OCAMLOPT) -o $(MAIN).opt $(CMXS)
58 .depend.opt: $(SOURCES)
59 @echo " OCAMLDEP -native"
60 $(H)$(OCAMLDEP) $^ > .depend.opt
63 @echo " CLEAN . $(SRC)"
64 $(H)find -name "*~" | xargs $(RM) $(CLEAN)
67 @echo " RELISE $(RELISE)"
68 $(H)mkdir -p $(RELISE)
69 $(H)$(foreach FILE, $(shell cat Make), cp --parents $(FILE) $(RELISE);)
70 $(H)tar -czf etc/$(RELISE).tar.gz $(RELISE)
71 $(H)scp etc/$(RELISE).tar.gz $(DOWNDIR)
74 @echo " TAR -czf $(MAIN:%=%.tgz) . $(DIRECTORIES)"
75 $(H)find -name "Make*" | xargs $(TAR) $(KEEP)
96 $(foreach TAG, $(TAGS), $(eval $(call INCLUDE_TEMPLATE, $(TAG))))