CC ?= gcc CXX ?= g++ CFLAGS=$(MINGWPATHS) -O3 CXXFLAGS=-std=c++17 $(MINGWPATHS) -O3 DEPS = src/compress.h src/stringutils.h LIBS=-llzma OBJECTS = build/compress.o build/stringutils.o MAKE_BUILD_FOLDER = @mkdir -p build .PHONY: all clean all: $(OBJECTS) build/compress_measurements build/%.o: src/%.c $(DEPS) $(MAKE_BUILD_FOLDER) $(CC) -c -o $@ $< $(CFLAGS) build/%.o: src/%.cpp $(DEPS) $(MAKE_BUILD_FOLDER) $(CXX) -c -o $@ $< $(CXXFLAGS) build/compress_measurements: $(OBJECTS) src/compress_measurements.cpp $(MAKE_BUILD_FOLDER) $(CXX) -static -o $@ $^ $(LIBS) $(CXXFLAGS) clean: -rm -rf build