To rephrase your question, you want to build C source files (xxxx.c & yyyy.h) into executable binaries. It is possible that in this case, it is as simple as typing
This will compile and link dh_gen.c
into the executable binary dh_gen
. Assuming that the code is syntactically correct, the make
command has enough built-in knowledge of building C source code into runtime binaries, that it will usually succeed. It may be that you need to link the dh_gen.o
(created by compiling dh_gen.c
) with one or more libraries. If that is the case, you will need to identify what libraries, and then either:
- run the linker, ld, independently, giving appropriate linker commands to specify which libraries and where they are stored
- add some commandline options to the LDFLAGS macro when invoking make
- craft a Makefile with the accordant rules and macros.
If the need for a Makefile or more commandline arguments is necessary, post the complete and exact
results from the make
command here, and someone will be able to advise you.
One last point of clarification; C header files (blahblah.h
) are not libraries. They often accompany libraries (libblablah.so.x.y
), so that the code that uses the library knows how to access the content of the library.