Skip to content

Makefile: General improvements#197

Open
asiekierka wants to merge 3 commits into
nesdev-org:masterfrom
asiekierka:feature/makefile
Open

Makefile: General improvements#197
asiekierka wants to merge 3 commits into
nesdev-org:masterfrom
asiekierka:feature/makefile

Conversation

@asiekierka

Copy link
Copy Markdown

Allows defining user-provided CFLAGS/CXXFLAGS/LDFLAGS, as well as an install target with DESTDIR and PREFIX variables.

However, there's some work on the UI side that has to be done before I'd consider official installing on Linux to be viable:

  • When opening a new installation, MesenCE should check if it has write access to the directory it's operating in (Linux supports this via access()) - if not, it should hide the radio button option to change the configuration path.
  • On Linux, MesenCE periodically updates its own .desktop file to configure file associations, but the same .desktop file is also used to provide a desktop/application menu icon after installation. It would be better if it had a command-line option to generate a .desktop file that a package manager (or make install) could then install globally, system-wide; and, ideally, if MesenCE checked for the existence of such a file and did not install one locally if so.

Comment thread makefile

ifeq ($(MESENOS),osx)
LINKOPTIONS += -framework Foundation -framework Cocoa -framework GameController -framework CoreHaptics -Wl,-rpath,/opt/local/lib
CXXFLAGS += -fPIC -Wall --std=c++17 $(SDL2INC) -I $(realpath ./) -I $(realpath ./Core) -I $(realpath ./Utilities) -I $(realpath ./Sdl) -I $(realpath ./Linux) -I $(realpath ./MacOS)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Why are you using realpath here? What functional purpose does this serve?

And you do know on some OSes (ex. OS X), realpath is not available, yes?

@asiekierka asiekierka Jul 2, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That code was already there (see a few lines below in the diff) and it has successfully built Mesen on macOS for the past few years, so...

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sorry about that -- yeah, I missed the part of the (removal/relocation) part of the diff. Really don't know why any of that is there. Thanks for answering / correcting me though!

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