Build .so and .so.0 versions of libgbe
authorKeith Packard <keithp@keithp.com>
Fri, 10 Aug 2012 00:41:36 +0000 (17:41 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 10 Aug 2012 23:19:06 +0000 (16:19 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
Makefile
backend/Makefile.defs
backend/Makefile.lib

index abff78f..c994477 100644 (file)
--- 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
index 31e30cc..8af8f95 100644 (file)
@@ -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)
index 661ba49..179afe4 100644 (file)
@@ -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)