]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/objson/Makefile
new json api changes
[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                    = object.o json_parser.o utils.o
30 UTIL_DIR                = ../utils
31 DEST_INCLUDE = objson
32 CC_OPTS         += -DSTRICT_JSON_WRITE #-DSTRICT_JSON_READ
33
34 # -------------
35 #CC_OPTS                += -I ../utils/
36 #LD_OPTS += -L .
37 #TMPDIR = .
38 # -------------
39
40 all:    msg test
41
42 msg: 
43         echo "-> $$(pwd)"       
44
45 test: libobjson.so
46         echo $@
47         $(CC) $(CC_OPTS) $(LD_OPTS) -lobjson objson_test.c -o $@
48
49 install:
50         echo installing libobjson.so
51         mkdir -p $(INCLUDEDIR)/$(DEST_INCLUDE)
52         cp $(TMPDIR)/$(DEST_INCLUDE)/*.h $(INCLUDEDIR)/objson/
53         cp $(TMPDIR)/libobjson.so $(LIBDIR)/libobjson.so
54
55 libobjson.so:   $(OBJS)
56         echo $@
57         $(CC) -shared -W1 $(OBJS) -o $(TMPDIR)/libobjson.so
58         $(CC) -shared -W1 $(OBJS) -o libobjson.so
59         mkdir -p $(TMPDIR)/$(DEST_INCLUDE)/
60         cp *.h $(TMPDIR)/$(DEST_INCLUDE)/
61
62 object.o:       object.h object.c
63         echo $@
64         $(CC) -c $(CC_OPTS) object.c -o $@
65
66 json_parser.o:  json_parser.h json_parser.c
67         echo $@
68         $(CC) -c $(CC_OPTS) json_parser.c -o $@
69
70 utils.o:        $(UTIL_DIR)/utils.h $(UTIL_DIR)/utils.c
71         echo $@
72         $(CC) -c $(CC_OPTS) $(UTIL_DIR)/utils.c -o $@
73
74 clean:
75         /bin/rm -f *.o *.so test libobjson.so