forked from nurpax/nurpawiki
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
41 lines (29 loc) · 887 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
CAMLBUILD := ocamlbuild -use-ocamlfind -classic-display
CMA := src/nurpawiki.cma
CMXA := src/nurpawiki.cmxa
CMXS := src/nurpawiki.cmxs
TARGETS := $(CMA)
ifneq ($(shell command -v ocamlopt),)
TARGETS += $(CMXA)
ifneq ($(wildcard $(shell ocamlc -where)/dynlink.cmxa),)
TARGETS += $(CMXS)
endif
endif
.PHONY: all install
all: $(TARGETS) META
$(CMA): src/version.ml
$(CAMLBUILD) $@
$(CMXA): src/version.ml
$(CAMLBUILD) $@
$(CMXS): src/version.ml
$(CAMLBUILD) $@
NWIKI_VER=$(shell cat VERSION)
src/version.ml: src/version.ml.in VERSION
sed -e "s|%_NURPAWIKI_VERSION_%|$(NWIKI_VER)|g" $< > $@
META: META.in VERSION
sed -e "s|%_NURPAWIKI_VERSION_%|$(NWIKI_VER)|g" $< > $@
clean:
$(CAMLBUILD) -clean
-rm -Rf _build META src/version.ml
install:
ocamlfind install nurpawiki META $(foreach T,$(TARGETS),_build/$(T) $(if $(findstring .cmxa,$(T)),_build/$(T:.cmxa=.a)))