Hi
I have sample hello world module in subdirectory:
and
When I try to compile it from the current directory then I get:
This is strange because linker tries to link file in module-1.1 but compiler created them in the current directory:
I am doing something wrong or compilation from subdirectory is not supported ?
I have sample hello world module in subdirectory:
Code:
./module-1.1/module.c
./Makefile
Code:
$ cat Makefile
KMOD=m-1.1-hello
SRCS=module-1.1/module.c
.include <bsd.kmod.mk>
Code:
$ make
cc -O2 -pipe -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc -I. -I@ -I@/contrib/altq -fno-common -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -mno-aes -mno-avx -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float -fno-asynchronous-unwind-tables -ffreestanding -fstack-protector -std=iso9899:1999 -Qunused-arguments -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -Wundef -Wno-pointer-sign -fformat-extensions -Wmissing-include-dirs -fdiagnostics-show-option -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -c module-1.1/module.c
ld -d -warn-common -r -d -o m-1.1-hello.ko module-1.1/module.o
ld: module-1.1/module.o: No such file: No such file or directory
*** Error code 1
Code:
$ ls
@ Makefile
machine module-1.1
module.o x86
I am doing something wrong or compilation from subdirectory is not supported ?
Last edited by a moderator: