Commit add01315 authored by Taddeüs Kroes's avatar Taddeüs Kroes

Replaced OCamlMakefile with custom Makefile

parent 3feaacd0
RESULT := mincss
SOURCES := types.ml types.mli stringify.ml lexer.mll parser.mly util.ml parse.ml \
main.ml
PRE_TARGETS := types.ml types.cmi stringify.cmi
LIBS := str
BASENAMES := types stringify parser lexer util parse main
# Set debugging flag to enable exception backtraces for OCAMLRUNPARAM=b
OCAMLFLAGS := -g
OFILES := $(addsuffix .cmx,$(BASENAMES))
OCAMLYACC := menhir
YFLAGS := --infer --explain --dump
OCAMLCFLAGS := -g
OCAMLLDFLAGS :=
OCAMLLDLIBS := str.cmxa
.PHONY: all myclean
.PHONY: all clean
.PRECIOUS: $(addprefix .cmi,$(BASENAMES))
all: native-code
all: $(RESULT)
clean:: myclean
%.ml: %.mll
ocamllex -o $@ $<
# The Types module needs an implementation to stop ocamlc from complaining
types.ml: types.mli
cp $< $@
%.ml: %.mly
menhir --infer --explain $<
myclean:
rm -f a.out types.ml parser.conflicts parser.automaton
%.cmi: %.mli
ocamlc -c $(OCAMLCFLAGS) -o $@ $<
include OCamlMakefile
parser.cmx: parser.cmi
parser.mli: parser.ml
%.cmx: %.ml
ocamlfind ocamlopt -package batteries -c $(OCAMLCFLAGS) -o $@ $(<:.cmi=.ml)
$(RESULT): $(OFILES)
ocamlopt -o $@ $(OCAMLLDFLAGS) $(OCAMLLDLIBS) $^
clean:
rm -f *.cmi *.cmx *.o lexer.ml parser.ml parser.mli $(RESULT)
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment