Skip to content

Commit

Permalink
build: Follow FHS default paths.
Browse files Browse the repository at this point in the history
  • Loading branch information
orbea committed Feb 15, 2021
1 parent e055bc4 commit d609d5e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
37 changes: 18 additions & 19 deletions bsnes/target-bsnes/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,29 @@ else ifeq ($(platform),macos)
mkdir -p ~/Library/Application\ Support/$(name)/Shaders/
cp -R out/$(name).app /Applications/$(name).app
else ifneq ($(filter $(platform),linux bsd),)
mkdir -p $(DESTDIR)$(prefix)/bin/
mkdir -p $(DESTDIR)$(prefix)/share/applications/
mkdir -p $(DESTDIR)$(prefix)/share/icons/hicolor/256x256/apps/
mkdir -p $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/
mkdir -p $(DESTDIR)$(prefix)/share/$(name)/
mkdir -p $(DESTDIR)$(prefix)/share/$(name)/Database/
mkdir -p $(DESTDIR)$(prefix)/share/$(name)/Firmware/
mkdir -p $(DESTDIR)$(prefix)/share/$(name)/Shaders/
cp out/$(name) $(DESTDIR)$(prefix)/bin/$(name)
cp $(ui)/resource/$(name).desktop $(DESTDIR)$(prefix)/share/applications/$(name).desktop
cp $(ui)/resource/$(name).png $(DESTDIR)$(prefix)/share/icons/hicolor/256x256/apps/$(name).png
cp $(ui)/resource/$(name).svg $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/$(name).svg
cp Database/* $(DESTDIR)$(prefix)/share/$(name)/Database/
cp -r ../shaders/* $(DESTDIR)$(prefix)/share/$(name)/Shaders/
mkdir -p $(DESTDIR)$(bindir)
mkdir -p $(DESTDIR)$(datarootdir)/applications
mkdir -p $(DESTDIR)$(datarootdir)/icons/hicolor/256x256/apps
mkdir -p $(DESTDIR)$(datarootdir)/icons/hicolor/scalable/apps
mkdir -p $(DESTDIR)$(datadir)/$(name)/Database
mkdir -p $(DESTDIR)$(datadir)/$(name)/Firmware
mkdir -p $(DESTDIR)$(datadir)/$(name)/Shaders
cp out/$(name) $(DESTDIR)$(bindir)/$(name)
cp $(ui)/resource/$(name).desktop $(DESTDIR)$(datarootdir)/applications/$(name).desktop
cp $(ui)/resource/$(name).png $(DESTDIR)$(datarootdir)/icons/hicolor/256x256/apps/$(name).png
cp $(ui)/resource/$(name).svg $(DESTDIR)$(datarootdir)/icons/hicolor/scalable/apps/$(name).svg
cp Database/* $(DESTDIR)$(datadir)/$(name)/Database/
cp -r ../shaders/* $(DESTDIR)$(datadir)/$(name)/Shaders/
endif

uninstall:
ifeq ($(platform),windows)
else ifeq ($(platform),macos)
rm -rf /Applications/$(name).app
else ifneq ($(filter $(platform),linux bsd),)
rm -f $(DESTDIR)$(prefix)/bin/$(name)
rm -f $(DESTDIR)$(prefix)/share/applications/$(name).desktop
rm -f $(DESTDIR)$(prefix)/share/icons/hicolor/256x256/apps/$(name).png
rm -f $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/$(name).svg
rm -rf $(DESTDIR)$(prefix)/share/$(name)
rm -f $(DESTDIR)$(bindir)/$(name)
rm -f $(DESTDIR)$(datarootdir)/applications/$(name).desktop
rm -f $(DESTDIR)$(datarootdir)/icons/hicolor/256x256/apps/$(name).png
rm -f $(DESTDIR)$(datarootdir)/icons/hicolor/scalable/apps/$(name).svg
rm -rf $(DESTDIR)$(datadir)/$(name)
endif
5 changes: 4 additions & 1 deletion nall/GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -239,5 +239,8 @@ strne = $(if $(filter-out xx,x$(subst $1,,$2)$(subst $2,,$1)x),1,)
ifeq ($(platform),windows)
prefix := $(subst $([space]),\$([space]),$(strip $(call strtr,$(LOCALAPPDATA),\,/)))
else
prefix := $(HOME)/.local
prefix ?= /usr/local
bindir ?= $(prefix)/bin
datarootdir ?= $(prefix)/share
datadir ?= $(datarootdir)
endif

0 comments on commit d609d5e

Please sign in to comment.