I have a program test.c which needs to include a header file common.h. I am new to writing make files and so far I have the right make file for just test.c (it uses openssl):
INC=/usr/local/ssl/include/
LIB=/usr/local/ssl/lib/
all:
gcc -I$(INC) -L$(LIB) -o test test.c -lcrypto -ldl
How do I edit the above file to also compile common.h ?
Thanks.
You don’t compile header files directly. They will be included by
#includein the C files. If common.h is located in the same directory as the make file, you won’t need to add anything. Otherwise, you might want to edit the makefile to add other folders that include header files: