2013-04-09 3 views
1

makefile이 작동하지 않는 이유가 확실하지 않습니다. 나는 오류를 봤 거든 공백과 탭에 대한 몇 가지 물건을 가지고 있지만 어떻게 해야할지 모르겠다.C++ makefile에 구분 기호가 누락되었습니다.

오류 : makefile : 17 : * 구분 기호가 없습니다. 중지.

# see http://www.gnu.org/software/make/manual/make.html 
#  http://www.gnu.org/software/make/manual/make.html#Automatic-Variables 
CXX=g++ 
CXXFLAGS=-c -Wall -g 
LDFLAGS= 
OBJECTS= main.o Player.o Territory.o Continent.o Game.o Color.o 
TITLE=ass1 
ARCHIVE=$(TITLE).tar.gz 

.PHONY : all clean debug valgrind archive 

# make all 
all: $(OBJECTS) $(TITLE) 

# make ass 
$(TITLE): $(OBJECTS) 
$(CXX) $(LDFLAGS) -o [email protected] $^ 

# make %.o 
%.o: %.cpp %.h 
$(CXX) $(CXXFLAGS) $^ 

# make clean 
clean : 
rm -f *.o *.gch $(TITLE) 

# make debug 
debug : $(TITLE) 
cgdb ./$< 

# make valgrind P0=-Test P1=0 
valgrind : $(TITLE) 
valgrind --tool=memcheck --leak-check=yes ./$< $(P0) $(P1) 

# http://unixhelp.ed.ac.uk/CGI/man-cgi?tar 
archive : 
tar cfz $(ARCHIVE) --ignore-failed-read *.cpp *.h *.pdf Makefile 

# additional dependencies 

main.o: Continent.h Player.h Territory.h 
Player.o: Player.h 
Territory.o: Territory.h 
Continent.o: Continent.h 
Game.o: Game.h 
Color.o: Color.h 

답변

4

명령에 탭 (여백이 아님)이 있어야합니다. 예를 들어,

$(TITLE): $(OBJECTS) 
    $(CXX) $(LDFLAGS) -o [email protected] $^ 
^ this is a tab (in disguise...) 
+0

아 ... 하드 방법 (이렇게 오래 전에 존재했다) 에서이 하나를 계산하려고하는 추억. – hyde

+0

@hyde 터미널에서도'man' 페이지를 읽었습니까? –

+0

GNU info docs, IIRC. – hyde

관련 문제