simplify make preprocess using clang-format's -i
thanks for letting me know krizej I wouldn't have found this myself
This commit is contained in:
parent
2e259e946d
commit
d4d0822eff
1 changed files with 5 additions and 11 deletions
16
Makefile
16
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 $@
|
||||
|
|
Loading…
Reference in a new issue