1 # Create a way to reformat just some files
3 PP_INPUTS_FILTERED := $(wildcard $(PPFILES))
5 PP_INPUTS = $(wildcard $(addprefix $(S)src/lib/,*.rs */*.rs)) \
6 $(wildcard $(addprefix $(S)src/comp/,*.rs */*.rs */*/*.rs)) \
7 $(wildcard $(S)src/test/*/*.rs \
8 $(S)src/test/*/*/*.rs) \
9 $(wildcard $(S)src/fuzzer/*.rs)
11 PP_INPUTS_FILTERED = $(shell echo $(PP_INPUTS) | xargs grep -L \
12 "no-reformat\|xfail-pretty\|xfail-test")
15 reformat: $(SREQ1$(CFG_HOST_TRIPLE))
16 @$(call E, reformat [stage1]: $@)
17 for i in $(PP_INPUTS_FILTERED); \
18 do $(call CFG_RUN_TARG,1,stage1/rustc$(X)) \
19 --pretty normal $$i >$$i.tmp; \
21 then echo failed to print $$i; rm $$i.tmp; \
22 else if cmp --silent $$i.tmp $$i; \
23 then echo no changes to $$i; rm $$i.tmp; \
24 else echo reformated $$i; mv $$i.tmp $$i; \