diff Makefile.am @ 241:06d6c351925c

*: reorganize resources, +docs, build translations with autotools
author Paper <paper@paper.us.eu.org>
date Mon, 22 Jan 2024 16:36:19 -0500
parents a7d0d543b334
children 82470f83f0c2
line wrap: on
line diff
--- a/Makefile.am	Fri Jan 19 13:47:56 2024 -0500
+++ b/Makefile.am	Mon Jan 22 16:36:19 2024 -0500
@@ -1,9 +1,33 @@
 bin_PROGRAMS = minori
 
+minori_locale_ts = \
+	rc/locale/en_GB.ts \
+	rc/locale/es.ts
+
+.ts.qm:
+	@MKDIR_P@ `dirname $@`; \
+	@QT_LRELEASE@ $< -qm $@
+
+minori_locale_qm = $(minori_locale_ts:.ts=.qm)
+
+# this has to be in the root build folder
+translations.qrc: $(minori_locale_qm)
+	printf "<!DOCTYPE rcc><RCC version=\"1.0\">\n\t<qresource prefix=\"locale/\">\n" > $@; \
+	for q in $(minori_locale_qm); do \
+		printf "\t\t<file alias=\"%s\">%s</file>\n" "`basename $$q`" "$$q" >> $@; \
+	done; \
+	printf "\t</qresource>\n</RCC>\n" >> $@;
+
 minori_qtrc = \
-	$(top_srcdir)/rc/dark.qrc	\
-	$(top_srcdir)/rc/icons.qrc	\
-	$(top_srcdir)/rc/player_data.qrc
+	$(top_srcdir)/rc/icons/icons.qrc	\
+	$(top_srcdir)/rc/player_data.qrc	\
+	translations.qrc
+
+if BUILD_WIN
+
+minori_qtrc += $(top_srcdir)/rc/win32/dark/dark.qrc
+
+endif
 
 rc/final_qrc.cc: $(minori_qtrc)
 	@QT_RCC@ -o $@ $(minori_qtrc)
@@ -152,6 +176,6 @@
 	@MKDIR_P@ -- `dirname $@`
 	@QT_MOC@ -o $@ $(minori_includes) $<
 
-SUFFIXES = .h _moc.cc
+SUFFIXES = .h _moc.cc .ts .qm
 SUBDIRS = $(subdirs)
 ACLOCAL_AMFLAGS = -I m4