File: Makefile

package info (click to toggle)
ounit 1.0.3-5
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 184 kB
  • ctags: 139
  • sloc: ml: 607; xml: 190; makefile: 88
file content (85 lines) | stat: -rw-r--r-- 1,613 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#
# $Id: Makefile,v 1.1.1.1 2008-06-07 03:17:22 maas Exp $
#

NAME=oUnit
OBJECTS=oUnit.cmo
XOBJECTS=$(OBJECTS:.cmo=.cmx)

ARCHIVE=oUnit.cma
XARCHIVE=$(ARCHIVE:.cma=.cmxa)

OCAMLRUN=ocamlrun
OCAMLC=ocamlc
OCAMLOPT=ocamlopt
OCAMLDEP=ocamldep
MKLIB=ocamlmklib
OCAMLDOC=ocamldoc
OCAMLFIND=ocamlfind

COMPFLAGS=-w A

### End of configuration section

all: $(ARCHIVE)
allopt: $(XARCHIVE)

$(ARCHIVE): $(OBJECTS)
	$(OCAMLC) -a -o $(ARCHIVE) $(OBJECTS)
$(XARCHIVE): $(XOBJECTS)
	$(OCAMLOPT) -a -o $(XARCHIVE) $(XOBJECTS)

depend: *.ml *.mli
	$(OCAMLDEP) *.mli *.ml > depend

.PHONY: test
test: unittest
	./unittest
.PHONY: testopt
testopt: unittest.opt
	./unittest.opt
.PHONY: testall
testall: test testopt

unittest: $(OBJECTS) $(TEST_OBJECTS)
	$(OCAMLFIND) ocamlc -o unittest -package unix -linkpkg \
	$(OBJECTS) test_OUnit.ml

unittest.opt: $(XOBJECTS) $(TEST_XOBJECTS)
	$(OCAMLFIND) ocamlopt -o unittest.opt -package unix -linkpkg \
	$(XOBJECTS) test_OUnit.ml

.PHONY: install
install: all
	{ test ! -f $(XARCHIVE) || extra="$(XARCHIVE) $(NAME).a"; }; \
	$(OCAMLFIND) install $(NAME) META $(NAME).mli $(NAME).cmi $(ARCHIVE) \
	$$extra

.PHONY: uninstall
uninstall:
	$(OCAMLFIND) remove $(NAME)

.PHONY: doc
doc: FORCE
	{ test -d doc || mkdir doc; };
	cd doc; $(OCAMLDOC) -html -I .. ../$(NAME).mli

.PHONY: clean
clean::
	rm -f *~ *.cm* *.o *.a *.so unittest unittest.opt doc/*.html doc/*.css

FORCE:

.SUFFIXES: .ml .mli .cmo .cmi .cmx

.mli.cmi:
	$(OCAMLC) -c $(COMPFLAGS) $<
.ml.cmo:
	$(OCAMLC) -c $(COMPFLAGS) $<
.ml.cmx:
	$(OCAMLOPT) -c $(COMPFLAGS) $<
.c.o:
	$(OCAMLC) -c -ccopt "$(CFLAGS)" $<

include depend