]> mj.ucw.cz Git - libucw.git/blob - ucw-json/Makefile
Released as v6.5.3
[libucw.git] / ucw-json / Makefile
1 # Makefile for the UCW JSON library
2 # (c) 2015 Martin Mares <mj@ucw.cz>
3
4 DIRS+=ucw-json
5 PROGS+=$(o)/ucw-json/json-test
6
7 LIBJSON_MODS=json parse format
8 LIBJSON_MOD_PATHS=$(addprefix $(o)/ucw-json/,$(LIBJSON_MODS))
9 LIBJSON_INCLUDES=json.h
10 LIBJSON_DEPS=$(LIBUCW)
11 export LIBJSON_LIBS=-lm
12
13 $(o)/ucw-json/libucw-json$(LV).a: $(addsuffix .o,$(LIBJSON_MOD_PATHS))
14 $(o)/ucw-json/libucw-json$(LV).so: $(addsuffix .oo,$(LIBJSON_MOD_PATHS)) $(LIBJSON_DEPS)
15 $(o)/ucw-json/libucw-json$(LV).so: SONAME_SUFFIX=.0
16 $(o)/ucw-json/libucw-json$(LV).so: LIBS+=$(LIBJSON_LIBS)
17 $(o)/ucw-json/libucw-json.pc: $(LIBJSON_DEPS)
18
19 ifdef CONFIG_INSTALL_API
20 $(o)/ucw-json/libucw-json.pc: $(addprefix $(o)/ucw-json/libucw-json$(LV),.a .so)
21 endif
22
23 TESTS+=$(o)/ucw-json/json-test.test
24 $(o)/ucw-json/json-test: $(o)/ucw-json/json-test.o $(LIBJSON) $(LIBUCW)
25 $(o)/ucw-json/json-test.test: $(o)/ucw-json/json-test
26
27 API_LIBS+=libucw-json
28 API_INCLUDES+=$(o)/ucw-json/.include-stamp
29 $(o)/ucw-json/.include-stamp: $(addprefix $(s)/ucw-json/,$(LIBJSON_INCLUDES))
30 $(o)/ucw-json/.include-stamp: IDST=ucw-json
31 run/lib/pkgconfig/libucw-json.pc: $(o)/ucw-json/libucw-json.pc
32
33 INSTALL_TARGETS+=install-libucw-json-lib
34 install-libucw-json-lib:
35         install -d -m 755 $(DESTDIR)$(INSTALL_LIB_DIR)
36         install -m 644 run/lib/libucw-json$(LV).so.0 $(DESTDIR)$(INSTALL_LIB_DIR)/libucw-json$(LV).so.0.0
37         ln -sf libucw-json$(LV).so.0.0 $(DESTDIR)$(INSTALL_LIB_DIR)/libucw-json$(LV).so.0
38 .PHONY: install-libucw-json-lib
39
40 INSTALL_TARGETS+=install-libucw-json-api
41 install-libucw-json-api:
42         install -d -m 755 $(DESTDIR)$(INSTALL_INCLUDE_DIR)/ucw-json $(DESTDIR)$(INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)
43         install -m 644 run/lib/pkgconfig/libucw-json.pc $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)
44         install -m 644 $(addprefix run/include/ucw-json/,$(LIBJSON_INCLUDES)) $(DESTDIR)$(INSTALL_INCLUDE_DIR)/ucw-json
45         ln -sf libucw-json$(LV).so.0.0 $(DESTDIR)$(INSTALL_LIB_DIR)/libucw-json$(LV).so
46         install -m 644 run/lib/libucw-json$(LV).a $(DESTDIR)$(INSTALL_LIB_DIR)
47 .PHONY: install-libucw-json-api
48
49 include $(s)/ucw-json/doc/Makefile