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 $(BIN)
|
||||||
rm -rf $(PREPROCESSED)
|
rm -rf $(PREPROCESSED)
|
||||||
|
|
||||||
TMP = temp
|
|
||||||
|
|
||||||
tmp:
|
|
||||||
mkdir -p $(TMP)
|
|
||||||
|
|
||||||
_PP_HXX = osuparser.hpp config.hpp
|
_PP_HXX = osuparser.hpp config.hpp
|
||||||
_PP_CXX = osuparser.cpp
|
_PP_CXX = osuparser.cpp
|
||||||
_PP = $(_PP_HXX) $(_PP_CXX)
|
_PP = $(_PP_HXX) $(_PP_CXX)
|
||||||
PP = $(addprefix $(PREPROCESSED)/, $(_PP))
|
PP = $(addprefix $(PREPROCESSED)/, $(_PP))
|
||||||
|
|
||||||
preprocess: dirs tmp $(PP)
|
preprocess: dirs $(PP)
|
||||||
rm -rf $(TMP)
|
|
||||||
|
|
||||||
$(PREPROCESSED)/%.hpp: $(INCLUDE)/%.hpp
|
$(PREPROCESSED)/%.hpp: $(INCLUDE)/%.hpp
|
||||||
$(CXX) $(CXXFLAGS) -E $< > $(TMP)/$(@:$(PREPROCESSED)/%=%)
|
$(CXX) $(CXXFLAGS) -E $< > $@
|
||||||
clang-format $(TMP)/$(@:$(PREPROCESSED)/%=%) > $@
|
clang-format -i $@
|
||||||
|
|
||||||
$(PREPROCESSED)/%.cpp: $(SRC)/%.cpp
|
$(PREPROCESSED)/%.cpp: $(SRC)/%.cpp
|
||||||
$(CXX) $(CXXFLAGS) -E $< > $(TMP)/$(@:$(PREPROCESSED)/%=%)
|
$(CXX) $(CXXFLAGS) -E $< > $@
|
||||||
clang-format $(TMP)/$(@:$(PREPROCESSED)/%=%) > $@
|
clang-format -i $@
|
||||||
|
|
Loading…
Reference in a new issue