mirror of
https://github.com/Dariasteam/Cows-Revenge.git
synced 2026-01-23 02:15:17 +00:00
Add uninstall and DESTDIR to makefile
This commit is contained in:
parent
a53801e19f
commit
2d2f0ec676
1 changed files with 38 additions and 13 deletions
51
Makefile
51
Makefile
|
|
@ -1,6 +1,12 @@
|
|||
prefix ?= /usr/local
|
||||
prefix ?= usr/local
|
||||
DESTDIR :=
|
||||
ICONSIZES := 64 128
|
||||
define \n
|
||||
|
||||
all:
|
||||
|
||||
endef
|
||||
|
||||
build/cowsrevenge:
|
||||
mkdir -p build
|
||||
cd build; git clone -b 2.1 --single-branch https://github.com/godotengine/godot || true
|
||||
cd build/godot; scons -j `nproc` platform=server target=release_debug use_llvm=yes unix_global_settings_path=".."
|
||||
|
|
@ -10,17 +16,36 @@ all:
|
|||
build/godot/bin/godot_server.server.tools.64 -export "Linux X11" build/cowsrevenge
|
||||
|
||||
|
||||
install:
|
||||
mkdir -p $(prefix)/bin/
|
||||
mkdir -p $(prefix)/share/applications/
|
||||
mkdir -p $(prefix)/share/metainfo/
|
||||
mkdir -p $(prefix)/share/icons/hicolor/64x64/apps/
|
||||
mkdir -p $(prefix)/share/icons/hicolor/128x128/apps/
|
||||
cp build/cowsrevenge $(prefix)/bin/
|
||||
cp linux_build/com.github.dariasteam.cowsrevenge.desktop $(prefix)/share/applications/
|
||||
cp linux_build/com.github.dariasteam.cowsrevenge.appdata.xml $(prefix)/share/metainfo/
|
||||
cp linux_build/cowsrevenge_icon_64.png $(prefix)/share/icons/hicolor/64x64/apps/com.github.dariasteam.cowsrevenge.png
|
||||
cp linux_build/cowsrevenge_icon_128.png $(prefix)/share/icons/hicolor/128x128/apps/com.github.dariasteam.cowsrevenge.png
|
||||
.PHONY: install
|
||||
install: build/cowsrevenge
|
||||
install -d $(DESTDIR)/$(prefix)/bin/
|
||||
install -d $(DESTDIR)/$(prefix)/share/applications/
|
||||
install -d $(DESTDIR)/$(prefix)/share/metainfo/
|
||||
install build/cowsrevenge $(DESTDIR)/$(prefix)/bin/
|
||||
install -m644 linux_build/com.github.dariasteam.cowsrevenge.desktop $(DESTDIR)/$(prefix)/share/applications/
|
||||
install linux_build/com.github.dariasteam.cowsrevenge.appdata.xml $(DESTDIR)/$(prefix)/share/metainfo/
|
||||
#install icon files
|
||||
$(foreach size,$(ICONSIZES),install -d $(DESTDIR)/$(prefix)/share/icons/hicolor/$(size)x$(size)/apps/;$(\n))
|
||||
$(foreach size,$(ICONSIZES),install -m644 linux_build/cowsrevenge_icon_$(size).png $(DESTDIR)/$(prefix)/share/icons/hicolor/$(size)x$(size)/apps/com.github.dariasteam.cowsrevenge.png;$(\n))
|
||||
#update databases if installed to system
|
||||
ifeq ($(DESTDIR),)
|
||||
-xdg-icon-resource forceupdate --mode system;
|
||||
-xdg-desktop-menu forceupdate --mode system;
|
||||
endif
|
||||
|
||||
.PHONY: uninstall
|
||||
uninstall: $(DESTDIR)/$(prefix)/bin/cowsrevenge
|
||||
rm $(DESTDIR)/$(prefix)/bin/cowsrevenge
|
||||
rm $(DESTDIR)/$(prefix)/share/applications/linux_build/com.github.dariasteam.cowsrevenge.desktop
|
||||
rm $(DESTDIR)/$(prefix)/share/metainfo/linux_build/com.github.dariasteam.cowsrevenge.appdata.xml
|
||||
#remove icon files
|
||||
$(foreach size,$(ICONSIZES),rm $(DESTDIR)/$(prefix)/share/icons/hicolor/$(size)x$(size)/apps/com.github.dariasteam.cowsrevenge.png;$(\n))
|
||||
#update databases if removed from system
|
||||
ifeq ($(DESTDIR),)
|
||||
-xdg-icon-resource forceupdate --mode system;
|
||||
-xdg-desktop-menu forceupdate --mode system;
|
||||
endif
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf build
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue