# Makefrag - makefile fragment for hack
#
# Copyright (c) 2000 Joseph Samuel Myers.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. The name of the author may not be used to endorse or promote products
#    derived from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.

hack_DIRS := $(GAMESDIR) $(MAN6DIR)

hack_CLEANFILES := hack.onames.h

hack_all:	hack/hack hack/hack.6

hack/hack.onames.h:	hack/def.objects.h hack/makedefs
	hack/makedefs $< >$@

hack/alloc.d hack/hack.Decl.d hack/hack.apply.d hack/hack.bones.d \
hack/hack.d hack/hack.cmd.d hack/hack.do.d hack/hack.do_name.d \
hack/hack.do_wear.d hack/hack.dog.d hack/hack.eat.d hack/hack.end.d \
hack/hack.engrave.d hack/hack.fight.d hack/hack.invent.d \
hack/hack.ioctl.d hack/hack.lev.d hack/hack.main.d hack/hack.makemon.d \
hack/hack.mhitu.d hack/hack.mklev.d hack/hack.mkmaze.d \
hack/hack.mkobj.d hack/hack.mkshop.d hack/hack.mon.d hack/hack.monst.d \
hack/hack.o_init.d hack/hack.objnam.d hack/hack.options.d \
hack/hack.pager.d hack/hack.potion.d hack/hack.pri.d hack/hack.read.d \
hack/hack.rip.d hack/hack.rumors.d hack/hack.save.d hack/hack.search.d \
hack/hack.shk.d hack/hack.shknam.d hack/hack.steal.d \
hack/hack.termcap.d hack/hack.timeout.d hack/hack.topl.d \
hack/hack.track.d hack/hack.trap.d hack/hack.tty.d hack/hack.u_init.d \
hack/hack.unix.d hack/hack.vault.d hack/hack.version.d \
hack/hack.wield.d hack/hack.wizard.d hack/hack.worm.d hack/hack.worn.d \
hack/hack.zap.d hack/rnd.d:	hack/hack.onames.h

hack_install:	hack_all
	$(INSTALL_SCORE_GAME) hack/hack $(INSTALL_PREFIX)$(GAMESDIR)/hack
	$(HIDE_GAME) hack
	$(INSTALL_HACK_DIR) $(INSTALL_PREFIX)$(HACK_DIR)
	install -d $(INSTALL_PREFIX)/usr/share/games/bsdgames/hack
	set -e; for f in data help hh rumors; do $(INSTALL_DATA) hack/$$f $(INSTALL_PREFIX)/usr/share/games/bsdgames/hack/$$f; done
	$(INSTALL_SCORE_FILE) $(HACK_DIR)/perm
	$(INSTALL_SCORE_FILE) $(HACK_DIR)/record
	$(INSTALL_MANUAL) hack/hack.6
