空間我有這個Makefile生成文件與源
CC=g++
CFLAGS=-g -c -Wall -o standalone
MYSQLINCLUDE = -I/usr/local/include/mysql
MYSQLINCLUDESP = -I/usr/local/include/
LDFLAGS =-L/usr/local/lib
LDFLAGSSP =-L/usr/local/lib/mysql -lmysqlclient -lmysqlcppconn
SOURCES= /usr/eval/demo 1/user/demo1/p2/main.cpp
OBJECTS=$(SOURCES:.cpp=.o)
EXECUTABLE=p2
all: $(SOURCES) $(EXECUTABLE)
$(EXECUTABLE): $(OBJECTS)
$(CC) $(LDFLAGS) $(LDFLAGSSP) $(OBJECTS) -o [email protected]
.cpp.o:
$(CC) $(MYSQLINCLUDESP) $(CFLAGS) $< -o [email protected]
clean:
rm -rf $(OBJECTS) $(EXECUTABLE) *.core
的問題是此行
SOURCES= /usr/eval/demo 1/user/demo1/p2/main.cpp
與演示和1之間的空間,我得到這個錯誤
`make: don't know how to make /usr/eval/demo Stop`
這個Makefile是從其他程序自動生成的
一般而言,您不能在make中使用包含空格(或冒號)的文件名。 – MadScientist
是的,它至少接縫非常混亂,也許這個http://stackoverflow.com/questions/668322/what-is-the-most-reliable-way-of-using-gnumake-with-filenames-containing-spaces問題可以幫助 –