T
Tomás Ó hÉilidhe
I already understand how program compilation works (i.e. the
preprocessor produces individual translation units which get compiled
separately, and then the linker links the object files together), but
I don't know anything about makefiles.
If I had the following program:
/* main.c */
extern void Func(void);
int main(void)
{
Func();
return 0;
}
/* func.c */
#include <stdio.h>
void Func(void) { puts("Hello World!"); }
/* End of code */
, then I would compile it as follows with gcc:
gcc a.c b.c -ansi -pedantic -s -O3 -D NDEBUG -o prog.exe
What would my makefile for this look like?
preprocessor produces individual translation units which get compiled
separately, and then the linker links the object files together), but
I don't know anything about makefiles.
If I had the following program:
/* main.c */
extern void Func(void);
int main(void)
{
Func();
return 0;
}
/* func.c */
#include <stdio.h>
void Func(void) { puts("Hello World!"); }
/* End of code */
, then I would compile it as follows with gcc:
gcc a.c b.c -ansi -pedantic -s -O3 -D NDEBUG -o prog.exe
What would my makefile for this look like?