File: Makefile

package info (click to toggle)
spamoracle 1.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 296 kB
  • sloc: ml: 1,380; makefile: 135
file content (92 lines) | stat: -rw-r--r-- 1,866 bytes parent folder | download | duplicates (2)
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
86
87
88
89
90
91
92
### Configuration section

# The laguages you're interested in, besides English
LANGUAGES=-DFRENCH -DSPANISH -DITALIAN -DGERMAN -DPORTUGUESE -DJAPANESE

# How to invoke the C preprocessor
CPP=gcc -E -P $(LANGUAGES) -

# Where to install the binary
BINDIR=/usr/bin

# Where to install the man pages
MANDIR=/usr/share/man

### End of configuration section

OCAMLC=ocamlc -g
OCAMLLEX=ocamllex
OCAMLDEP=ocamldep
OCAMLOPT=ocamlopt

BYTEOBJS=configfile.cmo config.cmo \
  htmlscan.cmo mail.cmo database.cmo mbox.cmo wordsplit.cmo \
  refhosts.cmo rankmsg.cmo attachments.cmo processing.cmo main.cmo
BYTELIBS=unix.cma str.cma

NATOBJS=$(BYTEOBJS:.cmo=.cmx)
NATLIBS=$(BYTELIBS:.cma=.cmxa)

all: spamoracle

install:
	cp spamoracle $(DESTDIR)$(BINDIR)/spamoracle
	cp spamoracle.1 $(DESTDIR)$(MANDIR)/man1/spamoracle.1
	cp spamoracle.conf.5 $(DESTDIR)$(MANDIR)/man5/spamoracle.conf.5

install.byte:
	cp spamoracle.byte $(DESTDIR)$(BINDIR)/spamoracle
	cp spamoracle.1 $(DESTDIR)$(MANDIR)/man1/spamoracle.1
	cp spamoracle.conf.5 $(DESTDIR)$(MANDIR)/man5/spamoracle.conf.5

spamoracle: $(NATOBJS)
	$(OCAMLOPT) -o spamoracle $(NATLIBS) $(NATOBJS)

clean::
	rm -f spamoracle

spamoracle.byte: $(BYTEOBJS)
	$(OCAMLC) -o spamoracle.byte $(BYTELIBS) $(BYTEOBJS)

clean::
	rm -f spamoracle.byte

wordsplit.mll: wordsplit.mlp
	$(CPP) < wordsplit.mlp > wordsplit.mll \
        || { rm -f wordsplit.mll; exit 2; }

clean::
	rm -f wordsplit.mll

wordsplit.ml: wordsplit.mll
	$(OCAMLLEX) wordsplit.mll

clean::
	rm -f wordsplit.ml

beforedepend:: wordsplit.ml

htmlscan.ml: htmlscan.mll
	$(OCAMLLEX) htmlscan.mll

clean::
	rm -f htmlscan.ml

beforedepend:: htmlscan.ml

clean::
	rm -f *.cm[iox] *.o

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

.mli.cmi:
	$(OCAMLC) -c $<
.ml.cmo:
	$(OCAMLC) -c $<
.ml.cmx:
	$(OCAMLOPT) -c $<

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

include .depend