added mod_xmlent to the build process
[Evergreen.git] / Open-ILS / src / apachemods / Makefile
1
2 LDLIBS  += -lxml2 -lopensrf -lxslt
3
4 all:    mod_xmlbuilder.so mod_ils_rest_gateway.so mod_xmlent.so
5
6 install:        mod_xmlbuilder-install mod_ils_rest_gateway-install libfieldmapper-install mod_xmlent-install
7
8
9 mod_xmlbuilder.o: mod_xmlbuilder.h mod_xmlbuilder.c
10 apachetools.o: 
11         cp ../../../OpenSRF/src/gateway/apachetools.o .
12 json_xml.o:     json_xml.c json_xml.h
13 fieldmapper_lookup.o:   fieldmapper_lookup.c fieldmapper_lookup.h
14 ils_rest_gateway.o:     mod_rest_gateway.c mod_rest_gateway.h
15         $(CC) -c $(CFLAGS) mod_rest_gateway.c -o $@
16
17 fieldmapper_lookup.c:   
18         ./fieldmapper_lookup-gen.pl fieldmapper_lookup.c
19
20
21 mod_xmlent.o:   mod_xmlent.c
22 mod_xmlent.so: mod_xmlent.o
23         @echo $@
24         $(CC) $(LDFLAGS) $(LDLIBS) -shared -W1 mod_xmlent.o -lexpat -o $@
25
26
27 # ------------------------------------------------------
28
29 mod_xmlbuilder.so: mod_xmlbuilder.o apachetools.o 
30 #mod_xmlbuilder.so: mod_xmlbuilder.o 
31         @echo $@
32         $(CC) $(LDFLAGS) $(LDLIBS) -shared -W1 apachetools.o mod_xmlbuilder.o -o $@
33
34 libfieldmapper.so:      fieldmapper_lookup.o
35         @echo $@
36         mkdir -p $(TMPDIR)/openils/
37         cp fieldmapper_lookup.h $(TMPDIR)/openils/
38         $(CC) $(LDFLAGS) $(LDLIBS) -shared -W1 fieldmapper_lookup.o -o $@
39         cp libfieldmapper.so $(TMPDIR)/libfieldmapper.so
40
41 mod_ils_rest_gateway.so:        libfieldmapper.so ils_rest_gateway.o json_xml.o
42         @echo $@
43         $(CC) $(LDFLAGS) $(LDLIBS) -shared -W1 json_xml.o ils_rest_gateway.o -lfieldmapper -o $@
44
45 # ------------------------------------------------------
46
47
48 libfieldmapper-install: libfieldmapper.so
49         echo installing libfieldmapper.so
50         mkdir -p $(INCDIR)/
51         @echo "Copying fieldmapper_lookup.h to $(INCDIR)"
52         cp fieldmapper_lookup.h $(INCDIR)/
53         cp libfieldmapper.so $(LIBDIR)/libfieldmapper.so
54
55
56 mod_ils_rest_gateway-install:
57         $(APXS2) -i -a -n ils_rest_gateway mod_ils_rest_gateway.so
58         echo "-----------------------------------------------";
59         echo -e "* Important * : Change httpd.conf from this: \n \
60                 LoadModule mod_ils_rest_gateway_module modules/mod_ils_rest_gateway.so \n \
61                 to this: \n \
62                 LoadModule mod_ils_rest_gateway    modules/mod_ils_rest_gateway.so"
63         echo -e "Supported configuration options:\
64                         \nILSRestGatewayConfig <config-file>"
65         echo "-----------------------------------------------";
66         echo ""
67
68 mod_xmlbuilder-install:
69         $(APXS2) -i -a -n xmlbuilder mod_xmlbuilder.so
70
71 mod_xmlent-install:
72         $(APXS2) -i -a -n xmlent mod_xmlent.so
73
74
75 clean:
76         echo $@
77         /bin/rm -f *.o *.so 
78         /bin/rm -f fieldmapper_lookup.c
79