File: Makefile

package info (click to toggle)
ocamlnet 4.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 51,764 kB
  • ctags: 16,446
  • sloc: ml: 148,419; ansic: 10,989; sh: 1,885; makefile: 1,355
file content (79 lines) | stat: -rw-r--r-- 2,487 bytes parent folder | download | duplicates (3)
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
TOP_DIR=../..

include $(TOP_DIR)/Makefile.conf

PKGNAME = netcgi2-apache
# Keep the name in sync with the one on handler.c :
BUILD_EXTRA = mod_netcgi_apache.so

INCLUDES += $(INC_NETSTRING) $(INC_NETSYS) $(INC_NETCGI2)
REQUIRES += findlib

OBJECTS = netcgi_apache.cmo netcgi_modtpl.cmo
DOBJECTS = netcgi_apache.mli netcgi_modtpl.mli

ALL_EXTRA = mod_netcgi_apache.so
INSTALL_EXTRA = mod_netcgi_apache.so

OCAMLC_OPTIONS += $(STRING_OPTS)
OCAMLOPT_OPTIONS += $(STRING_OPTS)

PP_OPTIONS = -pp "$(CPPO) $(PP_BYTES) $(PP_DEPRECATED)"

DOC_IGNORABLE = true

include $(TOP_DIR)/Makefile.rules

ifeq ($(APACHE_MAJOR),2)
APACHE_LDFLAGS_SHLIB += -lapr-1 -laprutil-1
endif

# mod_netcgi_apache.so: apache.lo handler.lo wrappers.lo netcgi_apache_mod.cmo
# 	$(OCAMLC) -verbose -custom -linkall -o $@ \
# 	  -cc "$(APXS) -c $(filter %.lo,$^)" \
# 	  dynlink.cma unix.cma $(filter-out %.lo,$^) \
# 	  -cclib '$(APACHE_CFLAGS) $(APACHE_LDFLAGS_SHLIB) $(APACHE_OCAMLLIBS)'
# $(patsubst %.o,.libs/%.o,$^) \

# %.o: %.c
# 	$(APACHE_CC) $(APACHE_CFLAGS) -I $(APACHE_OCAMLLIBDIR) -c $<

# -Wl,-bI:$(APACHE_LIBDIR)/httpd.exp
# mod_netcgi_apache.so: netcgi_apache_mod.cmo apache.o handler.o wrappers.o
# 	$(OCAMLC) -o $@ -verbose -linkall -custom \
# 	  -ccopt -Wl,--warn-unresolved-symbols \
# 	  dynlink.cma unix.cma $(patsubst %.o, ./.libs/%.o, $^) \
# 	  -cclib "$(APACHE_CFLAGS) $(APACHE_LDFLAGS_SHLIB) $(APACHE_OCAMLLIBS)"

MOD_OBJECTS := wrappers.o handler.o apache.o netcgi_apache_mod.o

# must be after the `include' for APACHE_MAJOR to be defined
ifeq ($(APACHE_MAJOR),2)
MOD_OBJECTS := $(patsubst %.o,%.lo,$(MOD_OBJECTS))
else
MOD_OBJECTS := $(MOD_OBJECTS)
endif

### Embed Caml code into the C code.
### Requires `caml_startup' instead of `caml_main' in handler.c
### Only works with OCaml >= 3.11 on plafforms where PIC differs from non-PIC
### See http://caml.inria.fr/mantis/view.php?id=3866
mod_netcgi_apache.so: $(MOD_OBJECTS)
	$(APXS) -c -o $@ $^ -L$(APACHE_OCAMLLIBDIR) -Wl,-R,$(APACHE_OCAMLLIBDIR) $(APACHE_OCAMLLIBS)
	test -f .libs/$@ && cp .libs/$@ .

netcgi_apache_mod.lo: netcgi_apache_mod.o
	echo "$@ generated by the rule for $^"
netcgi_apache_mod.o: netcgi_apache_mod.c
	$(APXS) -c -o $@ $^
netcgi_apache_mod.c: netcgi_apache_mod.ml
	$(OCAMLC) -verbose -output-obj -linkall -o $@ \
	  -cc "./drive-apxs $(APXS)" \
	  -package "dynlink bytes unix findlib" -linkpkg $^

%.o: %.c
	$(APXS) -I$(APACHE_OCAMLLIBDIR) -c $<
%.lo: %.c
	$(APXS) -I$(APACHE_OCAMLLIBDIR) -c $<

include depend