#	NetHack Makefile (VMS) - data files: special levels and other data.
#	NetHack 3.7	Makefile.dat	$NHDT-Date: 1596498300 2020/08/03 23:45:00 $	$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.12 $
# Copyright (c) 2015 by Mike Stephenson
# NetHack may be freely redistributed.  See license for details.

#  Copy this file to [.dat]Makefile.; no editing needed.

MAKE	= $(MMS)
CD	= set default
ECHO	= write sys$output
NOOP	= continue		# don't do anything interesting
RUN	= mcr			# simplest way to pass command line args
TOUCH	= append/New _NLA0:	# only one file per $(TOUCH)
# support directories, relative to each other and to 'src'
DAT = [-.dat]
UTL = [-.util]
WINSHR = [-.win.share]
WINX11 = [-.win.X11]
# utilities; must match Makefile.utl in spelling and punctuation
MAKEDEFS = $(UTL)makedefs.exe;
#LEVCOMP  = $(UTL)lev_comp.exe;
#DGNCOMP  = $(UTL)dgn_comp.exe;
DLB	 = $(UTL)dlb.exe;
TILE2X11 = $(UTL)tile2x11.exe;
UTILMARKER = $(UTL)util.timestamp;

# note: filespecs have enough punctuation to satisfy DELETE
#MARKERS = spec_levs.timestamp;,quest_levs.timestamp; 
VARDAT	= data.;,rumors.;,quest.dat;,oracles.;,options.;,\
	engrave.;,epitaph.;,bogusmon.;
#DUNGEON = dungeon.;
X11TILES= x11tiles.;
# note: the level lists need to be space separated for use as-is by $(LEVCOMP)
#QUESTLEVS = Arch.des Barb.des Caveman.des Healer.des Knight.des \
#	Monk.des Priest.des Ranger.des Rogue.des Samurai.des Tourist.des \
#	Valkyrie.des Wizard.des
#SPECLEVS  = bigroom.des castle.des endgame.des gehennom.des knox.des \
#	medusa.des mines.des oracle.des sokoban.des tower.des yendor.des

#all :	$(VARDAT) $(DUNGEON) $(MARKERS) $(DLB)
all :	$(VARDAT) $(DLB)
      @ $(ECHO) "data files are up to date."

# these are convenience targets for "manual" interactive use
#spec_levs :	spev_levs.timestamp
#      @ $(ECHO) "special levels are up to date."
#quest_levs :	quest_levs.timestamp
#      @ $(ECHO) "quest levels are up to date."
#dungeon :	$(DUNGEON)
#      @ $(ECHO) "dungeon is up to date."
data :		data.;
      @ $(NOOP)
rumors :	rumors.;
      @ $(NOOP)
quest.dat :	quest.dat;
      @ $(NOOP)
oracles :	oracles.;
      @ $(NOOP)
engrave :	engrave.;
      @ $(NOOP)
epitaph :	epitaph.;
      @ $(NOOP)
bogusmon :	bogusmon.;
      @ $(NOOP)
options :	options.;
      @ $(NOOP)
x11tiles :	$(X11TILES)
      @ $(NOOP)

$(MAKEDEFS) : $(UTILMARKER)
	$(CD) $(UTL)
	$(MAKE)$(MAKEFLAGS) $(MAKEDEFS)
      @ $(CD) $(DAT)

#$(DGNCOMP) : $(UTILMARKER)
#	$(CD) $(UTL)
#	$(MAKE)$(MAKEFLAGS) $(DGNCOMP)
#      @ $(CD) $(DAT)

#$(LEVCOMP) : $(UTILMARKER)
#	$(CD) $(UTL)
#	$(MAKE)$(MAKEFLAGS) $(LEVCOMP)
#      @ $(CD) $(DAT)

$(DLB) : $(UTILMARKER)
	$(CD) $(UTL)
	$(MAKE)$(MAKEFLAGS) $(DLB)
      @ $(CD) $(DAT)

$(TILE2X11) : $(UTILMARKER)
	$(CD) $(UTL)
	$(MAKE)$(MAKEFLAGS) $(TILE2X11)
      @ $(CD) $(DAT)

$(X11TILES) : $(TILE2X11) \
		$(WINSHR)monsters.txt $(WINSHR)objects.txt $(WINSHR)other.txt
	$(RUN) $(TILE2X11) \
		$(WINSHR)monsters.txt $(WINSHR)objects.txt $(WINSHR)other.txt

pet_mark.xbm : $(WINX11)pet_mark.xbm
	copy $(WINX11)pet_mark.xbm pet_mark.xbm

rip.xpm : $(WINX11)rip.xpm
	copy $(WINX11)rip.xpm rip.xpm


data.; :	data.base $(MAKEDEFS)
	$(RUN) $(MAKEDEFS) -d

rumors.; :	rumors.tru rumors.fal $(MAKEDEFS)
	$(RUN) $(MAKEDEFS) -r

engrave.; epitaph.; bogusmon.; : engrave.txt epitaph.txt bogusmon.txt
	$(RUN) $(MAKEDEFS) -s

quest.dat; :	quest.txt $(MAKEDEFS)
	$(RUN) $(MAKEDEFS) -q

oracles.; :	oracles.txt $(MAKEDEFS)
	$(RUN) $(MAKEDEFS) -h

# note: 'options' should have already been made when include/date.h was created
options.; :	$(MAKEDEFS)
	$(RUN) $(MAKEDEFS) -v

#spec_levs.timestamp; :	$(SPECLEVS) $(LEVCOMP)
#	$(RUN) $(LEVCOMP) $(SPECLEVS)
#	$(TOUCH) spec_levs.timestamp;

#quest_levs.timestamp; : $(QUESTLEVS) $(LEVCOMP)
#	$(RUN) $(LEVCOMP) $(QUESTLEVS)
#	$(TOUCH) quest_levs.timestamp;

#$(DUNGEON) :	dungeon.def $(MAKEDEFS) $(DGNCOMP)
#	$(RUN) $(MAKEDEFS) -e		!dungeon.def -> dungeon.pdf
#	$(RUN) $(DGNCOMP) dungeon.pdf	!dungeon.pdr -> dungeon

clean :
      - if f$search("*.*;-1").nes."" then  purge
#      - if f$search("dungeon.pdf").nes."" then	delete dungeon.pdf;
#      - if f$search("*.timestamp").nes."" then	delete $(MARKERS)

spotless :	clean
      - delete $(VARDAT)
#      - if f$search("$(DUNGEON)").nes."" then  delete $(DUNGEON)
#      - if f$search("*.lev").nes."" then  delete *.lev;
      - if f$search("$(X11TILES)").nes."" then  delete $(X11TILES)
      - if f$search("*.x%m").nes."" then  delete *.x%m;		!*.xbm,*.xpm
      - if f$search("nh*.dlb").nes."" then  delete nh*.dlb;
      - if f$search("nhdat.lst").nes."" then  delete nhdat.lst;
