1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
include ../Makefile.config
FILES=$(wildcard *.ml)
TUTOWIKI= tutoeliom1.wiki tutoeliom2.wiki tutoeliom3.wiki
ifeq "$(OCAMLDUCE)" "YES"
DUCEMODBYTE=exampleduce.cmo
DUCEMODOPT=$(CMXSDUCE)
else
DUCEMODBYTE=
DUCEMODOPT=
endif
ifeq "$(NATDYNLINK)" "YES"
CMXS= $(FILES:.ml=.cmxs)
CMXSDUCE=exampleduce.cmxs
else
CMXS=
endif
LIB = $(LIBDIRS) -package lwt.unix,netstring,camlp4
CAMLC = $(OCAMLFIND) $(CAMLCNAME) $(DBG) $(LIB)
CAMLOPT = $(OCAMLFIND) $(CAMLOPTNAME) $(DBG) $(LIB)
CAMLDEP = $(OCAMLFIND) ocamldep $(LIB)
PP = -syntax camlp4o -ppopt "../xmlp4/xhtmlsyntax.cma" -ppopt "-loc loc"
OBJS = $(FILES:.ml=.cmo)
OBJSOPT = $(CMXS)
byte: $(OBJS) $(DUCEMODBYTE) miniwiki.byte $(TUTOWIKI)
opt: $(OBJSOPT) $(DUCEMODOPT) miniwiki.opt
exampleduce.cmo: ocamlduce/exampleduce.cmo
cp ocamlduce/exampleduce.cmo .
ocamlduce/exampleduce.cmo: ocamlduce/exampleduce.ml tutoeliom.cmo
$(OCAMLDUCEFIND) ocamlc $(DBG) $(LIB) -c ocamlduce/exampleduce.ml
exampleduce.cmx: ocamlduce/exampleduce.cmx
cp ocamlduce/exampleduce.cmx ocamlduce/exampleduce.o .
ocamlduce/exampleduce.cmx: ocamlduce/exampleduce.ml
$(OCAMLDUCEFIND) ocamlopt $(DBG) $(LIB) -c ocamlduce/exampleduce.ml
exampleduce.cmxs: exampleduce.cmx
$(OCAMLDUCEFIND) ocamlopt $(DBG) $(LIB) -linkall -shared \
-o ocamlduce/$*.cmxs $<
cp ocamlduce/exampleduce.cmxs .
miniwiki.byte:
$(MAKE) -C miniwiki byte
miniwiki.opt:
$(MAKE) -C miniwiki opt
tutoeliom1.wiki: tutoeliom.ml
cat tutoeliom.ml | sed '1,/(\*wiki\*/d' | sed '/%<||2>%/,$$ d' | /bin/sh ./tutomake.sh > tutoeliom1.wiki
tutoeliom2.wiki: tutoeliom.ml
cat tutoeliom.ml | sed '/%<||3>%/,$$ d' | sed '1,/%<||2>%/d' | /bin/sh ./tutomake.sh > tutoeliom2.wiki
tutoeliom3.wiki: tutoeliom.ml
cat tutoeliom.ml | sed '/%<||4>%/,$$ d' | sed '1,/%<||3>%/d' | /bin/sh ./tutomake.sh > tutoeliom3.wiki
.SUFFIXES:
.SUFFIXES: .ml .mli .cmo .cmi .cmx .cmxs
.PHONY: depend
.ml.cmo:
$(CAMLC) $(PP) -c $<
.mli.cmi:
$(CAMLC) -c $<
.ml.cmx:
# -rm ../extensions/ocsipersist.cmx
$(CAMLOPT) $(PP) -c $<
# touch ../extensions/ocsipersist.cmx
.cmx.cmxs:
$(CAMLOPT) -shared -linkall -o $@ $<
clean:
$(MAKE) -C miniwiki clean
-rm -f *.cm[ioax] *.cmxa *.cmxs *.o *~ $(NAME) *.annot ocamlduce/*.cm[ioax] ocamlduce/*.cmxa ocamlduce/*.cmxs ocamlduce/*~ ocamlduce/*.annot
depend:
$(MAKE) -C miniwiki depend
$(CAMLDEP) $(PP) $(LIB) $(FILES:.ml=.mli) $(FILES) | sed s%ocsipersist.cmx%ocsipersist.cmi%g > .depend
FORCE:
-include .depend
|