diff --git a/Makefile b/Makefile index 165b670..61f3d36 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,8 @@ CC ?= clang CXX ?= clang++ CFLAGS ?= -O2 -Wall -Wextra -std=c++11 PREFIX ?= /usr/local/bin -APPFOLDER ?= /usr/share/applications +APPDIR ?= /usr/share/applications +ICONDIR ?= /usr/share/icons/hicolor .PHONY: default default: tv_rename @@ -20,10 +21,22 @@ install: tv_rename install_gui: gui install -d $(PREFIX)/ install -m 755 tv_rename_gui $(PREFIX)/ - cat tv_rename.desktop | sed "s/\$$PWD/$$(pwd | sed 's/\//\\\//g')/" > temp.desktop - chmod +x temp.desktop - install -d $(APPFOLDER) - mv temp.desktop $(APPFOLDER)/tv_rename.desktop + install -d $(APPDIR) + install -m 755 tv_rename_gui.desktop $(APPDIR)/ + install -d $(ICONDIR) + install -m 644 tv_rename.svg $(ICONDIR)/scalable/apps/ + gtk-update-icon-cache -f $(ICONDIR) + +.PHONY: uninstall +uninstall: + rm $(PREFIX)/tv_rename + +.PHONY: uninstall_gui +uninstall_gui: + rm $(PREFIX)/tv_rename_gui + rm $(APPDIR)/tv_rename_gui.desktop + rm $(ICONDIR)/scalable/apps/tv_rename.svg + gtk-update-icon-cache -f $(ICONDIR) tv_rename: functions.o filesystem_u.o network.o tv_rename.o main.cpp $(CXX) $(CFLAGS) -o tv_rename main.cpp tv_rename.o functions.o filesystem_u.o network.o -lcurl diff --git a/tv_rename.desktop b/tv_rename_gui.desktop similarity index 73% rename from tv_rename.desktop rename to tv_rename_gui.desktop index 6b28f51..c930d03 100755 --- a/tv_rename.desktop +++ b/tv_rename_gui.desktop @@ -1,4 +1,3 @@ -#!/usr/bin/env xdg-open [Desktop Entry] Encoding=UTF-8 Value=1.0 @@ -6,5 +5,5 @@ Type=Application Name=TV Rename GenericName=TV Rename Comment=TV Rename -Icon=$PWD/tv_rename.svg +Icon=tv_rename Exec=tv_rename_gui