Makefile 856 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
# ------------------------------------------------------------------------------

# Variables.

PACKAGE := \
  visitors

PLUGIN := \
  ppx_deriving_$(PACKAGE)

OCAMLBUILD_TARGET := \
  $(PLUGIN).cma $(PLUGIN).cmxa $(PLUGIN).cmxs

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

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

# Rules.

.PHONY: all clean install uninstall

25
all: $(PLUGIN).mllib $(PLUGIN).mldylib
26 27 28
	ocamlbuild $(OCAMLBUILD_FLAGS) $(OCAMLBUILD_TARGET)

clean:
29
	rm -f $(PLUGIN).mllib $(PLUGIN).mldylib
30 31 32 33 34 35 36 37
	rm -f *~
	ocamlbuild $(OCAMLBUILD_FLAGS) -clean

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

uninstall:
	ocamlfind remove $(PACKAGE)
38 39 40 41 42 43

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

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