compilation

make .o files in separate folder in linux kernel compilation

喜夏-厌秋 提交于 2020-08-24 07:26:25
问题 see in linux kernel compilation if just do make make ARCH=xyz uImage then it will compile files as per your .conf file and create .o or .ko in same folder where your .c file is there. So is there any way so i can force to compilation so that all .o and .ko will be any in different folder specified by me 回答1: try using make O=/path/to/mydir Here is the documentation from the kernel's Makefile: # kbuild supports saving output files in a separate directory. # To locate output files in a separate

Undefined reference to global variable during linking

走远了吗. 提交于 2020-08-21 08:30:40
问题 I am trying to compile a program which is divided into 3 modules, corresponding to 3 source files: a.c , b.c , and z.c . z.c contains the main() function, which calls functions in a.c and b.c . Furthermore, a function in a.c calls a function in b.c , and viceversa. Finally, there is a global variable count which is used by the three modules and is defined in a separate header file, global.h . The code of the source files is the following: a.c #include "global.h" #include "b.h" #include "a.h"