How to compile a newly created file while building kernel

I have created a new file called /usr/src/sys/amd64/amd64/hibernate_machdep.c
In this file, I have defined a function and I declare that function in /usr/src/sys/sys/hibernate.h
I called that function in acpi.c file
I have included this header in file in both "hibernate_machdep.c" and "acpi.c"
while building kernel, it shows an error of unable to find the definition.

Please give solution for compiling that newly created file while building.
 
Find the make file in the directory. Update it. I assume you know about make file syntax, and how the kernel make system works? If not, you are in for an interesting voyage of discovery.
 
There is a file called files.amd64
This file has the entry of what are all the files which is inside the directory of "/usr/src/sys/amd64/amd64/ " has to be compiled while building kernel

If we create a new entry for our newly created file, while building our newly created file also get compiled.
 
Back
Top