]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/objson/Makefile
Added a new XML-2-JSON utility for converting XMLized OpenSRF objects to their intern...
[OpenSRF.git] / src / objson / Makefile
1 # --------------------------------------------------------------------
2 # Copyright (C) 2005  Georgia Public Library Service 
3 # Bill Erickson <highfalutin@gmail.com>
4 # Mike Rylander <mrylander@gmail.com>
5
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 # --------------------------------------------------------------------
16
17
18 # --------------------------------------------------------------------
19 #
20 # -DSTRICT_JSON_WRITE if not defined, 'null' objects will be written
21 #       as empty strings. e.g. [null, null] => [,,]
22 #
23 # -DSTRICT_JSON_READ if not defiend, empty array and object values
24 #       (not keys) will be considered null.
25 #       e.g. [,,{"key":}] will be parsed as [null, null, {"key":null}]
26 #
27 # --------------------------------------------------------------------
28
29 OBJS                            = md5.o utils.o json2xml.o object.o json_parser.o xml2json.o
30 UTIL_DIR                        = ../utils
31 DEST_INCLUDE    = objson
32 CFLAGS                  += -DSTRICT_JSON_WRITE #-DSTRICT_JSON_READ
33
34 JSON_HEADERS = object.h json_parser.h json2xml.h xml2json.h
35
36 all:    test
37
38 test: libobjson.so objson_test.o
39
40 objson_test.o: objson_test.c 
41 object.o:       object.h object.c
42 json_parser.o:  json_parser.h json_parser.c
43 json2xml.o:     json2xml.h json2xml.c
44 xml2json.o:     xml2json.h xml2json.c
45
46
47 install:
48         mkdir -p $(INCLUDEDIR)/$(DEST_INCLUDE)
49         cp $(TMPDIR)/$(DEST_INCLUDE)/*.h $(INCLUDEDIR)/objson/
50         cp $(TMPDIR)/libobjson.so $(LIBDIR)/libobjson.so
51
52 libobjson.so:   $(OBJS)
53         $(CC) -shared -W1 $(OBJS) -o $(TMPDIR)/libobjson.so
54         $(CC) -shared -W1 $(OBJS) -o libobjson.so
55         mkdir -p $(TMPDIR)/$(DEST_INCLUDE)/
56         cp $(JSON_HEADERS) $(TMPDIR)/$(DEST_INCLUDE)/
57
58 utils.o:        $(UTIL_DIR)/utils.h $(UTIL_DIR)/utils.c
59         cp $(UTIL_DIR)/utils.h .
60         cp $(UTIL_DIR)/utils.c .
61         $(CC) -c $(CFLAGS) utils.c -o $@
62
63 md5.o:  $(UTIL_DIR)/md5.h $(UTIL_DIR)/md5.c
64         cp $(UTIL_DIR)/md5.h .
65         cp $(UTIL_DIR)/md5.c .
66         $(CC) -c $(CFLAGS) md5.c -o $@
67
68 clean:
69         /bin/rm -f *.o *.so utils.c utils.h libobjson.so
70