Added rlimits, support for objects.
[xavierbot.git] / Makefile
1 # $Id: Makefile,v 1.3 2007/06/28 23:18:28 rjones Exp $
2
3 include Makefile.config
4
5 CC      := gcc
6 CFLAGS  := -Wall -Werror
7
8 all: pa_noexternal.cmo init ocamlbotwrapper xavierbot.pl
9
10 ocamlbotwrapper: ocamlbotwrapper.o
11         $(CC) $(CFLAGS) $< -o $@
12
13 ocamlbotwrapper.c: ocamlbotwrapper.c.in Makefile.config
14         sed \
15           -e 's|@OCAML@|$(OCAML)|' \
16           -e 's|@INITSCRIPT@|$(INITSCRIPT)|' \
17           -e 's|@CHROOTDIR@|$(CHROOTDIR)|' \
18           < $< > $@
19
20 init: init.in Makefile.config
21         sed \
22           -e 's|@OCAMLUSER@|$(OCAMLUSER)|' \
23           -e 's|@CHROOTDIR@|$(CHROOTDIR)|' \
24           < $< > $@
25
26 xavierbot.pl: xavierbot.pl.in Makefile.config
27         sed \
28           -e 's|@WRAPPER@|$(WRAPPER)|' \
29           < $< > $@
30         chmod 0755 $@
31
32 pa_noexternal.cmo: pa_noexternal.ml
33         ocamlfind ocamlc \
34           -pp "camlp4o pa_extend.cmo q_MLast.cmo" -I +camlp4 -c $<
35
36 test check:
37         perl -Tc xavierbot.pl
38
39 clean:
40         rm -f ocamlbotwrapper *.o *.cmo *.cmi *~
41
42 # Use this if you want to run without installing (see also
43 # instructions in Makefile.config):
44
45 permissions:
46         chown root.root ocamlbotwrapper
47         chmod ug+s ocamlbotwrapper
48
49 # Distribution.
50
51 dist:
52         $(MAKE) check-manifest
53         rm -rf $(PACKAGE)-$(VERSION)
54         mkdir $(PACKAGE)-$(VERSION)
55         tar -cf - -T MANIFEST | tar -C $(PACKAGE)-$(VERSION) -xf -
56         tar zcf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
57         rm -rf $(PACKAGE)-$(VERSION)
58         ls -l $(PACKAGE)-$(VERSION).tar.gz
59
60 check-manifest:
61         @for d in `find -type d -name CVS | grep -v '^\./debian/'`; \
62         do \
63         b=`dirname $$d`/; \
64         awk -F/ '$$1 != "D" {print $$2}' $$d/Entries | \
65         sed -e "s|^|$$b|" -e "s|^\./||"; \
66         done | sort > .check-manifest; \
67         sort MANIFEST > .orig-manifest; \
68         diff -u .orig-manifest .check-manifest; rv=$$?; \
69         rm -f .orig-manifest .check-manifest; \
70         exit $$rv
71
72
73 .PHONY: depend dist check-manifest dpkg doc print_test
74
75 .SUFFIXES:      .cmo .cmi .cmx .ml .mli