]> git.saurik.com Git - apple/dyld.git/blame - unit-tests/test-cases/image-suffix/Makefile
dyld-353.2.1.tar.gz
[apple/dyld.git] / unit-tests / test-cases / image-suffix / Makefile
CommitLineData
0959b6d4
A
1##
2# Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3#
4# @APPLE_LICENSE_HEADER_START@
5#
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
11# file.
12#
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.
20#
21# @APPLE_LICENSE_HEADER_END@
22##
23TESTROOT = ../..
24include ${TESTROOT}/include/common.makefile
25
39a8cd10 26PWD = $(shell pwd)
0959b6d4 27
39a8cd10
A
28
29all-check: all check
30
31check: check1 check2 check3 check4 check5 check6 check7 check8
32
33all: main1 main2 main3 main4 main5 main6 main7 main8
0959b6d4
A
34
35main : main.c libfoo.dylib
bac542e6 36 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main libfoo.dylib
0959b6d4
A
37
38libfoo.dylib : foo.c
39a8cd10 39 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o $(PWD)/libfoo.dylib
0959b6d4
A
40
41libfoo_debug.dylib : foo.c
39a8cd10 42 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -DDEBUG -o libfoo_debug.dylib -install_name $(PWD)/libfoo.dylib
0959b6d4
A
43
44hide/libfoo.dylib : foo.c
39a8cd10
A
45 mkdir -p $(PWD)/hide
46 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o hide/libfoo.dylib -install_name $(PWD)/libfoo.dylib
0959b6d4
A
47
48hide/libfoo_debug.dylib : foo.c
39a8cd10
A
49 mkdir -p $(PWD)/hide
50 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o hide/libfoo_debug.dylib -install_name $(PWD)/libfoo.dylib
0959b6d4
A
51
52# bar_debug has bar_debug as install name
53libbar.dylib : foo.c
39a8cd10 54 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o libbar.dylib
0959b6d4
A
55
56libbar_debug.dylib : foo.c
39a8cd10 57 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -DDEBUG -o libbar_debug.dylib
0959b6d4
A
58
59hide/libbar.dylib : foo.c
39a8cd10
A
60 mkdir -p $(PWD)/hide
61 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o hide/libbar.dylib -install_name $(PWD)/libbar.dylib
0959b6d4
A
62
63hide/libbar_debug.dylib : foo.c
39a8cd10
A
64 mkdir -p $(PWD)/hide
65 ${CC} -I${TESTROOT}/include foo.c -dynamiclib -o hide/libbar_debug.dylib -install_name $(PWD)/libbar_debug.dylib
0959b6d4
A
66
67clean:
68 rm -rf libfoo.dylib libfoo_debug.dylib hide libbar.dylib libbar_debug.dylib main1 main2 main3 main4 main5 main6 main7 main8
69
70
71#
72# check1: main links with libfoo.dylib sets DYLD_IMAGE_SUFFIX=_debug and dynamically loads libfoo.dylib
73# (fails on 10.3)
74#
75main1 : main.c libfoo.dylib
bac542e6 76 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main1 libfoo.dylib
0959b6d4 77
39a8cd10 78check1:
0959b6d4 79 DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main1 libfoo.dylib
39a8cd10 80 DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main1 $(PWD)/libfoo.dylib
0959b6d4
A
81
82
83#
84# check2: main links with libfoo_debug.dylib and dynamically loads libfoo.dylib
85#
86main2 : main.c libfoo_debug.dylib
bac542e6 87 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main2 libfoo_debug.dylib
0959b6d4 88
39a8cd10 89check2:
0959b6d4 90 echo "pwd-1 is ${PWD}"
39a8cd10 91 echo "pwd-2 is $(PWD)"
0959b6d4 92 pwd
39a8cd10 93 ./main2 $(PWD)/libfoo.dylib
0959b6d4
A
94
95
96#
97# check3: main links with libfoo.dylib sets DYLD_LIBRARY_PATH=hide and dynamically loads libfoo.dylib
98#
99main3 : main.c libfoo.dylib
bac542e6 100 ${CC} -Wno-deprecated-declarations -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main3 libfoo.dylib
0959b6d4 101
39a8cd10
A
102check3:
103 DYLD_LIBRARY_PATH=$(PWD)/hide && export DYLD_LIBRARY_PATH && ./main3 $(PWD)/libfoo.dylib
0959b6d4
A
104
105
106#
107# check4: main links with libfoo.dylib sets DYLD_LIBRARY_PATH=hide, DYLD_IMAGE_SUFFIX=_debug and dynamically loads libfoo.dylib
108# (fails on 10.3)
109#
110main4 : main.c libfoo.dylib
bac542e6 111 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main4 libfoo.dylib
0959b6d4 112
39a8cd10
A
113check4:
114 DYLD_LIBRARY_PATH=$(PWD)/hide && export DYLD_LIBRARY_PATH && DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main4 $(PWD)/libfoo.dylib
0959b6d4
A
115
116
117#
118# check5: main links with libbar.dylib sets DYLD_IMAGE_SUFFIX=_debug and dynamically loads libbar.dylib
119# (fails on 10.3)
120#
121main5 : main.c libbar.dylib libbar_debug.dylib
bac542e6 122 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main5 libbar.dylib
0959b6d4 123
39a8cd10
A
124check5:
125 DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main5 $(PWD)/libbar.dylib
0959b6d4
A
126
127
128#
129# check6: main links with libbar_debug.dylib and dynamically loads libbar.dylib
130# (fails on 10.3)
131#
132main6 : main.c libbar_debug.dylib
bac542e6 133 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main6 libbar_debug.dylib
0959b6d4 134
39a8cd10
A
135check6:
136 DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main6 $(PWD)/libbar.dylib
0959b6d4
A
137
138
139#
140# check7: main links with libbar.dylib sets DYLD_LIBRARY_PATH=hide and dynamically loads libbar.dylib
141#
142main7 : main.c libbar.dylib
bac542e6 143 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main7 libbar.dylib
0959b6d4 144
39a8cd10
A
145check7:
146 DYLD_LIBRARY_PATH=$(PWD)/hide && export DYLD_LIBRARY_PATH && ./main7 $(PWD)/libbar.dylib
0959b6d4
A
147
148
149#
150# check8: main links with libbar.dylib sets DYLD_LIBRARY_PATH=hide, DYLD_IMAGE_SUFFIX=_debug and dynamically loads libbar.dylib
151# (fails on 10.3)
152#
153main8 : main.c libbar.dylib
bac542e6 154 ${CC} -Wno-deprecated-declarations -I${TESTROOT}/include main.c -o main8 libbar.dylib
0959b6d4 155
39a8cd10
A
156check8:
157 DYLD_LIBRARY_PATH=$(PWD)/hide && export DYLD_LIBRARY_PATH && DYLD_IMAGE_SUFFIX=_debug && export DYLD_IMAGE_SUFFIX && ./main8 $(PWD)/libbar.dylib