From: Patrik Gornicz Date: Sun, 31 May 2009 02:49:06 +0000 (-0400) Subject: fixed bugs with test system not using the local library X-Git-Tag: libbear-premerge~80 X-Git-Url: http://gitweb.pgornicz.com/?a=commitdiff_plain;h=96a39f2f43d07461e73bdb74841b2d9581a189e3;p=libbear.git fixed bugs with test system not using the local library --- diff --git a/test/1/Makefile b/test/1/Makefile index 1d02c1a..d75efc9 100644 --- a/test/1/Makefile +++ b/test/1/Makefile @@ -11,19 +11,20 @@ WORKINGDIR := bind/ LIBGL := -lGL -lGLU LIBSDL := `sdl-config --libs` -LIBBEAR := -lbear -LIBS := ${LIBSDL} ${LIBGL} ${LIBBEAR} +LIBS := ${LIBSDL} ${LIBGL} +SRCLIBSDIR := libs/ +DSTLIBSDIR := ${WORKINGDIR} -LINKERNAME := libpg.so -SONAME := libpg.so.0 -REALNAME := libpg.so.0.0 +LIBSCPY := # := start +LIBSCPY += libbear.so.0 +LIBSCPY := $(addprefix ${DSTLIBSDIR},${LIBSCPY}) -TARGETNAME := test-1 +TARGETNAME := test TARGETTMP := ${OBJSDIR}${TARGETNAME} TARGET := ${WORKINGDIR}${TARGETNAME} -RPATH := ${LIBDIR}/bind/ +RPATH := ./ OPTFLAGS := -O2 DBGFLAGS := -ggdb @@ -58,7 +59,7 @@ endif # The first and therefor default rule .PHONY: all -all: ${TARGET} +all: ${TARGET} ${LIBSCPY} # lists populated by dir.mk files in subdirectories @@ -79,11 +80,13 @@ OBJSBLDDIRS := ${OBJSDIR} $(addprefix ${OBJSDIR},${DIRS}) BLDDIRS := # := start BLDDIRS += ${OBJSBLDDIRS} BLDDIRS += ${DEPSBLDDIRS} +BLDDIRS += ${DSTLIBSDIR} BLDDIRS += ${WORKINGDIR} +BLDDIRS := $(sort ${BLDDIRS}) # remove possible duplicates # how to link the main target -${TARGETTMP}: ${OBJS} | $${@D} +${TARGETTMP}: ${OBJS} ${LIBSCPY} | $${@D} ${Q1}${PRNTFMT} "${CXX}" "$@" ${Q2}${CXX} ${CXXFLAGS} ${LNKFLAGS} -o $@ $^ ${LIBS} @@ -92,6 +95,11 @@ ${TARGET}: ${TARGETTMP} | $${@D} ${Q1}${PRNTFMT} "cp" "$@" ${Q2}cp $< $@ +# rule to copy the library files into the working directory +${DSTLIBSDIR}%: ${SRCLIBSDIR}% | $$(dir $$@) + ${Q1}${PRNTFMT} "cp" "$@" + ${Q2}cp $< $@ + # how to make a directory ${BLDDIRS}: ${Q1}${PRNTFMT} "mkdir" "$@" diff --git a/test/1/libs/libbear.so.0 b/test/1/libs/libbear.so.0 new file mode 120000 index 0000000..842f36a --- /dev/null +++ b/test/1/libs/libbear.so.0 @@ -0,0 +1 @@ +../../../bind/libbear.so.0.0 \ No newline at end of file diff --git a/test/README b/test/README new file mode 100644 index 0000000..a90756d --- /dev/null +++ b/test/README @@ -0,0 +1,11 @@ +I've setup a very simple test system. + +The Makefile you see in this directory is shared by all the tests using +symbolic links. + +Run make or make run in one of the test directories to build or build+run the +test. + +Enjoy! + +Patrik