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

Change Linux Makefile to match the Windows and Mac ones #5973

Merged
merged 1 commit into from
Apr 21, 2020

Conversation

Jojo-Schmitz
Copy link
Contributor

@Jojo-Schmitz Jojo-Schmitz commented Apr 20, 2020

follow up for PR #5928 and just for consistency

@Jojo-Schmitz Jojo-Schmitz changed the title Change Linux Makefile to match the Windwows and Mac ones Change Linux Makefile to match the Windows and Mac ones Apr 20, 2020
@AntonioBL
Copy link
Contributor

AntonioBL commented Apr 20, 2020

You need a double space between "VERSION" and "*",
so that ^.*VERSION * (I can't insert the double space with the markup of comments, imagine there are two spaces here) matches the line starting with whatever number of (any) characters ("^.*"), contains "VERSION " (note the space) and then has whatever number of other spaces (" *", this number can also be 0) before the piece we want to obtain. Otherwise it takes the wrong line in the config file.

@Jojo-Schmitz
Copy link
Contributor Author

Jojo-Schmitz commented Apr 20, 2020

Thanks, you are of course right:

Jojo@QuadCore MSYS ~/Documents/GitHub/MuseScore (build)
$ cmake -P config.cmake | sed -n -e "s/^.*VERSION *//p"
_FULL 3.5.0
3.5b-0950eca

Jojo@QuadCore MSYS ~/Documents/GitHub/MuseScore (build)
$ cmake -P config.cmake | sed -n -e "s/^.*VERSION  *//p"
3.5b-0950eca

Fixed. Seems my Copy/Paste went wrong earlier somehow, probably for the same reason as you couldn't show a double space in your comment ;-)

@Jojo-Schmitz Jojo-Schmitz force-pushed the build branch 3 times, most recently from 958e2b7 to ee04566 Compare April 20, 2020 08:38
Makefile Outdated
@@ -20,7 +20,7 @@
CPUS := $(shell getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1)

PREFIX = "/usr/local"
VERSION = `cmake -P config.cmake | grep -oP "VERSION\s+\K.*"`
VERSION = `cmake -P config.cmake | sed -n -e "s/^.*VERSION *//p"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't matter too much here, but generally it's better to use := than = for assignment and $(shell <cmd>) rather than backticks. See https://stackoverflow.com/a/1435867

Copy link
Contributor Author

@Jojo-Schmitz Jojo-Schmitz Apr 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that much better. Works with GNU make only though. Not sure we can take that for granted everywhere?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already used to set CPUS a few lines above and nobody has complained yet.

Copy link
Contributor Author

@Jojo-Schmitz Jojo-Schmitz Apr 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, for Linux (and I guess *BSD too). For Windows/MinGW most probably too, not so sure about Mac though?
Well, just let's do it ;-)

follow up for PR musescore#5928 and just for consistency.
Also improve the syntax for all 3.
@anatoly-os anatoly-os merged commit ed7c465 into musescore:master Apr 21, 2020
@Jojo-Schmitz Jojo-Schmitz deleted the build branch April 21, 2020 17:04
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

Successfully merging this pull request may close these issues.

4 participants