File: Makefile

package info (click to toggle)
ocsigenserver 2.16.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 2,480 kB
  • sloc: ml: 12,965; makefile: 807; sh: 622
file content (109 lines) | stat: -rw-r--r-- 2,175 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
include ../../Makefile.config

PACKAGE  :=		\
	bytes		\
	lwt.unix	\
	lwt_log		\
	ipaddr		\
	lwt_ssl		\
	lwt_react	\
	netstring	\
	netstring-pcre	\
	xml-light

LIBS     := -I ../baselib -I ../http -I ../server ${addprefix -package ,${PACKAGE}}
OCAMLC   := $(OCAMLFIND) ocamlc ${BYTEDBG} ${THREAD}
OCAMLOPT := $(OCAMLFIND) ocamlopt ${OPTDBG} ${THREAD}
OCAMLDOC := $(OCAMLFIND) ocamldoc
OCAMLDEP := $(OCAMLFIND) ocamldep

all: byte opt

### Extensions ###

FILES := staticmod.ml           \
	 cgimod.ml              \
	 redirectmod.ml         \
	 revproxy.ml            \
	 extensiontemplate.ml   \
         accesscontrol.ml       \
         userconf.ml            \
	 outputfilter.ml        \
	 authbasic.ml           \
	 rewritemod.ml          \
	 extendconfiguration.ml \
         ocsigen_comet.ml       \
         cors.ml                \

ifeq "$(CAMLZIP)" "YES"
FILES += deflatemod.ml
deflatemod.cmo deflatemod.cmx: LIBS+=-package ${CAMLZIPNAME}
endif

byte:: ${FILES:.ml=.cmo}
opt:: ${FILES:.ml=.cmx}
ifeq "$(NATDYNLINK)" "YES"
opt:: ${FILES:.ml=.cmxs}
endif

### PostgreSQL ###

ifeq "$(OCSIPERSISTPGSQL)" "YES"
byte::
	$(MAKE) -C ocsipersist-pgsql byte
opt::
	$(MAKE) -C ocsipersist-pgsql opt
endif
### SQLite ###

ifeq "$(OCSIPERSISTSQLITE)" "YES"
byte::
	$(MAKE) -C ocsipersist-sqlite byte
opt::
	$(MAKE) -C ocsipersist-sqlite opt
endif

### DBM ####

ifeq "$(OCSIPERSISTDBM)" "YES"
byte::
	$(MAKE) -C ocsipersist-dbm byte
opt::
	$(MAKE) -C ocsipersist-dbm opt
endif

##########

%.cmi: %.mli
	$(OCAMLC) ${LIBS} -c $<
%.cmo: %.ml
	$(OCAMLC) ${LIBS} -c $<
%.cmx: %.ml
	$(OCAMLOPT) ${LIBS} -c $<
%.cmxs: %.cmx
	$(OCAMLOPT) -shared -linkall -o $@ $<

## Clean up

clean: clean.local
	${MAKE} -C ocsipersist-dbm clean
	${MAKE} -C ocsipersist-sqlite clean
	${MAKE} -C ocsipersist-pgsql clean
clean.local:
	-rm -f *.cm* *.o *.a *.annot
	-rm -f ${PREDEP}
distclean: clean.local
	-rm -f *~ \#* .\#*
	${MAKE} -C ocsipersist-dbm distclean
	${MAKE} -C ocsipersist-sqlite distclean
	${MAKE} -C ocsipersist-pgsql distclean
	-rm -f .depend

## Dependencies

depend: ${PREDEP}
	$(OCAMLDEP) ${LIBS} *.mli *.ml > .depend
	${MAKE} -C ocsipersist-sqlite depend

FORCE:
-include .depend