2022-06-28 22:28:09 +00:00
|
|
|
all: wibo
|
|
|
|
|
2022-06-28 23:29:26 +00:00
|
|
|
CXXFLAGS = -Wall -g -m32 -std=c++20 -lstdc++ -MD
|
2022-06-28 22:28:09 +00:00
|
|
|
|
|
|
|
BUILD_DIR := build
|
|
|
|
CPP_FILES := $(wildcard *.cpp)
|
|
|
|
O_FILES := $(foreach file,$(CPP_FILES),$(BUILD_DIR)/$(file:.cpp=.o))
|
|
|
|
DEP_FILES := $(O_FILES:.o=.d)
|
|
|
|
|
|
|
|
$(BUILD_DIR):
|
|
|
|
mkdir -p $(BUILD_DIR)
|
|
|
|
|
|
|
|
$(BUILD_DIR)/%.o: %.cpp | $(BUILD_DIR)
|
|
|
|
$(CXX) -c $(CXXFLAGS) $< -o $@
|
|
|
|
|
|
|
|
wibo: $(O_FILES)
|
|
|
|
$(CXX) $(CXXFLAGS) $^ -o $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
$(RM) -r $(BUILD_DIR) wibo
|
|
|
|
|
|
|
|
.PHONY: all clean
|
|
|
|
|
|
|
|
MAKEFLAGS += --no-builtin-rules
|
|
|
|
|
|
|
|
-include $(DEP_FILES)
|