Makefile.types 3.13 KB
Newer Older
1
DIRS= cduce/misc cduce/types cduce/compile cduce/runtime
2 3

SRC= \
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
 cduce/misc/serialize.mli \
 cduce/misc/serialize.ml \
 cduce/misc/custom.ml \
 cduce/misc/custom.ml \
 cduce/misc/encodings.mli \
 cduce/misc/encodings.ml \
 cduce/misc/imap.mli \
 cduce/misc/imap.ml \
 cduce/misc/state.mli \
 cduce/misc/state.ml \
 cduce/misc/pool.mli \
 cduce/misc/pool.ml \
 cduce/misc/ns.mli \
 cduce/misc/ns.ml \
 cduce/types/sortedList.mli \
 cduce/types/sortedList.ml \
 cduce/types/atoms.mli \
 cduce/types/atoms.ml \
 cduce/misc/bool.mli \
 cduce/misc/bool.ml \
 cduce/types/chars.mli \
 cduce/types/chars.ml \
 cduce/types/ident.ml \
 cduce/types/intervals.mli \
 cduce/types/intervals.ml \
 cduce/misc/inttbl.mli \
 cduce/misc/inttbl.ml \
 cduce/types/normal.mli \
 cduce/types/normal.ml \
 cduce/misc/pretty.mli \
 cduce/misc/pretty.ml \
 cduce/misc/stats.mli \
 cduce/misc/stats.ml \
 cduce/types/ident.ml \
 cduce/types/types.mli \
 cduce/types/types.ml \
 cduce/types/sequence.mli \
 cduce/types/sequence.ml \
 cduce/types/sample.mli \
 cduce/types/sample.ml \
 cduce/types/patterns.mli \
 cduce/types/patterns.ml \
 cduce/compile/lambda.mli \
 cduce/compile/lambda.ml \
 cduce/runtime/value.mli \
 cduce/runtime/value.ml \
 cduce/runtime/run_dispatch.mli \
 cduce/runtime/run_dispatch.ml \
 cduce/runtime/serial.mli \
 cduce/runtime/serial.ml
54

55 56

ML_SRC=$(filter %.ml,$(SRC))
57
CDUCE_OBJECTS=$(ML_SRC:.ml=.cmo)
58

59
$(CDUCE_OBJECTS) $(CDUCE_OBJECTS:.cmo=.cmi): $(COMPILER)
60
$(CDUCE_OBJECTS:.cmo=.cmx): $(OPTCOMPILER)
61

62 63
cduce_types.cmo: $(CDUCE_OBJECTS)
	$(CAMLC) $(COMPFLAGS) -pack -o cduce_types.cmo $(CDUCE_INCLUDES) $^
64

65 66 67 68 69 70
cduce_types.cmx: $(CDUCE_OBJECTS:.cmo=.cmx)
	$(CAMLOPT) $(OPTCOMPFLAGS) -pack -o cduce_types.cmx $(CDUCE_INCLUDES) $^
cduce_types.p.cmx: cduce_types.cmx
	cp cduce_types.cmx cduce_types.p.cmx
	cp cduce_types.o cduce_types.p.o

71
CDUCE_INCLUDES = $(DIRS:%=-I %)
72 73


74 75
cduce/types/intervals.cmo: cduce/types/intervals.ml cduce/cat1 cduce/types/intervals_int.ml
	$(CAMLC) $(COMPFLAGS) -c $(CDUCE_INCLUDES) -pp 'cduce/cat1 cduce/types/intervals_int.ml' $<
76

77 78 79
cduce/types/intervals.cmx: cduce/types/intervals.ml cduce/cat1 cduce/types/intervals_int.ml
	$(CAMLOPT) $(OPTCOMPFLAGS) -c $(CDUCE_INCLUDES) -pp 'cduce/cat1 cduce/types/intervals_int.ml' $<

80 81
cduce/types/intervals.cmi: cduce/types/intervals.mli cduce/cat1 cduce/types/intervals_int.mli
	$(CAMLC) $(COMPFLAGS) -c $(CDUCE_INCLUDES) -pp 'cduce/cat1 cduce/types/intervals_int.mli' $<
82

83 84
cduce/misc/stats.cmo: cduce/misc/stats.ml
	$(CAMLC) $(COMPFLAGS) -c $(CDUCE_INCLUDES) -pp 'sed s/Unix\\.gettimeofday\(\)/0./' $<
85 86
cduce/misc/stats.cmx: cduce/misc/stats.ml
	$(CAMLOPT) $(OPTCOMPFLAGS) -c $(CDUCE_INCLUDES) -pp 'sed s/Unix\\.gettimeofday\(\)/0./' $<
87

88 89
cduce/cat1:
	echo "cat \$$1" > cduce/cat1
90
	chmod +x cduce/cat1
91 92 93 94

.SUFFIXES: .ml .mli .cmo .cmi .cmx

.ml.cmo:
95
	$(CAMLC) $(COMPFLAGS) -c $(CDUCE_INCLUDES) $<
96 97

.ml.cmx:
98
	$(CAMLOPT) $(OPTCOMPFLAGS) -c $(CDUCE_INCLUDES) $<
99 100

.mli.cmi:
101
	$(CAMLC) $(COMPFLAGS) -c $(CDUCE_INCLUDES) $<
102 103 104


.PHONY: compute_depend
105 106 107 108 109
cduce/compute_depend:
	ocamldep $(INCLUDES) $(SRC) > cduce/types_depend

include cduce/types_depend

110 111 112 113 114 115


clean:
	for i in $(DIRS); do \
	(cd $$i; rm -f *.cmi *.cmo *.cma *.cmx *.o *.a *.cmxa *~); \
	done