]> git.saurik.com Git - apple/ld64.git/blame - ld64-134.9/unit-tests/test-cases/kext-basic/Makefile
ld64-134.9.tar.gz
[apple/ld64.git] / ld64-134.9 / unit-tests / test-cases / kext-basic / Makefile
CommitLineData
b1f7435d
A
1
2TESTROOT = ../..
3include ${TESTROOT}/include/common.makefile
4
5#
6# Sanity check that ld can link a kext
7#
8FILE_TYPE = OBJECT
9ifeq (${ARCH},x86_64)
10 FILE_TYPE = KEXTBUNDLE
11endif
12ifeq (${FILEARCH},arm)
13 FILE_TYPE = KEXTBUNDLE
14endif
15
16#CC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang
17
18run: all
19
20all:
21 ${CC} ${CCFLAGS} -static -mkernel -c mykext.c -o mykext.o
22 ${CC} ${CCFLAGS} -static -mkernel -c mykextinfo.c -o mykextinfo.o
23 ${CC} ${CCFLAGS} -Wl,-kext mykext.o mykextinfo.o -nostdlib -lkmodc++ -lkmod -lcc_kext -o mykext -Wl,-w -Wl,-new_linker
24 otool -hv mykext | grep ${FILE_TYPE} | ${FAIL_IF_EMPTY}
25 nm -nm mykext | grep '(undefined) external _extern_global' | ${FAIL_IF_EMPTY}
26 nm -nm mykext | grep '(__DATA,__data) external _my_global' | ${FAIL_IF_EMPTY}
27 otool -rv mykext | grep '_extern_global' | ${FAIL_IF_EMPTY}
28 ${PASS_IFF} true
29
30clean:
31 rm -f mykext.o mykextinfo.o mykext