Hi guys i am trying to create one simple make file and execute in cygwin.
This is the file contents
test: test.c
gcc -c test.c -O3 -Wall -I.
test1: test1.c
gcc -c test1.c -O3 -Wall -I.
When i execute this only the first file is getting compiled and not the second one. Can anyone explain why and what is the correct way?
It looks like your indentation is a bit mixed up. The whitespace at the start of those lines should be a single tab character.
Also:
You will need to specify the target by typing
make test1on the command line if you want to compile the second file.It is also common to add a target called
all. You could add this at the top of your file: