makefile
I have an assignment and I am supposed to create a file called "makefile" and use the command 'make' to execute "makefile"
here is the example given..
----------------------------------
sample: main.o sort.o addone.o search.o
cc main.o sort.o addone.o search.o -o foo
main.o: main.c
sort.o: sort.c
addone.o: addone.c
search.o: search.c
(NOTE: The spaces preceding "cc main.o . . ." is really a tab. The tab character must be present!)
Now, to create the executable program called "foo", simple type "make" on the command line.
----------------------------------
I tried this
sample: main.o orderedlist.o average.o deviation.o input.o variance.o classify.o highscore.o lowscore.o testinput.o
cc main.o orderedlist.o average.o deviation.o input.o variance.o classify.o highscore.o lowscore.o testinput.o -o main
main.o: main.c
orderedlist.o: orderedlist.c
average.o: average.c
deviation.o: deviation.c
input.o: input.c
variance.o: variance.c
classify.o: classify.c
highscore.o: highscore.c
lowscore.o: lowscore.c
testinput.o: testinput.c
that gave an error..
makefile:2: *** missing separator. Stop.
I am assuming that this error was caused because of a lack of : usage in line 2.. how do I correct this?
|