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
31 check: check1 check2 check3 check4 check5 check6 check7 check8
33 all: main1 main2 main3 main4 main5 main6 main7 main8
35 main : main.c libfoo.dylib
36 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main libfoo.dylib
39 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o $(PWD)/libfoo.dylib
41 libfoo_debug.dylib : foo.c
42 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -DDEBUG -o libfoo_debug.dylib -install_name $(PWD)/libfoo.dylib
44 hide/libfoo.dylib : foo.c
46 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o hide/libfoo.dylib -install_name $(PWD)/libfoo.dylib
48 hide/libfoo_debug.dylib : foo.c
50 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o hide/libfoo_debug.dylib -install_name $(PWD)/libfoo.dylib
52 # bar_debug has bar_debug as install name
54 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o libbar.dylib
56 libbar_debug.dylib : foo.c
57 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -DDEBUG -o libbar_debug.dylib
59 hide/libbar.dylib : foo.c
61 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o hide/libbar.dylib -install_name $(PWD)/libbar.dylib
63 hide/libbar_debug.dylib : foo.c
65 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o hide/libbar_debug.dylib -install_name $(PWD)/libbar_debug.dylib
68 rm -rf libfoo.dylib libfoo_debug.dylib hide libbar.dylib libbar_debug.dylib main1 main2 main3 main4 main5 main6 main7 main8
72 # check1: main links with libfoo.dylib sets DYLD_IMAGE_SUFFIX=_debug and dynamically loads libfoo.dylib
75 main1 : main.c libfoo.dylib
76 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main1 libfoo.dylib
79 DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main1 libfoo.dylib
80 DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main1 $(PWD)/libfoo.dylib
84 # check2: main links with libfoo_debug.dylib and dynamically loads libfoo.dylib
86 main2 : main.c libfoo_debug.dylib
87 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main2 libfoo_debug.dylib
90 echo "pwd-1 is ${PWD}"
91 echo "pwd-2 is $(PWD)"
93 ./main2 $(PWD)/libfoo.dylib
97 # check3: main links with libfoo.dylib sets DYLD_LIBRARY_PATH=hide and dynamically loads libfoo.dylib
99 main3 : main.c libfoo.dylib
100 ${CC} -Wno-deprecated-declarations -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main3 libfoo.dylib
103 DYLD_LIBRARY_PATH=$(PWD)/hide && export DYLD_LIBRARY_PATH && ./main3 $(PWD)/libfoo.dylib
107 # check4: main links with libfoo.dylib sets DYLD_LIBRARY_PATH=hide, DYLD_IMAGE_SUFFIX=_debug and dynamically loads libfoo.dylib
110 main4 : main.c libfoo.dylib
111 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main4 libfoo.dylib
114 DYLD_LIBRARY_PATH=$(PWD)/hide && export DYLD_LIBRARY_PATH && DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main4 $(PWD)/libfoo.dylib
118 # check5: main links with libbar.dylib sets DYLD_IMAGE_SUFFIX=_debug and dynamically loads libbar.dylib
121 main5 : main.c libbar.dylib libbar_debug.dylib
122 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main5 libbar.dylib
125 DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main5 $(PWD)/libbar.dylib
129 # check6: main links with libbar_debug.dylib and dynamically loads libbar.dylib
132 main6 : main.c libbar_debug.dylib
133 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main6 libbar_debug.dylib
136 DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main6 $(PWD)/libbar.dylib
140 # check7: main links with libbar.dylib sets DYLD_LIBRARY_PATH=hide and dynamically loads libbar.dylib
142 main7 : main.c libbar.dylib
143 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main7 libbar.dylib
146 DYLD_LIBRARY_PATH=$(PWD)/hide && export DYLD_LIBRARY_PATH && ./main7 $(PWD)/libbar.dylib
150 # check8: main links with libbar.dylib sets DYLD_LIBRARY_PATH=hide, DYLD_IMAGE_SUFFIX=_debug and dynamically loads libbar.dylib
153 main8 : main.c libbar.dylib
154 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main8 libbar.dylib
157 DYLD_LIBRARY_PATH=$(PWD)/hide && export DYLD_LIBRARY_PATH && DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main8 $(PWD)/libbar.dylib