Skip to content

Commit

Permalink
[makefile] fix recurse level of reformat
Browse files Browse the repository at this point in the history
Signed-off-by: Avimitin <[email protected]>
  • Loading branch information
Avimitin authored and sequencer committed Oct 16, 2024
1 parent a0f7989 commit 1153982
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ clean:

.PHONY: reformat
reformat:
mill -i __.reformat

.PHONY: checkformat
checkformat:
mill -i __.checkFormat
nix develop ".#t1.elaborator" -c bash -c 'eval "$$formatHook"'

.PHONY: list-configs
list-configs:
Expand Down
12 changes: 12 additions & 0 deletions nix/t1/mill-modules.nix
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,18 @@ let
CIRCT_INSTALL_PATH = circt-full;
JEXTRACT_INSTALL_PATH = jextract-21;
JAVA_TOOL_OPTIONS = "--enable-preview";
formatHook = ''
targets=( $(mill -i resolve _.reformat) )
localTargets=()
for t in ''${targets[@]}; do
if ! mill -i show "''${t//reformat/sources}" | grep -q dependencies; then
localTargets+=($t)
fi
done
for t in ''${localTargets[@]}; do
mill -i "$t"
done
'';
};

outputs = [ "out" "omreader" "elaborator" "t1package" ];
Expand Down

0 comments on commit 1153982

Please sign in to comment.