]>
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 | # | |
8 | ||
9 | ifeq (${ARCH},x86_64) | |
10 | FILE_TYPE = KEXTBUNDLE | |
11 | else | |
12 | FILE_TYPE = OBJECT | |
13 | endif | |
14 | ||
15 | ||
16 | run: all | |
17 | ||
18 | all: | |
19 | ${CC} ${CCFLAGS} -static -fno-common -mkernel -c mykext.c -o mykext.o | |
20 | ${CC} ${CCFLAGS} -static -fno-common -mkernel -c mykextinfo.c -o mykextinfo.o | |
21 | ${CC} ${CCFLAGS} -Wl,-kext mykext.o mykextinfo.o -nostdlib -lkmodc++ -lkmod -lcc_kext -o mykext | |
22 | otool -hv mykext | grep ${FILE_TYPE} | ${FAIL_IF_EMPTY} | |
23 | nm -nm mykext | grep '(undefined) external _extern_global' | ${FAIL_IF_EMPTY} | |
24 | nm -nm mykext | grep '(__DATA,__data) external _my_global' | ${FAIL_IF_EMPTY} | |
25 | otool -rv mykext | grep '_extern_global' | ${FAIL_IF_EMPTY} | |
26 | ${PASS_IFF} true | |
27 | ||
28 | clean: | |
29 | rm -f mykext.o mykextinfo.o mykext |