I know how to write .h files and include guards. I want to write a new bar123.h file that contains global variables. Assume that bar123.c does not exist.
Other header files e.g. bar.h would include bar123.h, to make the global variables visible to where they are needed.
One question is, if foo.c includes foo.h which includes bar.h which includes bar123.h, does foo.c always include bar123.h?
Another question is, how should I modify the Makefile and the Kbuild files?
I am looking for a simple hackish solution.
To Answer your first query- Yes foo.c will always contain bar123.h .
Second query , In Make file the only change you need add is add this bar123.h in the list of header include file . since you dont have any new .o files being generated you dont need to change that part .
Hope it answers your queries