我有这个 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 $@
.cpp.o:
$(CC) $(MYSQLINCLUDESP) $(CFLAGS) $< -o $@
clean:
rm -rf $(OBJECTS) $(EXECUTABLE) *.core
问题出在这条线上
SOURCES= /usr/eval/demo 1/user/demo1/p2/main.cpp
在 demo 和 1 之间有空格,我得到这个错误
`make: don't know how to make /usr/eval/demo Stop`
这个 Makefile 是从其他程序自动生成的