Test change - can I push OK?
[kdeedu-porting.git] / kalzium / src / solver / Makefile
blob6d87d39a31254326fa138ef38c219746336e0697
2 OCAMLC = ocamlc -g
3 OCAMLMLI = ocamlc
4 OCAMLOPT = ocamlopt
5 OCAMLDEP = ocamldep
6 INCLUDES = -I +facile
7 OPTOPT =
8 OCAMLLIB := $(shell echo `ocamlc -where`)
9 FACILELIB = $(OCAMLLIB)/facile
12 # link to these libraries
13 LIBADD_CMX = $(OCAMLLIB)/facile/facile.cmxa #$(OCAMLLIB)/str.cmxa
14 LIBADD_CMO = $(OCAMLLIB)/facile/facile.cma #$(OCAMLLIB)/str.cma
16 # our sources
17 SOURCES_CHEM = chemset.ml parser.ml lexer.ml datastruct.ml chem.ml calc.ml
18 SOURCES_WRAP = modwrap.c
20 # the targets
21 CHEM_CMO = $(SOURCES_CHEM:.ml=.cmo)
22 CHEM_CMX = $(SOURCES_CHEM:.ml=.cmx)
23 CHEM_O = $(SOURCES_WRAP:.c=.o)
25 # default target : the object files for eqchem
26 all : solver.o
28 # shows how to build a program that embeds the solver
29 # in compiled ocaml, bytecode ocaml and compiled program using compiled caml code
30 test: atestprog.opt btestprog.out testcprog
32 atestprog.opt: $(CHEM_CMX) main.cmx
33 $(OCAMLOPT) -o $@ $(LIBADD_CMX) $(CHEM_CMX) main.cmx
35 btestprog.out: $(CHEM_CMO) main.cmo
36 $(OCAMLMLI) -o $@ $(LIBADD_CMO) $(CHEM_CMO) main.cmo
38 solver.o: $(CHEM_CMX) $(CHEM_O)
39 $(OCAMLOPT) -output-obj -o solver.o $(LIBADD_CMX) $(CHEM_CMX)
40 cp -f solver.o modwrap.o ../
42 testcprog: $(CHEM_CMX) $(CHEM_O)
43 $(OCAMLOPT) -output-obj -o solver.o $(LIBADD_CMX) $(CHEM_CMX) modwrap.o
44 gcc -c -o main.o main.c -L $(OCAMLLIB)
45 gcc -o $@ main.o solver.o -L $(OCAMLLIB) \
46 -L $(OCAMLLIB)/facile -lasmrun -lstr -lnums -lm -ldl modwrap.o
48 .SUFFIXES:
49 .SUFFIXES: .ml .mli .mly .mll .cmi .cmo .cmx .p.cmx .c
51 .ml.cmo :
52 $(OCAMLC) $(INCLUDES) $(INCLUDES) -c $<
54 .mli.cmi :
55 $(OCAMLMLI) $(INCLUDES) -c $<
57 .ml.cmx :
58 $(OCAMLOPT) $(OPTOPT) $(INCLUDES) -c $<
60 .mly.ml :
61 ocamlyacc $<
63 .mll.ml :
64 ocamllex $<
66 %.o : %.c
67 $(OCAMLOPT) $(OPTOPT) $(INCLUDES) -c $<
69 clean:
70 \rm -f *.cm[iox] *.o *~ .depend *testprog.* testcprog
72 cleanall : clean
73 \rm -f *.cmxa *.a *.cma
75 distclean : clean
77 interfaces:
78 ocamlc -i datastruct.ml > datastruct.mli
79 ocamlc -I +facile -i chem.ml > chem.mli
80 ocamlc -I +facile -i calc.ml > calc.mli
82 maintainer-clean : clean
84 uninstall : clean
86 install :
87 echo "done"
89 .depend: parser.ml lexer.ml
90 $(OCAMLDEP) $(INCLUDES) *.mli *.ml > $@
92 include .depend