]> git.saurik.com Git - apple/ld64.git/blob - unit-tests/test-cases/objc-category-archive/Makefile
b56bacf3382e9ad727e87572d0a41550ca515e37
[apple/ld64.git] / unit-tests / test-cases / objc-category-archive / Makefile
1
2 TESTROOT = ../..
3 include ${TESTROOT}/include/common.makefile
4
5
6 #
7 # Verify -ObjC works with x86_64 categories
8 # Verify stripped archives keep don't-strip bit
9 #
10
11 run: all
12
13 all:
14 ${CC} ${CCFLAGS} -g test.m -c -o test.o
15 libtool -static test.o -o libtest.a
16 ${CC} ${CCFLAGS} main.m libtest.a -ObjC -o main -framework Foundation
17 nm main | grep mycatmethod1 | ${FAIL_IF_EMPTY}
18 nm main | grep mycatmethod2 | ${FAIL_IF_EMPTY}
19 ${LD} -arch ${ARCH} -r -S -keep_private_externs test.o -o test-stripped.o
20 libtool -static test-stripped.o -o libtest-stripped.a
21 ${CC} ${CCFLAGS} main.m libtest-stripped.a -all_load -dead_strip -o main2 -framework Foundation
22 nm main2 | grep mycatmethod1 | ${FAIL_IF_EMPTY}
23 nm main2 | grep mycatmethod2 | ${FAIL_IF_EMPTY}
24 ${PASS_IFF_GOOD_MACHO} main2
25
26 clean:
27 rm -rf test.o test-stripped.o libtest.a libtest-stripped.a main main2