From bf0172b7e6391aa1345a0e8add0b622d08e0053b Mon Sep 17 00:00:00 2001 From: Louie S Date: Sun, 26 Feb 2023 22:13:31 -0800 Subject: Added rule for generating desktop entry --- Makefile.am | 4 ++-- Makefile.in | 4 ++-- data/Makefile.am | 14 ++++++++++++++ data/Makefile.in | 30 +++++++++++++++++++++++++----- docs/Makefile.am | 2 +- docs/Makefile.in | 2 +- 6 files changed, 45 insertions(+), 11 deletions(-) diff --git a/Makefile.am b/Makefile.am index e0d5f78..affd11c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ SUBDIRS = src docs data dist_man_MANS = man -man1_MANS = man/terminal-media-launcher.1 -man5_MANS = man/terminal-media-launcher-config.5 +man1_MANS = man/$(PACKAGE_NAME).1 +man5_MANS = man/$(PACKAGE_NAME)-config.5 diff --git a/Makefile.in b/Makefile.in index c0ffd0d..926f785 100644 --- a/Makefile.in +++ b/Makefile.in @@ -336,8 +336,8 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ SUBDIRS = src docs data dist_man_MANS = man -man1_MANS = man/terminal-media-launcher.1 -man5_MANS = man/terminal-media-launcher-config.5 +man1_MANS = man/$(PACKAGE_NAME).1 +man5_MANS = man/$(PACKAGE_NAME)-config.5 all: all-recursive .SUFFIXES: diff --git a/data/Makefile.am b/data/Makefile.am index adb970f..e6fb158 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1 +1,15 @@ EXTRA_DIST = icon.ico icon.svg + +# Build a .desktop entry +BUILT_SOURCES = $(PACKAGE_NAME).desktop +CLEANFILES = $(PACKAGE_NAME).desktop +$(PACKAGE_NAME).desktop: Makefile + echo "[Desktop Entry]" > $@ + echo "Type=Application" >> $@ + echo "Name=$(PACKAGE_NAME)" >> $@ + echo "Comment=Terminal Media Launcher" >> $@ + echo "Path=$(bindir)/$(PACKAGE_NAME)$(EXEEXT)" >> $@ + echo "Exec=$(PACKAGE_NAME)$(EXEEXT)" >> $@ + echo "Icon=$(PACKAGE_NAME)" >> $@ + echo "Terminal=true" >> $@ + echo "Categories=Utility" >> $@ diff --git a/data/Makefile.in b/data/Makefile.in index 9b34865..dbd0a88 100644 --- a/data/Makefile.in +++ b/data/Makefile.in @@ -220,7 +220,12 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = icon.ico icon.svg -all: all-am + +# Build a .desktop entry +BUILT_SOURCES = $(PACKAGE_NAME).desktop +CLEANFILES = $(PACKAGE_NAME).desktop +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @@ -293,11 +298,14 @@ distdir-am: $(DISTFILES) fi; \ done check-am: all-am -check: check-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile installdirs: -install: install-am -install-exec: install-exec-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -318,6 +326,7 @@ install-strip: mostlyclean-generic: clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) @@ -326,6 +335,7 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-generic mostlyclean-am @@ -392,7 +402,7 @@ ps-am: uninstall-am: -.MAKE: install-am install-strip +.MAKE: all check install install-am install-exec install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ @@ -407,6 +417,16 @@ uninstall-am: .PRECIOUS: Makefile +$(PACKAGE_NAME).desktop: Makefile + echo "[Desktop Entry]" > $@ + echo "Type=Application" >> $@ + echo "Name=$(PACKAGE_NAME)" >> $@ + echo "Comment=Terminal Media Launcher" >> $@ + echo "Path=$(bindir)/$(PACKAGE_NAME)$(EXEEXT)" >> $@ + echo "Exec=$(PACKAGE_NAME)$(EXEEXT)" >> $@ + echo "Icon=$(PACKAGE_NAME)" >> $@ + echo "Terminal=true" >> $@ + echo "Categories=Utility" >> $@ # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --git a/docs/Makefile.am b/docs/Makefile.am index 0ebcbdb..bf901b2 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1 +1 @@ -dist_doc_DATA = README.md screenshot1.png screenshot2.png terminal-media-launcher-config.md windows_compile_instructions.md +dist_doc_DATA = README.md screenshot1.png screenshot2.png $(PACKAGE_NAME)-config.md windows_compile_instructions.md diff --git a/docs/Makefile.in b/docs/Makefile.in index 4c36ed7..62c84cf 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -250,7 +250,7 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -dist_doc_DATA = README.md screenshot1.png screenshot2.png terminal-media-launcher-config.md windows_compile_instructions.md +dist_doc_DATA = README.md screenshot1.png screenshot2.png $(PACKAGE_NAME)-config.md windows_compile_instructions.md all: all-am .SUFFIXES: -- cgit