Refactoring (MAY BE BUGGY)
This commit is contained in:
22
Makefile
Normal file
22
Makefile
Normal file
@@ -0,0 +1,22 @@
|
||||
CXX = g++
|
||||
CXXFLAGS = -O3 -Isrc -Wall -Wextra -std=c++17
|
||||
|
||||
BUILD_DIR = build
|
||||
SRCS = $(shell find src -name '*.cpp')
|
||||
VPATH = $(sort $(dir $(SRCS)))
|
||||
OBJS = $(addprefix $(BUILD_DIR)/, $(notdir $(SRCS:.cpp=.o)))
|
||||
TARGET = ground
|
||||
|
||||
all: $(TARGET)
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
$(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJS)
|
||||
|
||||
$(BUILD_DIR)/%.o: %.cpp
|
||||
@mkdir -p $(BUILD_DIR)
|
||||
$(CXX) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR) $(TARGET)
|
||||
|
||||
.PHONY: all clean
|
||||
Reference in New Issue
Block a user