Makefile 862 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.
POTTIER Francois's avatar
POTTIER Francois committed
15
TARGET := \
16 17
  $(patsubst %,$(PLUGIN).%,a cma cmxa cmxs) \
  $(patsubst %,$(RUNTIME).%,a cma cmi cmo cmx cmxa o) \
18

POTTIER Francois's avatar
POTTIER Francois committed
19 20 21
OCAMLBUILD := \
  ocamlbuild \
  -j 0 \
22 23 24 25 26 27 28 29
  -use-ocamlfind \
  -classic-display \
  -cflags "-g" -lflags "-g"

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

# Rules.

POTTIER Francois's avatar
POTTIER Francois committed
30
.PHONY: all clean install uninstall reinstall
31

32
all:
POTTIER Francois's avatar
POTTIER Francois committed
33
	$(OCAMLBUILD) $(TARGET)
34 35 36

clean:
	rm -f *~
POTTIER Francois's avatar
POTTIER Francois committed
37
	$(OCAMLBUILD) -clean
38 39

install: all
POTTIER Francois's avatar
POTTIER Francois committed
40
	ocamlfind install $(PACKAGE) META $(patsubst %,_build/%,$(TARGET))
41 42 43

uninstall:
	ocamlfind remove $(PACKAGE)
POTTIER Francois's avatar
POTTIER Francois committed
44 45 46

reinstall: uninstall clean
	@ $(MAKE) install