]> git.saurik.com Git - apple/ld64.git/blame - unit-tests/test-cases/re-export-optimizations/Makefile
ld64-127.2.tar.gz
[apple/ld64.git] / unit-tests / test-cases / re-export-optimizations / Makefile
CommitLineData
a61fdf0a
A
1##
2# Copyright (c) 2007 Apple 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
26#
27# Test that a public re-exported library is automatically added as a dependent
28# unless nothing is used from it.
29#
30
31
a61fdf0a 32
afe874b1 33all: all-${ARCH}
a61fdf0a 34
afe874b1
A
35all-i386: all-new all-old
36all-x86_64: all-new all-old
37all-armv6: all-new
38all-armv7: all-new
39
40
41all-old:
42 # -sub_library for 10.4
a61fdf0a
A
43 ${CC} ${CCFLAGS} -dynamiclib bar.c -o libbar.dylib -install_name /usr/lib/libbar.dylib -mmacosx-version-min=10.4
44 ${FAIL_IF_BAD_MACHO} libbar.dylib
45 ${CC} ${CCFLAGS} -dynamiclib foo.c -o libfoo.dylib -lbar -L. -sub_library libbar -mmacosx-version-min=10.4
46 ${FAIL_IF_BAD_MACHO} libfoo.dylib
47 ${CC} ${CCFLAGS} main.c -DCALL_BAR libfoo.dylib -o main -L. -mmacosx-version-min=10.4
48 otool -L main | grep libbar | ${FAIL_IF_EMPTY}
49 nm -m main | grep _bar | grep libbar | ${FAIL_IF_EMPTY}
50 ${CC} ${CCFLAGS} main.c libfoo.dylib -o main -L. -mmacosx-version-min=10.4
51 otool -L main | grep libbar | ${FAIL_IF_STDIN}
52
afe874b1
A
53
54all-new:
55 # -sub_library for 10.5
56 ${CC} ${CCFLAGS} -dynamiclib bar.c -o libbar.dylib -install_name /usr/lib/libbar.dylib
a61fdf0a 57 ${FAIL_IF_BAD_MACHO} libbar.dylib
afe874b1 58 ${CC} ${CCFLAGS} -dynamiclib foo.c -o libfoo.dylib -lbar -L. -sub_library libbar
a61fdf0a 59 ${FAIL_IF_BAD_MACHO} libfoo.dylib
afe874b1 60 ${CC} ${CCFLAGS} main.c -DCALL_BAR libfoo.dylib -o main -L.
a61fdf0a
A
61 otool -L main | grep libbar | ${FAIL_IF_EMPTY}
62 nm -m main | grep _bar | grep libbar | ${FAIL_IF_EMPTY}
afe874b1 63 ${CC} ${CCFLAGS} main.c libfoo.dylib -o main -L.
a61fdf0a
A
64 otool -L main | grep libbar | ${FAIL_IF_STDIN}
65
66
67 ${PASS_IFF} /usr/bin/true
68
69
70clean:
71
72 rm -rf libbar.dylib libfoo.dylib main