Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement: Makefile save command automatically adjusts PROJ := my_project #222

Open
elmbeech opened this issue Mar 29, 2024 · 0 comments

Comments

@elmbeech
Copy link
Contributor

elmbeech commented Mar 29, 2024

In each Makefiel is the following command

PROJ := my_project

save: 
        echo "Saving project as $(PROJ) ... "
        mkdir -p ./user_projects
        mkdir -p ./user_projects/$(PROJ)
        mkdir -p ./user_projects/$(PROJ)/custom_modules
        mkdir -p ./user_projects/$(PROJ)/config 
        cp main.cpp ./user_projects/$(PROJ)
        cp Makefile ./user_projects/$(PROJ)
        cp VERSION.txt ./user_projects/$(PROJ)
        cp ./config/* ./user_projects/$(PROJ)/config
        cp ./custom_modules/* ./user_projects/$(PROJ)/custom_modules

if the following sed line would be added, then the PROJ := my_project would automatically be set to what ever name was choosen for saving.

e.g.:

make save PROJ

would not change the line at all.

e.g.:

make save PROJ=abc

would change the line to PROJ := abc

This is the sed line that would do the magic:

sed -i "0,/PROJ := /{s/PROJ := .*/PROJ := $(PROJ)/}" ./user_projects/$(PROJ)/Makefile

I added this line to the Makefiles of my PhysiCell user_projects, and it makes dealing with the projects much easier.

@elmbeech elmbeech changed the title Improvement: Makefile save command automatically adjust the PROJ := my_project Improvement: Makefile save command automatically adjusts PROJ := my_project Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant