From d069d19a982d4d2b8b736f1d2eb31f9dda2c6e6c Mon Sep 17 00:00:00 2001 From: Xiangfu Date: Mon, 1 Oct 2012 12:11:09 +0800 Subject: [PATCH] update libs/Makefile for debian packaging --- .gitignore | 3 ++- libs/Makefile | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 7819d83..42bf14f 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,11 @@ # common ignore files # .* +*.d *.o *.o.* *.so -*.d +*.so.* /tags /TAGS diff --git a/libs/Makefile b/libs/Makefile index b0dc933..83ac9cd 100644 --- a/libs/Makefile +++ b/libs/Makefile @@ -6,7 +6,7 @@ # For details see the UNLICENSE file at the root of the source tree. # -LIBS_VERSION = 0.0.0 +LIBS_VERSION = 0 LIBFPGA_BIT_OBJS = bit_frames.o bit_regs.o LIBFPGA_MODEL_OBJS = model_main.o model_tiles.o model_devices.o \ @@ -41,21 +41,22 @@ libfpga-floorplan.so: $(LIBFPGA_FLOORPLAN_OBJS) libfpga-control.so: $(LIBFPGA_CONTROL_OBJS) %.so: - $(CC) -shared -Wl,-soname,$@ -o $@ $^ + $(CC) -shared -Wl,-soname,$@.$(LIBS_VERSION) -o $@.$(LIBS_VERSION) $^ + @rm -f $@ && ln -s $@.$(LIBS_VERSION) $@ %.o: %.c $(CC) $(CFLAGS) -fPIC -o $@ -c $< $(MKDEP) clean: - rm -f *.o *.d *.so + rm -f $(OBJS) $(OBJS:.o=.d) $(DYNAMIC_LIBS) $(DYNAMIC_LIBS:.so=.so.$(LIBS_VERSION)) install: all mkdir -p $(DESTDIR)/$(PREFIX)/lib/ mkdir -p $(DESTDIR)/$(PREFIX)/include/ install -m 644 $(DYNAMIC_HEADS) $(DESTDIR)/$(PREFIX)/include/ for f in $(DYNAMIC_LIBS); do \ - install -m 644 $$f $(DESTDIR)/$(PREFIX)/lib/$$f.$(LIBS_VERSION) && \ + install -m 644 $$f.$(LIBS_VERSION) $(DESTDIR)/$(PREFIX)/lib/$$f.$(LIBS_VERSION) && \ (cd $(DESTDIR)/$(PREFIX)/lib/ && ln -s $$f.$(LIBS_VERSION) $$f) \ || exit 1; done