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:
parent
b19987eb6a
commit
22cd4d061c
1 changed files with 2 additions and 6 deletions
8
Makefile
8
Makefile
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue