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
This commit is contained in:
80
dat/luahelper
Normal file
80
dat/luahelper
Normal file
@@ -0,0 +1,80 @@
|
||||
# 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
|
||||
Reference in New Issue
Block a user