build: Follow FHS default paths.

This commit is contained in:
orbea 2020-12-28 10:35:47 -08:00
parent d662bcb50f
commit 8a6b89d032
2 changed files with 22 additions and 20 deletions

View File

@ -47,20 +47,19 @@ else ifeq ($(platform),macos)
mkdir -p ~/Library/Application\ Support/$(name)/Shaders/ mkdir -p ~/Library/Application\ Support/$(name)/Shaders/
cp -R out/$(name).app /Applications/$(name).app cp -R out/$(name).app /Applications/$(name).app
else ifneq ($(filter $(platform),linux bsd),) else ifneq ($(filter $(platform),linux bsd),)
mkdir -p $(DESTDIR)$(prefix)/bin/ mkdir -p $(DESTDIR)$(bindir)
mkdir -p $(DESTDIR)$(prefix)/share/applications/ mkdir -p $(DESTDIR)$(datarootdir)/applications
mkdir -p $(DESTDIR)$(prefix)/share/icons/hicolor/256x256/apps/ mkdir -p $(DESTDIR)$(datarootdir)/icons/hicolor/256x256/apps
mkdir -p $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/ mkdir -p $(DESTDIR)$(datarootdir)/icons/hicolor/scalable/apps
mkdir -p $(DESTDIR)$(prefix)/share/$(name)/ mkdir -p $(DESTDIR)$(datadir)/$(name)/Database
mkdir -p $(DESTDIR)$(prefix)/share/$(name)/Database/ mkdir -p $(DESTDIR)$(datadir)/$(name)/Firmware
mkdir -p $(DESTDIR)$(prefix)/share/$(name)/Firmware/ mkdir -p $(DESTDIR)$(datadir)/$(name)/Shaders
mkdir -p $(DESTDIR)$(prefix)/share/$(name)/Shaders/ cp out/$(name) $(DESTDIR)$(bindir)/$(name)
cp out/$(name) $(DESTDIR)$(prefix)/bin/$(name) cp $(ui)/resource/$(name).desktop $(DESTDIR)$(datarootdir)/applications/$(name).desktop
cp $(ui)/resource/$(name).desktop $(DESTDIR)$(prefix)/share/applications/$(name).desktop cp $(ui)/resource/$(name).png $(DESTDIR)$(datarootdir)/icons/hicolor/256x256/apps/$(name).png
cp $(ui)/resource/$(name).png $(DESTDIR)$(prefix)/share/icons/hicolor/256x256/apps/$(name).png cp $(ui)/resource/$(name).svg $(DESTDIR)$(datarootdir)/icons/hicolor/scalable/apps/$(name).svg
cp $(ui)/resource/$(name).svg $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/$(name).svg cp Database/* $(DESTDIR)$(datadir)/$(name)/Database/
cp Database/* $(DESTDIR)$(prefix)/share/$(name)/Database/ cp -r ../shaders/* $(DESTDIR)$(datadir)/$(name)/Shaders/
cp -r ../shaders/* $(DESTDIR)$(prefix)/share/$(name)/Shaders/
endif endif
uninstall: uninstall:
@ -68,9 +67,9 @@ ifeq ($(platform),windows)
else ifeq ($(platform),macos) else ifeq ($(platform),macos)
rm -rf /Applications/$(name).app rm -rf /Applications/$(name).app
else ifneq ($(filter $(platform),linux bsd),) else ifneq ($(filter $(platform),linux bsd),)
rm -f $(DESTDIR)$(prefix)/bin/$(name) rm -f $(DESTDIR)$(bindir)/$(name)
rm -f $(DESTDIR)$(prefix)/share/applications/$(name).desktop rm -f $(DESTDIR)$(datarootdir)/applications/$(name).desktop
rm -f $(DESTDIR)$(prefix)/share/icons/hicolor/256x256/apps/$(name).png rm -f $(DESTDIR)$(datarootdir)/icons/hicolor/256x256/apps/$(name).png
rm -f $(DESTDIR)$(prefix)/share/icons/hicolor/scalable/apps/$(name).svg rm -f $(DESTDIR)$(datarootdir)/icons/hicolor/scalable/apps/$(name).svg
rm -rf $(DESTDIR)$(prefix)/share/$(name) rm -rf $(DESTDIR)$(datadir)/$(name)
endif endif

View File

@ -239,5 +239,8 @@ strne = $(if $(filter-out xx,x$(subst $1,,$2)$(subst $2,,$1)x),1,)
ifeq ($(platform),windows) ifeq ($(platform),windows)
prefix := $(subst $([space]),\$([space]),$(strip $(call strtr,$(LOCALAPPDATA),\,/))) prefix := $(subst $([space]),\$([space]),$(strip $(call strtr,$(LOCALAPPDATA),\,/)))
else else
prefix := $(HOME)/.local prefix ?= /usr/local
bindir ?= $(prefix)/bin
datarootdir ?= $(prefix)/share
datadir ?= $(datarootdir)
endif endif