From dcc65b24c7699b9f415e8eeb65dc241f8658811e Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 8 Oct 2023 03:05:11 +0300 Subject: [PATCH 65/65] Autotools: Execute generate_enums.py automatically See osdn #48806 Signed-off-by: Marko Lindqvist --- gen_headers/enums/.gitignore | 1 + gen_headers/enums/Makefile.am | 4 ++ gen_headers/enums/manual_enums_gen.h | 32 --------- gen_headers/enums/terrain_enums_gen.h | 93 --------------------------- 4 files changed, 5 insertions(+), 125 deletions(-) delete mode 100644 gen_headers/enums/manual_enums_gen.h delete mode 100644 gen_headers/enums/terrain_enums_gen.h diff --git a/gen_headers/enums/.gitignore b/gen_headers/enums/.gitignore index 10a7e8d6c7..e8f4a951c4 100644 --- a/gen_headers/enums/.gitignore +++ b/gen_headers/enums/.gitignore @@ -1 +1,2 @@ /Makefile.in +/*_enums_gen.h diff --git a/gen_headers/enums/Makefile.am b/gen_headers/enums/Makefile.am index 1c8a9a5e57..600456fa47 100644 --- a/gen_headers/enums/Makefile.am +++ b/gen_headers/enums/Makefile.am @@ -10,3 +10,7 @@ EXTRA_DIST = \ $(ENUMS_GEN) BUILT_SOURCES = $(ENUMS_GEN) + +$(ENUMS_GEN) : %_enums_gen.h: %_enums.def + @if ! $(AM_V_P) ; then echo " genenum $@" ; fi + $(AM_V_at) $(top_srcdir)/gen_headers/generate_enums.py $(srcdir)/$@ $< diff --git a/gen_headers/enums/manual_enums_gen.h b/gen_headers/enums/manual_enums_gen.h deleted file mode 100644 index 763426a558..0000000000 --- a/gen_headers/enums/manual_enums_gen.h +++ /dev/null @@ -1,32 +0,0 @@ - /************************************************************************** - * THIS FILE WAS GENERATED * - * Script: gen_headers/generate_enums.py * - * Input: gen_headers/enums/manual_enums.def * - * DO NOT CHANGE THIS FILE * - **************************************************************************/ - -#ifndef FC__MANUAL_ENUMS_GEN_H -#define FC__MANUAL_ENUMS_GEN_H - - -#define SPECENUM_NAME manuals -#define SPECENUM_VALUE0 MANUAL_SETTINGS -#define SPECENUM_VALUE0NAME "Settings" -#define SPECENUM_VALUE1 MANUAL_COMMANDS -#define SPECENUM_VALUE1NAME "Commands" -#define SPECENUM_VALUE2 MANUAL_TERRAIN -#define SPECENUM_VALUE2NAME "Terrain" -#define SPECENUM_VALUE3 MANUAL_BUILDINGS -#define SPECENUM_VALUE3NAME "Buildings" -#define SPECENUM_VALUE4 MANUAL_WONDERS -#define SPECENUM_VALUE4NAME "Wonders" -#define SPECENUM_VALUE5 MANUAL_GOVS -#define SPECENUM_VALUE5NAME "Governments" -#define SPECENUM_VALUE6 MANUAL_UNITS -#define SPECENUM_VALUE6NAME "Units" -#define SPECENUM_VALUE7 MANUAL_TECHS -#define SPECENUM_VALUE7NAME "Techs" -#define SPECENUM_COUNT MANUAL_COUNT -#include "specenum_gen.h" - -#endif /* FC__MANUAL_ENUMS_GEN_H */ diff --git a/gen_headers/enums/terrain_enums_gen.h b/gen_headers/enums/terrain_enums_gen.h deleted file mode 100644 index 7fb341afc8..0000000000 --- a/gen_headers/enums/terrain_enums_gen.h +++ /dev/null @@ -1,93 +0,0 @@ - /************************************************************************** - * THIS FILE WAS GENERATED * - * Script: gen_headers/generate_enums.py * - * Input: gen_headers/enums/terrain_enums.def * - * DO NOT CHANGE THIS FILE * - **************************************************************************/ - -#ifndef FC__TERRAIN_ENUMS_GEN_H -#define FC__TERRAIN_ENUMS_GEN_H - - -#define SPECENUM_NAME terrain_class -#define SPECENUM_VALUE0 TC_LAND -#define SPECENUM_VALUE0NAME N_("Land") -#define SPECENUM_VALUE1 TC_OCEAN -#define SPECENUM_VALUE1NAME N_("Oceanic") -#define SPECENUM_COUNT TC_COUNT -#include "specenum_gen.h" - -#define SPECENUM_NAME terrain_alteration -#define SPECENUM_VALUE0 TA_CAN_IRRIGATE -#define SPECENUM_VALUE0NAME N_("CanIrrigate") -#define SPECENUM_VALUE1 TA_CAN_MINE -#define SPECENUM_VALUE1NAME N_("CanMine") -#define SPECENUM_VALUE2 TA_CAN_ROAD -#define SPECENUM_VALUE2NAME N_("CanRoad") -#define SPECENUM_VALUE3 TA_CAN_BASE -#define SPECENUM_VALUE3NAME N_("CanBase") -#define SPECENUM_VALUE4 TA_CAN_PLACE -#define SPECENUM_VALUE4NAME N_("CanPlace") -#define SPECENUM_COUNT TA_COUNT -#include "specenum_gen.h" - -#define SPECENUM_NAME terrain_flag_id -#define SPECENUM_VALUE0 TER_NO_BARBS -#define SPECENUM_VALUE0NAME N_("NoBarbs") -#define SPECENUM_VALUE1 TER_NO_CITIES -#define SPECENUM_VALUE1NAME N_("NoCities") -#define SPECENUM_VALUE2 TER_STARTER -#define SPECENUM_VALUE2NAME N_("Starter") -#define SPECENUM_VALUE3 TER_CAN_HAVE_RIVER -#define SPECENUM_VALUE3NAME N_("CanHaveRiver") -#define SPECENUM_VALUE4 TER_UNSAFE_COAST -#define SPECENUM_VALUE4NAME N_("UnsafeCoast") -#define SPECENUM_VALUE5 TER_FRESHWATER -#define SPECENUM_VALUE5NAME N_("FreshWater") -#define SPECENUM_VALUE6 TER_NOT_GENERATED -#define SPECENUM_VALUE6NAME N_("NotGenerated") -#define SPECENUM_VALUE7 TER_NO_ZOC -#define SPECENUM_VALUE7NAME N_("NoZoc") -#define SPECENUM_VALUE8 TER_ENTER_BORDERS -#define SPECENUM_VALUE8NAME N_("EnterBorders") -#define SPECENUM_VALUE9 TER_FROZEN -#define SPECENUM_VALUE9NAME N_("Frozen") -#define SPECENUM_VALUE10 TER_USER_1 -#define SPECENUM_VALUE11 TER_USER_2 -#define SPECENUM_VALUE12 TER_USER_3 -#define SPECENUM_VALUE13 TER_USER_4 -#define SPECENUM_VALUE14 TER_USER_5 -#define SPECENUM_VALUE15 TER_USER_6 -#define SPECENUM_VALUE16 TER_USER_7 -#define SPECENUM_VALUE17 TER_USER_8 -#define SPECENUM_VALUE18 TER_USER_9 -#define SPECENUM_VALUE19 TER_USER_LAST -#define SPECENUM_NAMEOVERRIDE -#define SPECENUM_BITVECTOR bv_terrain_flags -#include "specenum_gen.h" - -#define SPECENUM_NAME mapgen_terrain_property -#define SPECENUM_VALUE0 MG_MOUNTAINOUS -#define SPECENUM_VALUE0NAME "mountainous" -#define SPECENUM_VALUE1 MG_GREEN -#define SPECENUM_VALUE1NAME "green" -#define SPECENUM_VALUE2 MG_FOLIAGE -#define SPECENUM_VALUE2NAME "foliage" -#define SPECENUM_VALUE3 MG_TROPICAL -#define SPECENUM_VALUE3NAME "tropical" -#define SPECENUM_VALUE4 MG_TEMPERATE -#define SPECENUM_VALUE4NAME "temperate" -#define SPECENUM_VALUE5 MG_COLD -#define SPECENUM_VALUE5NAME "cold" -#define SPECENUM_VALUE6 MG_FROZEN -#define SPECENUM_VALUE6NAME "frozen" -#define SPECENUM_VALUE7 MG_WET -#define SPECENUM_VALUE7NAME "wet" -#define SPECENUM_VALUE8 MG_DRY -#define SPECENUM_VALUE8NAME "dry" -#define SPECENUM_VALUE9 MG_OCEAN_DEPTH -#define SPECENUM_VALUE9NAME "ocean_depth" -#define SPECENUM_COUNT MG_COUNT -#include "specenum_gen.h" - -#endif /* FC__TERRAIN_ENUMS_GEN_H */ -- 2.40.1