359eb279bf722e872a1dee2089c8d1e53beb9316
[Evergreen.git] / Open-ILS / src / apachemods / Makefile
1
2 LDLIBS  += -lxml2 -lopensrf -lxslt
3
4 all:    mod_xmlbuilder.so mod_ils_rest_gateway.so
5
6 install:        mod_xmlbuilder-install mod_ils_rest_gateway-install libfieldmapper-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 # ------------------------------------------------------
22
23 mod_xmlbuilder.so: mod_xmlbuilder.o apachetools.o 
24 #mod_xmlbuilder.so: mod_xmlbuilder.o 
25         @echo $@
26         $(CC) $(LDFLAGS) $(LDLIBS) -shared -W1 apachetools.o mod_xmlbuilder.o -o $@
27
28 libfieldmapper.so:      fieldmapper_lookup.o
29         @echo $@
30         mkdir -p $(TMPDIR)/openils/
31         cp fieldmapper_lookup.h $(TMPDIR)/openils/
32         $(CC) $(LDFLAGS) $(LDLIBS) -shared -W1 fieldmapper_lookup.o -o $@
33         cp libfieldmapper.so $(TMPDIR)/libfieldmapper.so
34
35 mod_ils_rest_gateway.so:        libfieldmapper.so ils_rest_gateway.o json_xml.o
36         @echo $@
37         $(CC) $(LDFLAGS) $(LDLIBS) -shared -W1 json_xml.o ils_rest_gateway.o -lfieldmapper -o $@
38
39 # ------------------------------------------------------
40
41
42 libfieldmapper-install: libfieldmapper.so
43         echo installing libfieldmapper.so
44         mkdir -p $(INCDIR)/
45         @echo "Copying fieldmapper_lookup.h to $(INCDIR)"
46         cp fieldmapper_lookup.h $(INCDIR)/
47         cp libfieldmapper.so $(LIBDIR)/libfieldmapper.so
48
49
50 mod_ils_rest_gateway-install:
51         $(APXS2) -i -a -n ils_rest_gateway mod_ils_rest_gateway.so
52         echo "-----------------------------------------------";
53         echo -e "* Important * : Change httpd.conf from this: \n \
54                 LoadModule mod_ils_rest_gateway_module modules/mod_ils_rest_gateway.so \n \
55                 to this: \n \
56                 LoadModule mod_ils_rest_gateway    modules/mod_ils_rest_gateway.so"
57         echo -e "Supported configuration options:\
58                         \nILSRestGatewayConfig <config-file>"
59         echo "-----------------------------------------------";
60         echo ""
61
62 mod_xmlbuilder-install:
63         $(APXS2) -i -a -n xmlbuilder mod_xmlbuilder.so
64
65
66 clean:
67         echo $@
68         /bin/rm -f *.o *.so 
69         /bin/rm -f fieldmapper_lookup.c
70