Skip to content

Commit

Permalink
Makefile save function sets the PROJ variable is now solved with awk …
Browse files Browse the repository at this point in the history
…instead of sed, to be hopefully compatible with all supported platforms and unix flavors.
  • Loading branch information
elmbeech committed Jun 11, 2024
1 parent ef5e722 commit e334eb6
Show file tree
Hide file tree
Showing 20 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/Makefile-default
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/biorobots/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/cancer_biorobots/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/cancer_immune/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/celltypes3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/heterogeneity/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/interactions/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/physimess/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/pred_prey_farmer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/rules_sample/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/template/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/virus_macrophage/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects/worm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,8 +311,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects_intracellular/boolean/template_BM/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -325,8 +325,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion sample_projects_intracellular/boolean/tutorial/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -315,8 +315,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/custom_DCs_2substrates/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down
2 changes: 1 addition & 1 deletion unit_tests/custom_voxel_values/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ save:
mkdir -p ./user_projects/$(PROJ)/custom_modules
mkdir -p ./user_projects/$(PROJ)/config
cp main.cpp ./user_projects/$(PROJ)
awk -i inplace '{gsub("^PROJ :=.*$$", "PROJ := $(PROJ)", $$0); print $$0}' Makefile
cp Makefile ./user_projects/$(PROJ)
sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile
cp VERSION.txt ./user_projects/$(PROJ)
cp -r ./config/* ./user_projects/$(PROJ)/config
cp -r ./custom_modules/* ./user_projects/$(PROJ)/custom_modules
Expand Down

0 comments on commit e334eb6

Please sign in to comment.