Makefile 1.13 KB
Newer Older
POTTIER Francois's avatar
POTTIER Francois committed
1 2 3 4 5 6 7 8 9 10
# ------------------------------------------------------------------------------

# Variables.

PACKAGE := \
  alphaLib

TARGET := \
  $(patsubst %,$(PACKAGE).%,a cma cmi cmo cmx cmxa o) \

11 12 13
PWD := \
  $(shell pwd)

POTTIER Francois's avatar
POTTIER Francois committed
14 15 16 17
OCAMLBUILD := \
  ocamlbuild \
  -use-ocamlfind \
  -classic-display \
18 19 20 21 22
  -plugin-tag 'package(cppo_ocamlbuild)' \
  -tag "cppo_I($(PWD))" \

# TEMPORARY cppo_I should not be required
# TEMPORARY a dependency computation on .cppo.ml files should be carried out
POTTIER Francois's avatar
POTTIER Francois committed
23 24 25 26 27

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

# Rules.

POTTIER Francois's avatar
POTTIER Francois committed
28
.PHONY: all clean install uninstall reinstall processed
POTTIER Francois's avatar
POTTIER Francois committed
29 30 31 32 33 34 35 36 37

all:
	$(OCAMLBUILD) $(TARGET)

clean:
	rm -f *~
	$(OCAMLBUILD) -clean

install: all
38 39 40
	ocamlfind install $(PACKAGE) META \
	  $(patsubst %,_build/%,$(TARGET)) \
	  AlphaLibMacros.cppo.ml \
POTTIER Francois's avatar
POTTIER Francois committed
41 42 43 44 45 46 47 48

# [make uninstall] attempts to uninstall, but succeeds even if uninstallation
# fails (probably because the package was not installed in the first place).
uninstall:
	ocamlfind remove $(PACKAGE) || true

reinstall: uninstall
	@ $(MAKE) install
POTTIER Francois's avatar
POTTIER Francois committed
49 50

include $(shell ocamlfind query visitors)/Makefile.preprocess
51
processed: Unbound.processed.ml