From 32576fa8d4d44627e730d6c9ae28e37191404082 Mon Sep 17 00:00:00 2001 From: Juhani Krekelä Date: Sat, 26 Jun 2021 21:56:41 +0300 Subject: Build localization files when running `make all` Currently these localization files are only built when the user executes `make install`. Since `make install` is often run as root, this leaves files with root as their owner in the source directory. There are also security implications to running compilers as root. This patch adds a target `all` to the Makefile which depends on the localization files, so that they are built as the user. --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4be1213..d00146a 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,8 @@ VALAC ?= valac POFILES := $(wildcard po/*.po) MOFILES := $(POFILES:.po=.mo) +all: weltschmerz weltschmerz.1 weltschmerz.desktop $(MOFILES) + weltschmerz: weltschmerz.vala terminal.vala config.vala configreader.vala utils.vala resources.c ${VALAC} -X -DGETTEXT_PACKAGE=\"weltschmerz\" -X -DLOCALEDIR="\"${LOCALEDIR}\"" \ -X -lm --pkg posix --pkg gtk+-3.0 --pkg vte-2.91 --gresources resources.xml \ @@ -23,7 +25,7 @@ resources.c: resources.xml terminal.ui terminal.css weltschmerz.desktop: weltschmerz.desktop.in msgfmt --desktop -d po --template $< -o $@ -install: weltschmerz weltschmerz.1 weltschmerz.desktop $(MOFILES) +install: all install -D -m 755 -t '${DESTDIR}${BINDIR}' weltschmerz install -D -m 644 -t '${DESTDIR}${MANDIR}/man1' weltschmerz.1 install -D -m 644 -t '${DESTDIR}${DATAROOTDIR}/applications' weltschmerz.desktop @@ -36,4 +38,4 @@ clean: rm -f weltschmerz weltschmerz.desktop resources.c rm -f po/*.mo -.PHONY: install clean +.PHONY: install clean all -- cgit v1.2.3-2-gb3c3