Makefile.types 3.14 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
 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 \
53
 cduce/runtime/serial.ml
54 55

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

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

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

64 65 66 67 68 69
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

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


73 74 75 76 77 78 79 80 81 82 83 84 85
#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' $<
#
#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' $<
#
#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' $<

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

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

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

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

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

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


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

include cduce/types_depend

109 110 111 112 113 114


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