drhelius / Gearsystem

Sega Master System / Game Gear / SG-1000 emulator for macOS, Windows, Linux, BSD and RetroArch.
https://x.com/drhelius
GNU General Public License v3.0
247 stars 45 forks source link

Define `install` and `uninstall` targets #94

Closed TomChapple closed 4 months ago

TomChapple commented 4 months ago

The make install command is pretty useful for Linux machines to ensure that the built executable is available on the PATH directory, so this pull request aims to add the install and uninstall targets to support this.

I have attempted to adhere to the Makefile Conventions as closely as possible (excluding those unnecessary for this project) which includes defaulting the installation to /usr/local/gearsystem and allowing this to be customisable with DESTDIR and prefix (e.g. make install prefix="/app/bin" to install the application to /app/bin/gearsystem).

The most notable use of this is to make automated packaging systems (such as flatpak-builder) much cleaner as they will only need to specify make install with appropriate arguments.

I have included these targets in a separate file—Makefile.install—as they are not applicable to every operating system; mostly just to Linux. I'm happy to add it to others if they are applicable, I'm just not that familiar with them.

drhelius commented 4 months ago

Thanks!