Mercurial > hg > audiodb
diff libtests/libtest.mk @ 375:336e4b74adc8
libtests are now compatible with the dylib created on mac osx
author | map01bf |
---|---|
date | Fri, 14 Nov 2008 15:50:09 +0000 |
parents | cd63493c32a9 |
children | ac1662433fe6 |
line wrap: on
line diff
--- a/libtests/libtest.mk Fri Nov 14 14:10:49 2008 +0000 +++ b/libtests/libtest.mk Fri Nov 14 15:50:09 2008 +0000 @@ -1,13 +1,34 @@ -all: libaudioDB.so.0 libaudioDB.so test1 +EXECUTABLE=audioDB +SOVERSION=0 +MINORVERSION=0 +LIBRARY_FULL=lib$(EXECUTABLE).so.$(SOVERSION).$(MINORVERSION) +LIBRARY_VERS=lib$(EXECUTABLE).so.$(SOVERSION) +LIBRARY=lib$(EXECUTABLE).so +ARCH_FLAGS= -libaudioDB.so.0: - -ln -s ../../libaudioDB.so.0.0 $@ -libaudioDB.so: libaudioDB.so.0 +ifeq ($(shell uname),Darwin) +override LIBRARY_FULL=lib$(EXECUTABLE).$(SOVERSION).$(MINORVERSION).dylib +override LIBRARY_VERS=lib$(EXECUTABLE).$(SOVERSION).dylib +override LIBRARY=lib$(EXECUTABLE).dylib +ifeq ($(shell sysctl -n hw.optional.x86_64),1) +override ARCH_FLAGS+=-arch x86_64 +endif +endif + +all: $(LIBRARY_FULL) $(LIBRARY_VERS) $(LIBRARY) test1 + +$(LIBRARY_FULL): + -ln -s ../../$(LIBRARY_FULL) $@ + +$(LIBRARY_VERS): + -ln -s ../../$(LIBRARY_FULL) $@ + +$(LIBRARY): $(LIBRARY_VERS) -ln -s $< $@ test1: prog1.c - gcc -Wall -laudioDB -L. -Wl,-rpath,. -o $@ $< + gcc -Wall $(ARCH_FLAGS) -laudioDB -L. -Wl,-rpath,. -o $@ $< clean: - -rm libaudioDB.so.0 libaudioDB.so \ No newline at end of file + -rm $(LIBRARY_FULL) $(LIBRARY_VERS) $(LIBRARY) \ No newline at end of file