Skip to content

Optimize Makefile for pvsneslib#187

Merged
RetroAntho merged 1 commit intoalekmaul:developfrom
kobenairb:makefile_pvsneslib
Apr 9, 2023
Merged

Optimize Makefile for pvsneslib#187
RetroAntho merged 1 commit intoalekmaul:developfrom
kobenairb:makefile_pvsneslib

Conversation

@kobenairb
Copy link
Copy Markdown
Contributor

Hi all,

In the same way, a small optimization for the Makefile used by pvsneslib/.

The changes are:

The export statements can be moved inside the variable definition, and we don't need to export TOPDIR since it's not used outside this Makefile.

The @echo command in the docs target can be made into a single line to avoid unnecessary output.

The if statement in the docs target can be simplified by using @[ -f warn.log ] && cat warn.log to output the warn.log file.

This version uses "$(MAKE)" instead of "make" to ensure that the make command is correctly overridden if the user specifies a different make command.

It also uses "@rm" instead of "rm" and "@mkdir" instead of "mkdir" to suppress command echoing, and removes unnecessary semicolons at the end of some commands.

The mkdir command will fail if the lib directory already exists, which can be the case if the Makefile is run multiple times. To avoid this issue, the -p option is used with the mkdir command to create the directory only if it does not exist.

@RetroAntho RetroAntho merged commit 3e4de03 into alekmaul:develop Apr 9, 2023
@RetroAntho
Copy link
Copy Markdown
Collaborator

Thanks !

@kobenairb kobenairb deleted the makefile_pvsneslib branch April 10, 2023 03:08
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.

2 participants