2 # Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
4 # @APPLE_LICENSE_HEADER_START@
6 # This file contains Original Code and/or Modifications of Original Code
7 # as defined in and that are subject to the Apple Public Source License
8 # Version 2.0 (the 'License'). You may not use this file except in
9 # compliance with the License. Please obtain a copy of the License at
10 # http://www.opensource.apple.com/apsl/ and read it before using this
13 # The Original Code and all software distributed under the License are
14 # distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 # EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 # INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 # FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 # Please see the License for the specific language governing rights and
19 # limitations under the License.
21 # @APPLE_LICENSE_HEADER_END@
24 include ${TESTROOT}/include/common.makefile
26 run : check1 check2 check3 check4 check5 check6 check7 check8
28 all : main1 main2 main3 main4 main5 main6 main7 main8
30 main : main.c libfoo.dylib
31 ${CC} -I${TESTROOT}/include main.c -o main libfoo.dylib
34 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o $$PWD/libfoo.dylib
36 libfoo_debug.dylib : foo.c
37 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -DDEBUG -o $$PWD/libfoo_debug.dylib -install_name $$PWD/libfoo.dylib
39 hide/libfoo.dylib : foo.c
41 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o $$PWD/hide/libfoo.dylib -install_name $$PWD/libfoo.dylib
43 hide/libfoo_debug.dylib : foo.c
45 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o $$PWD/hide/libfoo_debug.dylib -install_name $$PWD/libfoo.dylib
47 # bar_debug has bar_debug as install name
49 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o $$PWD/libbar.dylib
51 libbar_debug.dylib : foo.c
52 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -DDEBUG -o $$PWD/libbar_debug.dylib
54 hide/libbar.dylib : foo.c
56 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o $$PWD/hide/libbar.dylib -install_name $$PWD/libbar.dylib
58 hide/libbar_debug.dylib : foo.c
60 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o $$PWD/hide/libbar_debug.dylib -install_name $$PWD/libbar_debug.dylib
63 rm -rf libfoo.dylib libfoo_debug.dylib hide libbar.dylib libbar_debug.dylib main1 main2 main3 main4 main5 main6 main7 main8
67 # check1: main links with libfoo.dylib sets DYLD_IMAGE_SUFFIX=_debug and dynamically loads libfoo.dylib
70 main1 : main.c libfoo.dylib
71 ${CC} -I${TESTROOT}/include main.c -o main1 libfoo.dylib
74 DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main1 libfoo.dylib
75 DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main1 $$PWD/libfoo.dylib
79 # check2: main links with libfoo_debug.dylib and dynamically loads libfoo.dylib
81 main2 : main.c libfoo_debug.dylib
82 ${CC} -I${TESTROOT}/include main.c -o main2 libfoo_debug.dylib
85 echo "pwd-1 is ${PWD}"
88 ./main2 $$PWD/libfoo.dylib
92 # check3: main links with libfoo.dylib sets DYLD_LIBRARY_PATH=hide and dynamically loads libfoo.dylib
94 main3 : main.c libfoo.dylib
95 ${CC} -I${TESTROOT}/include main.c -o main3 libfoo.dylib
98 DYLD_LIBRARY_PATH=$$PWD/hide && export DYLD_LIBRARY_PATH && ./main3 $$PWD/libfoo.dylib
102 # check4: main links with libfoo.dylib sets DYLD_LIBRARY_PATH=hide, DYLD_IMAGE_SUFFIX=_debug and dynamically loads libfoo.dylib
105 main4 : main.c libfoo.dylib
106 ${CC} -I${TESTROOT}/include main.c -o main4 libfoo.dylib
109 DYLD_LIBRARY_PATH=$$PWD/hide && export DYLD_LIBRARY_PATH && DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main4 $$PWD/libfoo.dylib
113 # check5: main links with libbar.dylib sets DYLD_IMAGE_SUFFIX=_debug and dynamically loads libbar.dylib
116 main5 : main.c libbar.dylib libbar_debug.dylib
117 ${CC} -I${TESTROOT}/include main.c -o main5 libbar.dylib
120 DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main5 $$PWD/libbar.dylib
124 # check6: main links with libbar_debug.dylib and dynamically loads libbar.dylib
127 main6 : main.c libbar_debug.dylib
128 ${CC} -I${TESTROOT}/include main.c -o main6 libbar_debug.dylib
131 DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main6 $$PWD/libbar.dylib
135 # check7: main links with libbar.dylib sets DYLD_LIBRARY_PATH=hide and dynamically loads libbar.dylib
137 main7 : main.c libbar.dylib
138 ${CC} -I${TESTROOT}/include main.c -o main7 libbar.dylib
141 DYLD_LIBRARY_PATH=$$PWD/hide && export DYLD_LIBRARY_PATH && ./main7 $$PWD/libbar.dylib
145 # check8: main links with libbar.dylib sets DYLD_LIBRARY_PATH=hide, DYLD_IMAGE_SUFFIX=_debug and dynamically loads libbar.dylib
148 main8 : main.c libbar.dylib
149 ${CC} -I${TESTROOT}/include main.c -o main8 libbar.dylib
152 DYLD_LIBRARY_PATH=$$PWD/hide && export DYLD_LIBRARY_PATH && DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main8 $$PWD/libbar.dylib