Skip to content

Commit

Permalink
Merge pull request #119 from erdii/makefile-split-install-target
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz authored Sep 26, 2023
2 parents 6dae674 + 3e713d4 commit 9f17dc7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ PREFIX ?= /usr

debug:
go build -tags no_emoji -trimpath -o $(NAME)
.PHONY: debug

release:
go build -tags no_emoji -trimpath -ldflags="-s -w" -buildvcs=false -o $(NAME)
.PHONY: release

install:
# You'll maybe want to update your gtk icon cache by running `make update-icon-cache` afterwards.
install -Dm00755 $(NAME) $(DESTDIR)$(PREFIX)/bin/$(NAME)
install -Dm00644 internal/assets/icons/icon-512.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/512x512/apps/$(APPID).png
install -Dm00644 internal/assets/icons/icon-256.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/$(APPID).png
Expand All @@ -23,7 +26,12 @@ install:
install -Dm00644 internal/assets/svg/icon.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/$(APPID).svg
install -Dm00644 internal/assets/unix/$(APPID).desktop $(DESTDIR)$(PREFIX)/share/applications/$(APPID).desktop
install -Dm00644 internal/assets/unix/$(APPID).appdata.xml $(DESTDIR)$(PREFIX)/share/appdata/$(APPID).appdata.xml
.PHONY: install

update-icon-cache:
sudo gtk-update-icon-cache -f /usr/share/icons/hicolor/
.PHONY: update-icon-cache


uninstall:
-rm $(DESTDIR)$(PREFIX)/bin/$(NAME)
Expand All @@ -38,3 +46,4 @@ uninstall:
-rm $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/$(APPID).svg
-rm $(DESTDIR)$(PREFIX)/share/applications/$(APPID).desktop
-rm $(DESTDIR)$(PREFIX)/share/appdata/$(APPID).appdata.xml
.PHONY: uninstall

0 comments on commit 9f17dc7

Please sign in to comment.