Hey,
I have a problem that I'm not sure if its from running on windows or not.
Lets say I have the following MakeFile for compiling and creating the executable of 'target.c':
FLAGS = -Wall -g
all : target
target : target.o
gcc ${FLAGS} -o $@ $^
target.o : target.c target.h
gcc ${FLAGS} -c $^
clean :
rm *.o target
Everything compiles just fine and all seems good with no errors.
Just when I try calling "make clean", it gives me this error:
rm: cannot remove `target': No such file or directory
so I navigated into the working directory that contains the files using cygwin, and saw that my executable was actually called 'target.exe', so I had to change the 'clean' function in my MakeFile into:
rm *.o target.exe
Which worked with no problems, but since I will need this to work on a Linux system as well, I'm not sure if changing to target.exe will also run on Linux with no problems.
Any advice on how to find a solution for this problem?
Thank you for your help.