]>
Commit | Line | Data |
---|---|---|
55e3d2f6 A |
1 | |
2 | TESTROOT = ../.. | |
3 | include ${TESTROOT}/include/common.makefile | |
4 | ||
5 | # | |
6 | # Sanity check that ld can link a kext | |
7 | # | |
afe874b1 | 8 | FILE_TYPE = OBJECT |
55e3d2f6 A |
9 | ifeq (${ARCH},x86_64) |
10 | FILE_TYPE = KEXTBUNDLE | |
afe874b1 A |
11 | endif |
12 | ifeq (${FILEARCH},arm) | |
13 | FILE_TYPE = KEXTBUNDLE | |
55e3d2f6 A |
14 | endif |
15 | ||
afe874b1 | 16 | #CC = /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang |
55e3d2f6 A |
17 | |
18 | run: all | |
19 | ||
20 | all: | |
afe874b1 A |
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 | |
55e3d2f6 A |
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 | ||
30 | clean: | |
31 | rm -f mykext.o mykextinfo.o mykext |