Files
nethack/dat/luahelper
nhmall 20511564f7 utility to help maintain lua files on platform builds
Use by:

  make -f dat/luahelper [target]

  Target examples:

      Visual Studio nmake  : make -f dat/luahelper devhelp-nmake >file.txt

      msys2 GNUmakefile    : make -f dat/luahelper devhelp-msys >file.txt

      Xcode project.pbxproj: make -f dat/luahelper devhelp-xcode >file.txt

      all: generate txt files for all the above
2024-12-21 00:47:18 -05:00

81 lines
2.3 KiB
Plaintext

# NetHack 3.7 luahelper $NHDT-Date: $ $NHDT-Branch: NetHack-3.7 $
#
# Makefile to assist developers in adding lines to various build
# Makefiles, or project files, as lua files are added or removed.
# NetHack may be freely redistributed. See license for details.
#
# Must be run while your current directory is the top of the
# NetHack source tree.
#
# make -f dat/luahelper [target]
#
# Target examples:
#
# Visual Studio nmake : make -f dat/luahelper devhelp-nmake >file.txt
#
# MSYS2 GNUmakefile : make -f dat/luahelper devhelp-msys >file.txt
#
# Xcode project.pbxproj: make -f dat/luahelper devhelp-xcode >file.txt
#
#
luanames = asmodeus baalz bigrm-* castle fakewiz? juiblex knox medusa-? \
minend-? minefill minetn-? oracle orcus sanctum soko?-? tower? \
valley wizard? nhcore nhlib themerms astral air earth fire water \
hellfill tut-? ???-goal ???-fil? ???-loca ???-strt \
dungeon quest
alllua = $(wildcard $(addsuffix .lua,$(addprefix dat/, $(luanames))))
#
# generates lines to insert into
# sys/windows/Makefile.nmake
#
devhelp-nmake:
@echo "$(notdir $(alllua))" | \
awk '{for (i=1; i<=NF; ++i)printf "%s%s%s%s", \
i == 1? "ALL_LUA_FILES = " : "", \
"$$(DAT)\\", \
$$i, \
i % 3? " ": ((i == NF)? "\n" : " \\\n\t")} \
i % 3{print ""}'
@echo ""
#
# generates lines to insert into
# sys/windows/GNUmakefile
#
devhelp-msys2:
@echo "$(basename $(notdir $(alllua)))" | \
awk '{for (i=1; i<=NF; ++i)printf "%s%s%s", \
i == 1? "LUALIST = " : "", \
$$i, \
i % 5? " ": ((i == NF)? "\n" : " \\\n\t")} \
i % 5{print ""}'
@echo ""
xcodeextra = bogusmon cmdhelp data engrave epitaph help hh \
history keyhelp opthelp optmenu options oracles \
rumors tribute wizhelp
#
# generates lines to insert into
# sys/unix/NetHack.xcodeproj/project.pbxproj
#
devhelp-xcode:
@echo "\t\t\tinputPaths = ("
@echo "$(xcodeextra) $(notdir $(alllua))" | \
awk '{for (i=1; i<=NF; ++i)printf "%s%s%s%s%s", \
i == 1? "\t" : "", \
"\t\t\t\042$$(NH_DAT_DIR)/", \
$$i, \
"\042", \
i % 1? " ": ((i == NF)? "\n" : ",\n\t")} \
i % 1{print ""}'
@echo "\t\t\t);"
all:
make -f dat/luahelper devhelp-nmake >./luahelp-nmake.txt
make -f dat/luahelper devhelp-msys2 >./luahelp-msys2.txt
make -f dat/luahelper devhelp-xcode >./luahelp-xcode.txt
# end