Files
2026-06-26 19:58:32 +08:00

30 lines
576 B
Makefile
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Makefile - 火车票务管理系统 (C++)
# 编译:mingw32-make 或 makeLinux/Mac
# 清理:mingw32-make clean
CXX = g++
CXXFLAGS = -Wall -Wextra -std=c++17 -g
TARGET = train_ticket.exe
SRCDIR = src
OBJDIR = obj
SRCS = $(wildcard $(SRCDIR)/*.cpp)
OBJS = $(patsubst $(SRCDIR)/%.cpp, $(OBJDIR)/%.o, $(SRCS))
$(TARGET): $(OBJDIR) $(OBJS)
$(CXX) $(CXXFLAGS) -o $@ $(OBJS)
$(OBJDIR):
mkdir -p $(OBJDIR)
$(OBJDIR)/%.o: $(SRCDIR)/%.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@
run: $(TARGET)
./$(TARGET)
clean:
rm -rf $(OBJDIR) $(TARGET)
.PHONY: run clean