]> Lady’s Gitweb - Yseme/blobdiff - GNUmakefile
Only use utf-8-mac when iconv supports it
[Yseme] / GNUmakefile
index 8baaf0f9190e01eae193120e5646f5b14eea24b1..9f17dbc18454acaef788c291b135af4b7f97c19a 100644 (file)
@@ -3,18 +3,12 @@ SHELL = /bin/sh
 # © 2023–2024 Lady [@ Lady’s Computer].
 #
 # This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
-# If a copy of the MPL was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
-
-BUILDTARGET := .grass
-DESTDIR := .
-
-CLIENTCHARSET := utf-8-mac
-SERVER := computer
-SERVERCHARSET := utf-8
-SERVERPATH := $(notdir $(abspath .))
+# If a copy of the M·P·L was not distributed with this file, You can obtain one at <https://mozilla.org/MPL/2.0/>.
 
 AWK := awk
 ECHO := echo
+GREP := grep
+ICONV := iconv
 SED := sed
 TEST := test
 
@@ -29,6 +23,14 @@ RSYNCFILTER := .rsync-filter
 endif
 RSYNCOPTS := --checksum --compress --del --links --omit-dir-times --prune-empty-dirs --recursive --times --verbose
 
+BUILDTARGET := .grass
+DESTDIR := .
+
+CLIENTCHARSET := $(if $(shell $(ICONV) -l | $(GREP) -i 'utf-8-mac' - || true),utf-8-mac,utf-8)
+SERVER := computer
+SERVERCHARSET := utf-8
+SERVERPATH := $(notdir $(abspath .))
+
 override comma := ,
 
 ifneq ($(wildcard $(BUILDTARGET)),)
This page took 0.019893 seconds and 4 git commands to generate.