Makefile.types 2.14 KB
Newer Older
1
DIRS= misc types compile runtime
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

SRC= \
 misc/serialize.mli \
 misc/serialize.ml \
 misc/custom.ml \
 misc/custom.ml \
 misc/encodings.mli \
 misc/encodings.ml \
 misc/imap.mli \
 misc/imap.ml \
 misc/state.mli \
 misc/state.ml \
 misc/pool.mli \
 misc/pool.ml \
 misc/ns.mli \
 misc/ns.ml \
 types/sortedList.mli \
 types/sortedList.ml \
 types/atoms.mli \
 types/atoms.ml \
 misc/bool.mli \
 misc/bool.ml \
 types/chars.mli \
 types/chars.ml \
 types/ident.ml \
 types/intervals.mli \
 types/intervals.ml \
 misc/inttbl.mli \
 misc/inttbl.ml \
 types/normal.mli \
 types/normal.ml \
 misc/pretty.mli \
 misc/pretty.ml \
 misc/stats.mli \
 misc/stats.ml \
 types/ident.ml \
 types/types.mli \
39 40
 types/types.ml \
 types/sequence.mli \
41 42 43 44
 types/sequence.ml \
 types/sample.mli \
 types/sample.ml \
 types/patterns.mli \
45 46 47 48 49 50 51
 types/patterns.ml \
 compile/lambda.mli \
 compile/lambda.ml \
 runtime/value.mli \
 runtime/value.ml \
 runtime/serial.mli \
 runtime/serial.ml
52

53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

ML_SRC=$(filter %.ml,$(SRC))
OBJECTS=$(ML_SRC:.ml=.$(EXT))


CAMLC=ocamlc
CAMLOPT=ocamlopt
ifeq ($(NATIVE),true)
 EXT=cmx
 EXTA=cmxa
 CAML=$(CAMLOPT)
else
 EXT=cmo
 EXTA=cma
 CAML=$(CAMLC)
endif

70
cduce_types.cmo: $(OBJECTS)
71 72 73 74 75 76 77
	$(CAML) -pack -o cduce_types.$(EXT) $(INCLUDES) $^
	$(CAML) -a -o cduce_types.$(EXTA) $(INCLUDES) cduce_types.$(EXT)

HIDE=@
INCLUDES = $(DIRS:%=-I %)


78
types/intervals.$(EXT): types/intervals.ml cat1 types/intervals_int.ml
79 80
	$(CAML) -c $(INCLUDES) -pp './cat1 types/intervals_int.ml' $<

81
types/intervals.cmi: types/intervals.mli cat1 types/intervals_int.mli
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
	$(CAML) -c $(INCLUDES) -pp './cat1 types/intervals_int.mli' $<

misc/stats.$(EXT): misc/stats.ml
	$(CAML) -c $(INCLUDES) -pp 'sed s/Unix\\.gettimeofday\(\)/0./' $<

cat1:
	echo "cat \$$1" > cat1
	chmod +x cat1

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

.ml.cmo:
	@echo "Build $@"
	$(HIDE)$(CAMLC) -c $(INCLUDES) $<

.ml.cmx:
	@echo "Build $@"
	$(HIDE)$(CAMLOPT) -c $(INCLUDES) $<

.mli.cmi:
	@echo "Build $@"
	$(HIDE)$(CAMLC) -c $(INCLUDES) $<


.PHONY: compute_depend
compute_depend:
	ocamldep $(INCLUDES) $(SRC) > types_depend

include types_depend

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