Commit fc81e86a authored by Josh Kunz's avatar Josh Kunz

Fixes major makefile clean error.

parent d0b0ee45
......@@ -2,51 +2,28 @@
OCAMLLEX_FLAGS =
OCAMLYACC_FLAGS =
OCAMLFLAGS =
OCAMLFLAGS = -I ../include/
bin = naga
par_prefix = Datalog
lex_prefix = $(par_prefix)Lex
yacc_prefix = $(par_prefix)Parse
libs = unix
interfaces = $(yacc_prefix).mli $(wildcard *.mli)
sources = Common.ml Datalog.ml Dot.ml
sources += $(yacc_prefix).ml $(lex_prefix).ml
sources += Fact.ml Query.ml Naga.ml
objects = $(patsubst %.ml,%.cmo,$(sources))
bin = nagad
sources = KG.ml Query.ml Nagad.ml
interfaces = $(patsubst %.mli,%.cmi,$(filter %.mli,$(sources)))
interfaces += $(patsubst %.ml,%.cmi,$(filter %.ml,$(sources)))
objects = $(patsubst %.ml,%.cmo,$(filter %.ml,$(sources)))
libs = json http
depfile = Makefile.d
default: $(bin)
$(bin): $(objects)
ocamlc $(OCAMLFLAGS) -o $@ $(addsuffix .cma,$(libs)) $^
abs_libs = $(addprefix ../lib/,$(addsuffix .cma,$(libs)))
$(lex_prefix).ml: $(par_prefix).mll
ocamllex $(OCAMLLEX_FLAGS) -o $@ $<
$(yacc_prefix).ml $(yacc_prefix).mli: $(par_prefix).mly
ocamlyacc $(OCAMLYACC_FLAGS) -b$(yacc_prefix) $<
%.cmo: %.ml
ocamlc $(OCAMLFLAGS) -c $<
%.cmx: %.ml
ocamlopt $(OCAMLFLAGS) -c $<
default: $(bin)
%.cmi: %.mli
ocamlc $(OCAMLFLAGS) -c $<
$(depfile): $(sources)
$(depfile): $(sources) $(interfaces)
ocamldep $(OCAMLFLAGS) $^ > $@
$(bin): $(abs_libs) $(objects)
ocamlc $(OCAMLFLAGS) -o $@ $^
clean:
-rm -f $(bin) *.cmo *.cmi *.o *.cmx
-rm -f $(lex_prefix).ml $(wildcard $(yacc_prefix).ml*)
-rm -f $(depfile)
-rm -f $(bin) $(objects) $(interfaces) $(depfile)
include $(depfile)
include ../common/Makefile.implicit
-include $(depfile)
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