using MAKE with makefile to create executable file
Hey guys. Been working on separating huge (relative term) file into smaller files with creation of own header files. We are to create a main source file, a source file of function routines, and then a header file (with function prototypes in it -- no global variables in this program but they would go here too)
Then create a makefile that creates the object files and is used in compilation of executable file; but I am getting compilation errors when I use the command MAKE . Any idea?
(note: our C compiler uses command gcc to compile, not cc as the book shows AND our instructor said something about the option -lm to link a math library--not sure what this is for)
Here's what I have in my directory named QE
Code:
./ QE.c QEfns.c QEmain.c makefile
../ QE.h QEfns.o QEmain.o
Here's what my makefile looks like
Code:
QUADR: QEmain.o QEfns.o
gcc -o -lm QUADR QEmain.o QEfns.o
QEmain.o: QEmain.c QE.h
gcc -c QEmain.c
QEfns.o: QEfns.c QE.h
gcc -c QEfns.c
Here's the compilation errors I am getting
Code:
212 /accounts/student2/srbkpk/QE make
gcc -o -lm QUADR QEmain.o QEfns.o
gcc: QUADR: No such file or directory
*** Error code 1
make: Fatal error: Command failed for target `QUADR'