OCAMLC=ocamlc OCAMLOPT=ocamlopt OCAMLDEP=ocamldep INCLUDES= # all relevant -I options here OCAMLFLAGS=$(INCLUDES) # add other options for ocamlc here OCAMLOPTFLAGS=$(INCLUDES) # add other options for ocamlopt here #all: testlexer testparser testparsergtk calculate all: calculate expression.ml: test.sablecc3 java org.sablecc.sablecc.SableCC -t ocaml test.sablecc3 # The list of object files for testlexer #TESTLEXER_OBJS=expression.cmo testlexer.cmo #testlexer: $(TESTLEXER_OBJS) # $(OCAMLC) -o testlexer $(OCAMLFLAGS) $(TESTLEXER_OBJS) # The list of object files for testparser #TESTPARSER_OBJS=expression.cmo testparser.cmo #TESTPARSERGTK_OBJS=expression.cmo testparsergtk.cmo #testparser: $(TESTPARSER_OBJS) # $(OCAMLC) -o testparser $(OCAMLFLAGS) $(TESTPARSER_OBJS) #testparsergtk.cmo: testparsergtk.ml expression.cmo # $(OCAMLC) -c -I +lablgtk2 -w s expression.ml $< astdisplay.cmo: astdisplay.ml expression.cmo $(OCAMLC) -c -I +lablgtk2 -w s expression.ml $< testparsergtk: $(TESTPARSERGTK_OBJS) $(OCAMLC) -I +lablgtk2 -w s -o testparsergtk lablgtk.cma gtkInit.cmo $(OCAMLFLAGS) $(TESTPARSERGTK_OBJS) main.cmo: main.ml $(OCAMLC) -c -I +lablgtk2 lablgtk.cma gtkInit.cmo $(OCAMLFLAGS) main.ml # I can't figure out how to tweak the Makefile to do this automatically. calculate: expression.cmo astdisplay.cmo calculate.cmo main.cmo $(OCAMLC) $(OCAMLFLAGS) -g -I +lablgtk2 -w s -o calculate lablgtk.cma gtkInit.cmo expression.ml astdisplay.ml calculate.ml main.ml # Common rules .SUFFIXES: .ml .mli .cmo .cmi .cmx .ml.cmo: $(OCAMLC) $(OCAMLFLAGS) -c $< .mli.cmi: $(OCAMLC) $(OCAMLFLAGS) -c $< .ml.cmx: $(OCAMLOPT) $(OCAMLOPTFLAGS) -c $< # Clean up clean: rm -f testlexer testparser testparsergtk calculate rm -f *.cm[iox] rm -f expression.ml # Dependencies depend: $(OCAMLDEP) $(INCLUDES) *.mli *.ml > .depend #include .depend