File: Makefile

package info (click to toggle)
ppx-type-conv 113.33.03-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 400 kB
  • ctags: 447
  • sloc: ml: 6,649; makefile: 56
file content (67 lines) | stat: -rw-r--r-- 1,700 bytes parent folder | download
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Generic Makefile for oasis project

SETUP := setup.exe
NAME := ppx_type_conv
PREFIX = $(shell grep ^prefix= setup.data | cut -d\" -f 2)

# Default rule
default: build

setup.exe: setup.ml
	ocamlopt.opt -o $@ $< || ocamlopt -o $@ $< || ocamlc -o $@ $<
	for f in setup.*; do [ $$f = $@ -o $$f = setup.ml ] || rm -f $$f; done

build: $(SETUP) setup.data
	./$(SETUP) -build $(BUILDFLAGS)
	$(MAKE) $(NAME).install

doc: $(SETUP) setup.data build
	./$(SETUP) -doc $(DOCFLAGS)

test: $(SETUP) setup.data build
	./$(SETUP) -test $(TESTFLAGS)

all: $(SETUP)
	./$(SETUP) -all $(ALLFLAGS)
	$(MAKE) $(NAME).install

$(NAME).install: install.ml setup.log setup.data
	ocaml -I "$(OCAML_TOPLEVEL_PATH)" install.ml

install: $(NAME).install
	opam-installer -i --prefix $(PREFIX) $(NAME).install

uninstall: $(NAME).install
	opam-installer -u --prefix $(PREFIX) $(NAME).install

reinstall: $(NAME).install
	opam-installer -u --prefix $(PREFIX) $(NAME).install &> /dev/null || true
	opam-installer -i --prefix $(PREFIX) $(NAME).install

bin.tar.gz: $(NAME).install
	rm -rf _install
	mkdir _install
	opam-installer -i --prefix _install $(NAME).install
	tar czf bin.tar.gz -C _install .
	rm -rf _install

bin.lzo: $(NAME).install
	rm -rf _install
	mkdir _install
	opam-installer -i --prefix _install $(NAME).install
	cd _install && lzop -1 -P -o ../bin.lzo `find . -type f`
	rm -rf _install

clean: $(SETUP)
	./$(SETUP) -clean $(CLEANFLAGS)

distclean: $(SETUP)
	./$(SETUP) -distclean $(DISTCLEANFLAGS)

configure: $(SETUP)
	./$(SETUP) -configure $(CONFIGUREFLAGS)

setup.data: $(SETUP)
	./$(SETUP) -configure $(CONFIGUREFLAGS)

.PHONY: default build doc test all install uninstall reinstall clean distclean configure