wibo/Makefile

28 lines
510 B
Makefile
Raw Normal View History

2022-06-28 22:28:09 +00:00
all: wibo
CXXFLAGS = -Wall -g -m32 -std=c++17 -lstdc++ -MD
2022-07-04 17:27:23 +00:00
LDFLAGS = -lstdc++fs
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)
2022-07-04 17:27:23 +00:00
$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS)
2022-06-28 22:28:09 +00:00
clean:
$(RM) -r $(BUILD_DIR) wibo
.PHONY: all clean
MAKEFLAGS += --no-builtin-rules
-include $(DEP_FILES)