X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=Makefile;h=c136915a734565b736d66bacbd41245e3feff79c;hp=645ec65a53a725726bd9b19763d0dfee1d808671;hb=3d22ffb838d306fc87c3701fa79a2d4198a4720d;hpb=25424d34314f5da11305104c78cc82beff801e16 diff --git a/Makefile b/Makefile index 645ec65..c136915 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,25 @@ +COPTS=-O2 +CFLAGS=$(COPTS) -fPIC -Wall -pedantic -std=gnu99 -Wno-unused -Werror +ifneq ($(DEBUG),) + COPTS = -O0 + CFLAGS += -g3 -DDEBUG_ALL +endif + +AR=ar CC=gcc -CFLAGS=-g -O2 -Wall -pedantic -std=gnu99 -Wno-unused -Werror +RANLIB=ranlib + +all: uci -all: parsetest -parsetest: libuci.o test.o +cli.o: cli.c uci.h +uci: cli.o libuci.a $(CC) $(CFLAGS) -o $@ $^ -libuci.o: libuci.c parse.c uci.h list.c err.h -test.o: test.c uci.h +libuci.o: libuci.c file.c uci.h list.c err.h util.c +libuci.a: libuci.o + rm -f $@ + $(AR) rc $@ $^ + $(RANLIB) $@ clean: - rm -f parsetest *.o + rm -f uci *.[oa]