在尝试编译.cpp文件的同时尝试创建bin目录但不确定为什么我遇到上面的以下错误
CC = g++
CC_FLAGS = -Wall -pendantic -std=c++11 -03
EXECUTABLE = test_commands
SOURCEDIR = src
BUILDRDIR = bin
SOURCES = $(wildcard $(SOURCEDIR)/*.cpp)
OBJECTS = $(SOURCES:.cpp=.o)
all: $(OBJECTS)
mkdir -p $(BUILDDIR)
$(CC) $(OBJECTS) -o $(BUILDDIR)/$(EXECUTABLE)
rshell: $(OBJECTS)
mkdir -p $(BUILDDIR)
$(CC) $(OBJECTS) -o $(BUILDDIR)/$(EXECUTABLE)
%.o: %.cpp
$(CC) -c $(CC_FLAGS) $< -o $@
clean:
rm -f $(EXECUTABLE) $(OBJECTS)
rm -rf $(BUILDDIR)
答案 0 :(得分:0)
每个规则(rshell,%。o,clean,all)的每个命令的行必须以制表符开头。