File: Makefile

package info (click to toggle)
ocamlagrep 1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 160 kB
  • sloc: ml: 270; ansic: 252; makefile: 66
file content (57 lines) | stat: -rw-r--r-- 1,014 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
OCAMLC=ocamlc -g -bin-annot
OCAMLOPT=ocamlopt -bin-annot
OCAMLMKLIB=ocamlmklib
OCAMLDEP=ocamldep
CFLAGS=-O -D_XOPEN_SOURCE=500 -DCAML_NAME_SPACE

C_OBJS=engine.o
CAML_OBJS=agrep.cmo

all: libagrep.a agrep.cma agrep.cmxa

agrep.cma: $(CAML_OBJS)
	$(OCAMLMKLIB) -o agrep $(CAML_OBJS)

agrep.cmxa: $(CAML_OBJS:.cmo=.cmx)
	$(OCAMLMKLIB) -o agrep $(CAML_OBJS:.cmo=.cmx)

libagrep.a: $(C_OBJS)
	$(OCAMLMKLIB) -o agrep $(C_OBJS)

install:
	ocamlfind install agrep META \
	  agrep.mli agrep.cmi agrep.cmti agrep.cma agrep.cmxa agrep.a \
          libagrep.a $(wildcard dllagrep.*)

uninstall:
	ocamlfind remove agrep

testagrep: testagrep.ml agrep.cma libagrep.a
	$(OCAMLC) -I . -custom -o $@ agrep.cma testagrep.ml

clean::
	rm -f testagrep

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

.mli.cmi:
	$(OCAMLC) -c $<

.ml.cmo:
	$(OCAMLC) -c $<

.ml.cmx:
	$(OCAMLOPT) -c $<

.c.o:
	$(OCAMLC) -ccopt "$(CFLAGS)" -c $<

clean::
	rm -f *.cm* *.o *.a *.so

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

engine.o: skeleton.h

include .depend