Reputation: 688
I am working with cygwin on windows 8.1. I have used the following make file
.SUFFIXES : .o .C
CFLAGS = -g2
CC =g++ ${CFLAGS}
LIBRARIES = -lm
.C.o :
${CC} -c $<
SOURCE-FILES = sparsegraph.C myvarious.C pairlist.C graphlist.C peo.graph.C choldc.C copy.C metropolis_fns.C likelihood.C metropolis.C
OBJECT-FILES = sparsegraph.o myvarious.o pairlist.o graphlist.o peo.graph.o choldc.o copy.o metropolis_fns.o likelihood.o metropolis.o
HEADER-FILES = sparsegraph.h pairlist.h graphlist.h myvarious.h chol.h peo.graph.h copy.h likelihood.h metropolis.h
EXECUTABLES = metropolis
PROGRAMS = metropolis sparsegraph myvarious pairlist graphlist peo.graph choldc copy likelihood metropolis_fns
metropolis: ${OBJECT-FILES}
${CC} -o $@ metropolis.o metropolis_fns.o sparsegraph.o myvarious.o pairlist.o graphlist.o peo.graph.o choldc.o copy.o likelihood.o ${LIBRARIES}
metropolis.o: metropolis.C ${HEADER-FILES}
metropolis_fns.o: metropolis_fns.C ${HEADER-FILES}
sparsegraph.o: sparsegraph.C ${HEADER-FILES}
myvarious.o: myvarious.C ${HEADER-FILES}
pairlist.o: pairlist.C ${HEADER-FILES}
graphlist.o: graphlist.C ${HEADER-FILES}
peo.graph.o: peo.graph.C ${HEADER-FILES}
choldc.o: choldc.C chol.h
copy.o: copy.C ${HEADER-FILES}
clean:rm *.o metropolis sparsegraph myvarious pairlist graphlist peo.graph choldc copy likelihood metropolis_fns
then when i use
make -f Makefile clean
it throws the following output error
make: *** No rule to make target 'rm', needed by 'clean'.Stop.
can anybody figure out the error? and how to solve it? thanks all!
Upvotes: 3
Views: 10637
Reputation: 227418
Tokens following the :
on the same line as the target are dependencies of that target. The command must be on the next line, preceded by a tab:
clean:
rm *.o metropolis sparsegraph myvarious pairlist graphlist peo.graph choldc copy likelihood metropolis_fns
Upvotes: 16