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