Skip to content

Commit ebb38dd

Browse files
committed
changing PS1 variable for make bash target
Signed-off-by: luarss <[email protected]>
1 parent 960a711 commit ebb38dd

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

env.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,18 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
1919
export PATH="$(brew --prefix bison)/bin:$(brew --prefix flex)/bin:$(brew --prefix tcl-tk)/bin:$PATH"
2020
export CMAKE_PREFIX_PATH="$(brew --prefix or-tools)"
2121
fi
22+
23+
# For Makefile environment
24+
BASHRC_FILE=~/.bashrc
25+
if ! grep -q "MAKEFILE_ENV" "$BASHRC_FILE"; then
26+
cat <<EOL >> "$BASHRC_FILE"
27+
if [ -n "\$MAKEFILE_ENV" ]; then
28+
PS1='\[\e[32m\]Makefile Environment \[\e[0m\] \w $ '
29+
fi
30+
EOL
31+
source "$BASHRC_FILE"
32+
echo "Bashrc changes applied"
33+
else
34+
echo "Bashrc changes already made"
35+
fi
36+

flow/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ yosys:
979979
# Drop into a bash shell with all environment variables, useful for debugging
980980
.PHONY: bash
981981
bash:
982-
bash
982+
export MAKEFILE_ENV=1; bash
983983

984984
.PHONY: all_defs
985985
all_defs : $(foreach file,$(RESULTS_ODB),$(file).def)

0 commit comments

Comments
 (0)