我的 Makefile 中缺少分隔符
Missing separator in my Makefile
这是我的结构:
- 生成文件
- src/main.cpp
- include/xml.hpp
我的 Makefile 如下所示:
# Define compiler: gcc for C program, define as g++ for C++
CC = g++
# Compiler flags:
# -g adds debugging information to the executable file
# -Wall turns on most, but not all, compiler warnings
CFLAGS = -g -Wall
# Build target executable:
TARGET = main
all: $(TARGET)
$(TARGET): $(TARGET).c
$(CC) $(CFLAGS) -o $(TARGET) $(TARGET).c
clean:
$(RM) $(TARGET)
我得到的错误是这样的:
15 *** missing separator. Stop.
我从教程中复制了这段代码,所以我不确定哪里出错了。
您使用的是空格而不是制表符。
解析器不喜欢那样。
这是我的结构:
- 生成文件
- src/main.cpp
- include/xml.hpp
我的 Makefile 如下所示:
# Define compiler: gcc for C program, define as g++ for C++
CC = g++
# Compiler flags:
# -g adds debugging information to the executable file
# -Wall turns on most, but not all, compiler warnings
CFLAGS = -g -Wall
# Build target executable:
TARGET = main
all: $(TARGET)
$(TARGET): $(TARGET).c
$(CC) $(CFLAGS) -o $(TARGET) $(TARGET).c
clean:
$(RM) $(TARGET)
我得到的错误是这样的:
15 *** missing separator. Stop.
我从教程中复制了这段代码,所以我不确定哪里出错了。
您使用的是空格而不是制表符。
解析器不喜欢那样。