Don't compile objects twice

PIC objects can be used for static library as well, so there is no reason to
build two sets of objects.
This commit is contained in:
Dmitrij D. Czarkoff 2016-08-11 00:18:58 +02:00
parent b19987eb6a
commit 22cd4d061c

View file

@ -27,7 +27,6 @@ LIB_OBJ = \
lib/identify.o \
lib/quirc.o \
lib/version_db.o
LIB_SOBJ = $(subst .o,.lo,$(LIB_OBJ))
DEMO_OBJ = \
demo/camera.o \
demo/mjpeg.o \
@ -54,14 +53,11 @@ libquirc.a: $(LIB_OBJ)
ar cru $@ $^
ranlib $@
libquirc.so: $(LIB_SOBJ)
libquirc.so: $(LIB_OBJ)
$(CC) -shared -Wl,-soname=$(LIB_SONAME) -o $@ $^ -lm
%.o: %.c
$(CC) $(QUIRC_CFLAGS) -o $*.o -c $*.c
%.lo: %.c
$(CC) -fPIC $(QUIRC_CFLAGS) -o $*.lo -c $*.c
$(CC) -fPIC $(QUIRC_CFLAGS) -o $*.o -c $*.c
install: libquirc.a libquirc.so quirc-demo quirc-scanner
install -o root -g root -m 0644 lib/quirc.h $(DESTDIR)$(PREFIX)/include