4 WOPTS=-pedantic -Wno-unused -Werror
6 CFLAGS=$(COPTS) $(WOPTS) -Wall -std=gnu99
16 CFLAGS += -g3 -DDEBUG_ALL
26 SHLIB_FLAGS=-shared -Wl,-soname,$(SHLIB_FILE)
28 SHLIB_FILE=libuci.$(SHLIB_EXT).$(VERSION)
30 LIBUCI_DEPS=file.c history.c list.c util.c err.h uci.h
32 all: uci-static uci libuci.$(SHLIB_EXT)
36 uci: cli.o libuci.$(SHLIB_EXT)
37 $(CC) -o $@ $< -L. -luci
39 uci-static: cli.o libuci.a
40 $(CC) $(CFLAGS) -o $@ $^
42 libuci-static.o: libuci.c $(LIBUCI_DEPS)
43 $(CC) $(CFLAGS) -c -o $@ $<
45 libuci-shared.o: libuci.c $(LIBUCI_DEPS)
46 $(CC) $(CFLAGS) $(FPIC) -c -o $@ $<
48 libuci.a: libuci-static.o
53 libuci.$(SHLIB_EXT): libuci-shared.o
54 $(LINK) $(SHLIB_FLAGS) -o $(SHLIB_FILE) $^ $(LIBS)
55 ln -sf $(SHLIB_FILE) $@
58 rm -f uci uci-static *.[oa] *.so* *.dylib*