Makefile.types 2 KB
Newer Older
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
DIRS= misc types

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 45 46
 types/sequence.ml \
 types/sample.mli \
 types/sample.ml \
 types/patterns.mli \
 types/patterns.ml

47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63

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

64
cduce_types.cmo: $(OBJECTS)
65 66 67 68 69 70 71
	$(CAML) -pack -o cduce_types.$(EXT) $(INCLUDES) $^
	$(CAML) -a -o cduce_types.$(EXTA) $(INCLUDES) cduce_types.$(EXT)

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


72
types/intervals.$(EXT): types/intervals.ml cat1 types/intervals_int.ml
73 74
	$(CAML) -c $(INCLUDES) -pp './cat1 types/intervals_int.ml' $<

75
types/intervals.cmi: types/intervals.mli cat1 types/intervals_int.mli
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 102 103 104 105 106 107 108 109
	$(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