11 SHLIB_FILE=libuci.$(SHLIB_EXT).$(VERSION)
14 @echo "$(if $(findstring 1,$($(1))),#define UCI_$(1) 1,#undef UCI_$(1))" >> $@.tmp
17 LIBUCI_DEPS=file.c history.c list.c util.c uci.h uci_config.h uci_internal.h
19 all: uci-static uci libuci.$(SHLIB_EXT)
21 cli.o: cli.c uci.h uci_config.h
25 $(call add_feature,PLUGIN_SUPPORT)
26 $(call add_feature,DEBUG)
27 $(call add_feature,DEBUG_TYPECAST)
28 @if [ \! -f "$@" ] || ! cmp "$@.tmp" "$@" >/dev/null; then \
34 uci: cli.o libuci.$(SHLIB_EXT)
35 $(CC) -o $@ $< -L. -luci
37 uci-static: cli.o libuci.a
38 $(CC) $(CFLAGS) -o $@ $^
40 libuci-static.o: libuci.c $(LIBUCI_DEPS)
41 $(CC) $(CFLAGS) -c -o $@ $<
43 libuci-shared.o: libuci.c $(LIBUCI_DEPS)
44 $(CC) $(CFLAGS) $(FPIC) -c -o $@ $<
46 libuci.a: libuci-static.o
51 libuci.$(SHLIB_EXT): libuci-shared.o
52 $(LINK) $(SHLIB_FLAGS) -o $(SHLIB_FILE) $^ $(LIBS)
53 ln -sf $(SHLIB_FILE) $@
56 rm -f uci uci-static *.[oa] *.so* *.dylib* uci_config.h
59 $(MKDIR) -p $(DESTDIR)$(prefix)/lib
60 $(INSTALL) -m0644 libuci.a $(DESTDIR)$(prefix)/lib/
61 $(INSTALL) -m0755 $(SHLIB_FILE) $(DESTDIR)$(prefix)/lib/
62 ln -sf $(SHLIB_FILE) $(DESTDIR)$(prefix)/lib/libuci.$(SHLIB_EXT)
63 $(MKDIR) -p $(DESTDIR)$(prefix)/bin
64 $(INSTALL) -m0755 uci $(DESTDIR)$(prefix)/bin/