Problem with makefile

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
compile: CliqueGenetic.exe

CliqueGenetic.exe : CliqueGenetic.o   SubGraph.o
CliqueGenetic.o   : CliqueGenetic.cpp SubGraph.h
SubGraph.o        : SubGraph.cpp      SubGraph.h

#-------------------------------------------------------------

run: compile
	./CliqueGenetic.exe

clean:
	rm -f *.o
	rm -f *.exe

build: clean compile	
	
%.exe: %.o
	g++ -o $@ $^
	
%.o: %.cpp
	g++ -c $<

#=============================================================# 


Hello to everyone! I have problem with this makefile. It says that "nothing to be done for `compile'". Maybe anyone could help me? Thanks in advance!
Try it this way around:


CliqueGenetic.exe : CliqueGenetic.o SubGraph.o
g++ -o $@ $^
CliqueGenetic.o : CliqueGenetic.cpp SubGraph.h
SubGraph.o : SubGraph.cpp SubGraph.h

#-------------------------------------------------------------

run: CliqueGenetic.exe
./CliqueGenetic.exe

clean:
rm -f *.o
rm -f *.exe

build: clean CliqueGenetic.exe

%.o: %.cpp
g++ -c $<

#====================================================
Last edited on
Thanks!
Topic archived. No new replies allowed.