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

Improve Makefiles. #35

Merged
merged 2 commits into from
May 5, 2021
Merged

Improve Makefiles. #35

merged 2 commits into from
May 5, 2021

Conversation

tastytea
Copy link
Contributor

@tastytea tastytea commented May 3, 2021

  • Use CXX instead of CC and CXXFLAGS instead of CFLAGS for C++.
  • Remove LD, because it is set to the same value as CXX.
  • Don't overwrite CXX and CXXFLAGS if they are set as environment
    variables.
  • Replace calls to:
    • g++ with $(CXX)
    • gcc with $(CC)
    • ar with $(AR)

See https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html.


Hardcoding tools can cause issues with cross-compiling and make it impossible to use a different compiler. Overwriting CXXFLAGS prevents me from adding additional compiler-flags (like -march=native).

- Use CXX instead of CC and CXXFLAGS instead of CFLAGS for C++.
- Remove LD, because it is set to the same value as CXX.
- Don't overwrite CXX and CXXFLAGS if they are set as environment
  variables.
- Replace calls to:
  - g++ with $(CXX)
  - gcc with $(CC)
  - ar with $(AR)

See <https://www.gnu.org/software/make/manual/html_node/Implicit-Variables.html>.
gentoo-bot pushed a commit to gentoo/guru that referenced this pull request May 3, 2021
Changes proposed upstream:
<Blackvoxel/Blackvoxel#35>.

Closes: https://bugs.gentoo.org/787074
Signed-off-by: Ronny (tastytea) Gutbrod <gentoo@tastytea.de>
@Blackvoxel
Copy link
Owner

Blackvoxel commented May 3, 2021

Hello Tastytea,

Thanks for submitting this good fix.

We'll review it quickly.

It should be merged in the next days.

Thanks for your interest in our game and for your work.
The Blackvoxel Team

The value of $(MAKE) is the file name with which make was invoked. This
also ensures that the environment variable MAKEFLAGS is passed down.
@tastytea
Copy link
Contributor Author

tastytea commented May 4, 2021

I've added a commit to replace calls to make with $(MAKE). Most were already $(MAKE) but you missed 2.

@Blackvoxel Blackvoxel merged commit c7dadf6 into Blackvoxel:master May 5, 2021
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.

None yet

2 participants