I’m new to Makefile stuff and want to ask a question about Makefiles. Suppose I have two separate programs having their own .c .h and main.c files. None of the programs are linked. Is it possible to make two executables of such kind of program? If so, how is it possible? I have tried this but it failed, and I got the following error:
/usr/lib/gcc/i486-linux-gnu/4.4.3/../../../../lib/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
In your makefile you can have more than one target. For instance:
Then
make Awould build A only,make Bwould build B only, andmake all(or justmake) would build both.