Help with Make

T

Tricky

Hi, first post in here.

Im not a very experienced C programmer, and Im fiddling with make. I
have the following make file (entitled Makefile):

fusionTK.exe : main.o fusionFileIo_O fusionAlgorithms.o
gcc main.o fusionFileIo_O fusionAlgorithms.o -o fusionTK.exe

main.o : main.c fusionDefs.h
gcc -c main.c fusionDefs.h

fusionFileIo_O: fusionFileIO.c fusionDefs.h
gcc -c fusionFileIO.c fusionDefs.h

fusionAlgorithms.o: fusionAlgorithms.c fusionDefs.h
gcc -c fusionAlgorithms.c fusionDefs.h

Which as far as I can tell is all well and good, but when I execute
make, it comes back with the error:
"make: *** No rule to make target `main.c', needed by `main.o'.
Stop."

have I put something in the wrong place? I thought th

Im running this on WinXP pro with cygwin installed.
Also, if I remove the main.c and fusionDefs.h from the main.o
dependencies, it runs the command associated with main.o :"gcc - c
main.c fusionDefs.h" and then complains that the gcc command is not
found. I can quite happily run GCC directly from the command line.
 
J

Joachim Schmitz

Tricky said:
Hi, first post in here.

Im not a very experienced C programmer, and Im fiddling with make. I
have the following make file (entitled Makefile):

fusionTK.exe : main.o fusionFileIo_O fusionAlgorithms.o
gcc main.o fusionFileIo_O fusionAlgorithms.o -o fusionTK.exe

main.o : main.c fusionDefs.h
gcc -c main.c fusionDefs.h

fusionFileIo_O: fusionFileIO.c fusionDefs.h
gcc -c fusionFileIO.c fusionDefs.h

fusionAlgorithms.o: fusionAlgorithms.c fusionDefs.h
gcc -c fusionAlgorithms.c fusionDefs.h

Which as far as I can tell is all well and good, but when I execute
make, it comes back with the error:
"make: *** No rule to make target `main.c', needed by `main.o'.
Stop."

have I put something in the wrong place? I thought th

Im running this on WinXP pro with cygwin installed.
Also, if I remove the main.c and fusionDefs.h from the main.o
dependencies, it runs the command associated with main.o :"gcc - c
main.c fusionDefs.h" and then complains that the gcc command is not
found. I can quite happily run GCC directly from the command line.
OT here (comp.unix.programmer might be a prropriate groupg for this), but
are you sure that the rules are starting with TAB rather than a couple
BLANKs?

Bye, Jojo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top