Files
tmc/tools/asset_processor/Makefile
T
octorock 91ad7860b2 Improve compilation time of asset_processor
By splitting it up into object files and letting them be compiled in
parallel. Also only rebuild the parts that changed.
2021-11-19 20:58:25 +01:00

34 lines
618 B
Makefile

CXX = g++
CXXFLAGS = -O3 -Wall -Wextra -std=c++17
#CXXFLAGS += -g # debug
BUILD_FOLDER=build
SRCS = $(wildcard *.cpp)
SRCS += $(wildcard assets/*.cpp)
OBJS := $(patsubst %.cpp,$(BUILD_FOLDER)/%.o,$(SRCS))
INCLUDES = -I./
# Create build dirs
$(shell mkdir -p $(dir $(OBJS)) >/dev/null)
.PHONY: all clean
all: asset_processor
asset_processor: $(OBJS)
$(CXX) -o asset_processor $(OBJS) -lstdc++fs
$(BUILD_FOLDER)/%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $<
clean:
$(RM) asset_processor asset_processor.exe
$(RM) -r $(BUILD_FOLDER)
# Automatic dependencies
CXXFLAGS += -MMD
-include $(OBJS:.o=.d)