Makefile 1011 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10
# ------------------------------------------------------------------------------

# Variables.

PACKAGE := \
  visitors

PLUGIN := \
  ppx_deriving_$(PACKAGE)

11 12 13 14
RUNTIME := \
  VisitorsRuntime

# Not sure whether all of the following files are really required.
15
OCAMLBUILD_TARGET := \
16 17
  $(patsubst %,$(PLUGIN).%,a cma cmxa cmxs) \
  $(patsubst %,$(RUNTIME).%,a cma cmi cmo cmx cmxa o) \
18 19 20 21 22 23 24 25 26 27 28 29

OCAMLBUILD_FLAGS := \
  -use-ocamlfind \
  -classic-display \
  -cflags "-g" -lflags "-g"

# ------------------------------------------------------------------------------

# Rules.

.PHONY: all clean install uninstall

30
all: $(PLUGIN).mllib $(PLUGIN).mldylib
31 32 33
	ocamlbuild $(OCAMLBUILD_FLAGS) $(OCAMLBUILD_TARGET)

clean:
34
	rm -f $(PLUGIN).mllib $(PLUGIN).mldylib
35 36 37 38 39 40 41 42
	rm -f *~
	ocamlbuild $(OCAMLBUILD_FLAGS) -clean

install: all
	ocamlfind install $(PACKAGE) META $(patsubst %,_build/%,$(OCAMLBUILD_TARGET))

uninstall:
	ocamlfind remove $(PACKAGE)
43 44 45 46 47 48

$(PLUGIN).mllib: manifest
	cp -f $< $@

$(PLUGIN).mldylib: manifest
	cp -f $< $@