From 96a39f2f43d07461e73bdb74841b2d9581a189e3 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Sat, 30 May 2009 22:49:06 -0400 Subject: [PATCH] fixed bugs with test system not using the local library --- test/1/Makefile | 26 +++++++++++++++++--------- test/1/libs/libbear.so.0 | 1 + test/README | 11 +++++++++++ 3 files changed, 29 insertions(+), 9 deletions(-) create mode 120000 test/1/libs/libbear.so.0 create mode 100644 test/README 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 -- 2.10.2