From 4004c8a85356d614eb90b5c5511531ce8bec7e7a Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 9 Aug 2012 17:41:36 -0700 Subject: [PATCH] Build .so and .so.0 versions of libgbe Signed-off-by: Keith Packard --- Makefile | 4 ++-- backend/Makefile.defs | 10 ++++++++-- backend/Makefile.lib | 13 +++++++++++-- 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index abff78f..c994477 100644 --- a/Makefile +++ b/Makefile @@ -2,9 +2,9 @@ TOP=. SUBDIRS=src src/sim src/intel src/x11 all:: - cd backend && make all + +cd backend && make all clean:: - cd backend && make clean + +cd backend && make clean include $(TOP)/Makefile.shared diff --git a/backend/Makefile.defs b/backend/Makefile.defs index 31e30cc..8af8f95 100644 --- a/backend/Makefile.defs +++ b/backend/Makefile.defs @@ -15,5 +15,11 @@ CPP_SRC=$(shell for i in $(SUBDIRS); do ls $$i/*.cpp 2>/dev/null; done) OBJ=$(C_SRC:.c=.o) $(CPP_SRC:.cpp=.o) -VERSION=0.0.1 -LIB=$(TOP)/libgbe.so.$(VERSION) +LIBBASE=libgbe.so +MAJOR=0 +MINOR=0 +REVISION=1 + +VERSION=$(MAJOR).$(MINOR).$(REVISION) +LIBMAJOR=$(LIBBASE).$(MAJOR) +LIB=$(LIBMAJOR).$(MINOR).$(REVISION) diff --git a/backend/Makefile.lib b/backend/Makefile.lib index 661ba49..179afe4 100644 --- a/backend/Makefile.lib +++ b/backend/Makefile.lib @@ -5,10 +5,19 @@ include Makefile.defs LIBS=-Wl,--no-undefined $(shell llvm-config-3.0 --libs) -ldl -lpthread VERSION=0.0.1 -LIB=libgbe.so.$(VERSION) + +all: $(LIB) $(LIBMAJOR) $(LIBBASE) $(LIB): $(OBJ) $(CXX) $(CXXFLAGS) -shared -o $@ $(OBJ) $(LIBS) +$(LIBMAJOR): $(LIB) + rm -f $@ + ln -s $(LIB) $@ + +$(LIBBASE): $(LIBMAJOR) + rm -f $@ + ln -s $(LIBMAJOR) $@ + clean: - rm -f $(LIB) + rm -f $(LIB) $(LIBMAJOR) $(LIBBASE) -- 2.7.4