From 69a51480b10a002cb96ad2a4bec92a437ab738fe Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Thu, 17 Jun 2021 00:29:59 +0300 Subject: [PATCH 52/52] Meson: Generate langstat_core.txt See osdn #42543 Signed-off-by: Marko Lindqvist --- bootstrap/Makefile.am | 6 +++--- bootstrap/generate_langstat.sh | 12 ++++++------ meson.build | 4 ++++ 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/bootstrap/Makefile.am b/bootstrap/Makefile.am index da1e43d2b7..702d79dbba 100644 --- a/bootstrap/Makefile.am +++ b/bootstrap/Makefile.am @@ -37,13 +37,13 @@ EXTRA_DIST = freeciv.project \ langnames.txt langstat_core.txt: - "$(top_srcdir)/bootstrap/generate_langstat.sh" core "$(top_srcdir)" "$(top_builddir)" + "$(top_srcdir)/bootstrap/generate_langstat.sh" core "$(top_srcdir)" "$(top_builddir)/bootstrap" langstat_nations.txt: - "$(top_srcdir)/bootstrap/generate_langstat.sh" nations "$(top_srcdir)" "$(top_builddir)" + "$(top_srcdir)/bootstrap/generate_langstat.sh" nations "$(top_srcdir)" "$(top_builddir)/bootstrap" langstat_ruledit.txt: - "$(top_srcdir)/bootstrap/generate_langstat.sh" ruledit "$(top_srcdir)" "$(top_builddir)" + "$(top_srcdir)/bootstrap/generate_langstat.sh" ruledit "$(top_srcdir)" "$(top_builddir)/bootstrap" .PHONY: langstat_core.txt langstat_nations.txt langstat_ruledit.txt diff --git a/bootstrap/generate_langstat.sh b/bootstrap/generate_langstat.sh index d3b964f7ee..deaaf6a2cb 100755 --- a/bootstrap/generate_langstat.sh +++ b/bootstrap/generate_langstat.sh @@ -1,5 +1,5 @@ #!/bin/bash -#/********************************************************************** +#/*********************************************************************** # Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -14,7 +14,7 @@ #***********************************************************************/ if test "x$1" = "x-h" || test "x$1" = "x--help" || test "x$1" = "x" ; then - echo "Usage: $(basename $0) " + echo "Usage: $(basename $0) " exit fi @@ -22,11 +22,11 @@ fi while read CODE PRCT ; do NLANG=$(grep "^$CODE " "$2/bootstrap/langnames.txt" 2>/dev/null | sed "s/$CODE //") echo "$CODE $PRCT $NLANG" - done ) > "$3/bootstrap/langstat_${1}.txt.tmp" + done ) > "$3/langstat_${1}.txt.tmp" if ! test -f "$2/bootstrap/langstat_${1}.txt" || - ! cmp "$2/bootstrap/langstat_${1}.txt" "$3/bootstrap/langstat_${1}.txt.tmp" ; then - mv "$3/bootstrap/langstat_${1}.txt.tmp" "$2/bootstrap/langstat_${1}.txt" + ! cmp "$2/bootstrap/langstat_${1}.txt" "$3/langstat_${1}.txt.tmp" ; then + mv "$3/langstat_${1}.txt.tmp" "$2/bootstrap/langstat_${1}.txt" else - rm -f "$3/bootstrap/langstat_${1}.txt.tmp" + rm -f "$3/langstat_${1}.txt.tmp" fi diff --git a/meson.build b/meson.build index b362612dfb..d6c1e1e664 100644 --- a/meson.build +++ b/meson.build @@ -395,6 +395,10 @@ verhdr = custom_target('verhdr', output: 'version_gen.h', command: ['sh', files('gen_headers/generate_version_header.sh'), '@OUTPUT@'], depend_files: files('fc_version')) +ls_core = custom_target('langstat_core', output: 'langstat_core.txt', + command: ['sh', files('bootstrap/generate_langstat.sh'), 'core', + meson.source_root(), meson.build_root()]) + specenum = custom_target('specenum_gen.h', output: 'specenum_gen.h', command: ['python3', files('utility/generate_specenum.py'), '@OUTPUT@']) -- 2.30.2