From d4d0822eff1e29c02abda0299652d6434c5ceb36 Mon Sep 17 00:00:00 2001 From: jacekpoz Date: Wed, 24 Apr 2024 20:09:04 +0200 Subject: [PATCH] simplify make preprocess using clang-format's -i thanks for letting me know krizej I wouldn't have found this myself --- Makefile | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index ccb260c..7611475 100644 --- a/Makefile +++ b/Makefile @@ -36,23 +36,17 @@ clean: rm -rf $(BIN) rm -rf $(PREPROCESSED) -TMP = temp - -tmp: - mkdir -p $(TMP) - _PP_HXX = osuparser.hpp config.hpp _PP_CXX = osuparser.cpp _PP = $(_PP_HXX) $(_PP_CXX) PP = $(addprefix $(PREPROCESSED)/, $(_PP)) -preprocess: dirs tmp $(PP) - rm -rf $(TMP) +preprocess: dirs $(PP) $(PREPROCESSED)/%.hpp: $(INCLUDE)/%.hpp - $(CXX) $(CXXFLAGS) -E $< > $(TMP)/$(@:$(PREPROCESSED)/%=%) - clang-format $(TMP)/$(@:$(PREPROCESSED)/%=%) > $@ + $(CXX) $(CXXFLAGS) -E $< > $@ + clang-format -i $@ $(PREPROCESSED)/%.cpp: $(SRC)/%.cpp - $(CXX) $(CXXFLAGS) -E $< > $(TMP)/$(@:$(PREPROCESSED)/%=%) - clang-format $(TMP)/$(@:$(PREPROCESSED)/%=%) > $@ + $(CXX) $(CXXFLAGS) -E $< > $@ + clang-format -i $@