From 4206849da9976482c2420afaaea936acc44b825e Mon Sep 17 00:00:00 2001 From: "Dmitrij D. Czarkoff" Date: Thu, 11 Aug 2016 00:32:09 +0200 Subject: [PATCH] Fix shared library instructions --- Makefile | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index d2241b5..9e1d9b1 100644 --- a/Makefile +++ b/Makefile @@ -19,7 +19,6 @@ SDL_CFLAGS != pkg-config --cflags sdl SDL_LIBS != pkg-config --libs sdl LIB_VERSION = 1.0 -LIB_SONAME = libquirc.so.1 QUIRC_CFLAGS = -O3 -Wall -Ilib $(CFLAGS) $(SDL_CFLAGS) LIB_OBJ = \ @@ -53,27 +52,26 @@ libquirc.a: $(LIB_OBJ) ar cru $@ $^ ranlib $@ -libquirc.so: $(LIB_OBJ) - $(CC) -shared -Wl,-soname=$(LIB_SONAME) -o $@ $^ -lm +.PHONY: libquirc.so +libquirc.so: libquirc.so.$(LIB_VERSION) + +libquirc.so.$(LIB_VERSION): $(LIB_OBJ) + $(CC) -shared -o $@ $^ -lm %.o: %.c $(CC) -fPIC $(QUIRC_CFLAGS) -o $*.o -c $*.c -install: libquirc.a libquirc.so quirc-demo quirc-scanner +install: libquirc.a libquirc.so.$(LIB_VERSION) quirc-demo quirc-scanner install -o root -g root -m 0644 lib/quirc.h $(DESTDIR)$(PREFIX)/include install -o root -g root -m 0644 libquirc.a $(DESTDIR)$(PREFIX)/lib - install -o root -g root -m 0755 libquirc.so \ - $(DESTDIR)$(PREFIX)/lib/libquirc.so.$(LIB_VERSION) - ln -sf libquirc.so.$(LIB_VERSION) $(DESTDIR)$(PREFIX)/lib/$(LIB_SONAME) - ln -sf libquirc.so.$(LIB_VERSION) $(DESTDIR)$(PREFIX)/lib/libquirc.so + install -o root -g root -m 0755 libquirc.so.$(LIB_VERSION) \ + $(DESTDIR)$(PREFIX)/lib install -o root -g root -m 0755 quirc-demo $(DESTDIR)$(PREFIX)/bin install -o root -g root -m 0755 quirc-scanner $(DESTDIR)$(PREFIX)/bin uninstall: rm -f $(DESTDIR)$(PREFIX)/include/quirc.h rm -f $(DESTDIR)$(PREFIX)/lib/libquirc.so.$(LIB_VERSION) - rm -f $(DESTDIR)$(PREFIX)/lib/$(LIB_SONAME) - rm -f $(DESTDIR)$(PREFIX)/lib/libquirc.so rm -f $(DESTDIR)$(PREFIX)/lib/libquirc.a rm -f $(DESTDIR)$(PREFIX)/bin/quirc-demo rm -f $(DESTDIR)$(PREFIX)/bin/quirc-scanner @@ -82,7 +80,7 @@ clean: rm -f */*.o rm -f */*.lo rm -f libquirc.a - rm -f libquirc.so + rm -f libquirc.so.$(LIB_VERSION) rm -f qrtest rm -f inspect rm -f quirc-demo