1 # Makefile for the UCW JSON library
2 # (c) 2015 Martin Mares <mj@ucw.cz>
5 PROGS+=$(o)/ucw-json/json-test
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)
12 $(o)/ucw-json/libucw-json$(LV).a: $(addsuffix .o,$(LIBJSON_MOD_PATHS))
13 $(o)/ucw-json/libucw-json$(LV).so: $(addsuffix .oo,$(LIBJSON_MOD_PATHS)) $(LIBJSON_DEPS)
14 $(o)/ucw-json/libucw-json$(LV).so: SONAME_SUFFIX=.0
15 $(o)/ucw-json/libucw-json.pc: $(LIBJSON_DEPS)
17 ifdef CONFIG_INSTALL_API
18 $(o)/ucw-json/libucw-json.pc: $(addprefix $(o)/ucw-json/libucw-json$(LV),.a .so)
21 TESTS+=$(o)/ucw-json/json-test.test
22 $(o)/ucw-json/json-test: $(o)/ucw-json/json-test.o $(LIBJSON) $(LIBUCW)
23 $(o)/ucw-json/json-test.test: $(o)/ucw-json/json-test
26 API_INCLUDES+=$(o)/ucw-json/.include-stamp
27 $(o)/ucw-json/.include-stamp: $(addprefix $(s)/ucw-json/,$(LIBJSON_INCLUDES))
28 $(o)/ucw-json/.include-stamp: IDST=ucw-json
29 run/lib/pkgconfig/libucw-json.pc: $(o)/ucw-json/libucw-json.pc
31 INSTALL_TARGETS+=install-libucw-json-lib
32 install-libucw-json-lib:
33 install -d -m 755 $(DESTDIR)$(INSTALL_LIB_DIR)
34 install -m 644 run/lib/libucw-json$(LV).so.0 $(DESTDIR)$(INSTALL_LIB_DIR)/libucw-json$(LV).so.0.0
35 ln -sf libucw-json$(LV).so.0.0 $(DESTDIR)$(INSTALL_LIB_DIR)/libucw-json$(LV).so.0
36 .PHONY: install-libucw-json-lib
38 INSTALL_TARGETS+=install-libucw-json-api
39 install-libucw-json-api:
40 install -d -m 755 $(DESTDIR)$(INSTALL_INCLUDE_DIR)/ucw-json $(DESTDIR)$(INSTALL_LIB_DIR) $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)
41 install -m 644 run/lib/pkgconfig/libucw-json.pc $(DESTDIR)$(INSTALL_PKGCONFIG_DIR)
42 install -m 644 $(addprefix run/include/ucw-json/,$(LIBJSON_INCLUDES)) $(DESTDIR)$(INSTALL_INCLUDE_DIR)/ucw-json
43 ln -sf libucw-json$(LV).so.0.0 $(DESTDIR)$(INSTALL_LIB_DIR)/libucw-json$(LV).so
44 install -m 644 run/lib/libucw-json$(LV).a $(DESTDIR)$(INSTALL_LIB_DIR)
45 .PHONY: install-libucw-json-api
47 include $(s)/ucw-json/doc/Makefile