]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/objson/Makefile
added some debugging, safety measures
[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 OBJS                    = object.o json_parser.o utils.o
19 UTIL_DIR                = ../utils
20 DEST_INCLUDE = objson
21
22 all:    test
23
24 test: lib 
25         $(CC) $(CC_OPTS) $(LD_OPTS) -lobjson objson_test.c -o $@
26
27 install:
28         mkdir -p $(INCLUDEDIR)/$(DEST_INCLUDE)
29         cp $(TMPDIR)/$(DEST_INCLUDE)/*.h $(INCLUDEDIR)/objson/
30         cp $(TMPDIR)/libobjson.so $(LIBDIR)/libobjson.so
31
32 lib:    $(OBJS)
33         $(CC) -shared -W1 $(OBJS) -o $(TMPDIR)/libobjson.so
34         $(CC) -shared -W1 $(OBJS) -o libobjson.so
35         mkdir -p $(TMPDIR)/$(DEST_INCLUDE)/
36         cp *.h $(TMPDIR)/$(DEST_INCLUDE)/
37
38 object.o:       object.h object.c
39         $(CC) -c $(CC_OPTS) object.c -o $@
40
41 json_parser.o:  json_parser.h json_parser.c
42         $(CC) -c $(CC_OPTS) json_parser.c -o $@
43
44 utils.o:        $(UTIL_DIR)/utils.h $(UTIL_DIR)/utils.c
45         $(CC) -c $(CC_OPTS) $(UTIL_DIR)/utils.c -o $@
46
47 clean:
48         /bin/rm -f *.o *.so test