1# vi: set ts=8:
2#
3# Copyright (C) 2003-2008  Simon Baldwin and Mark J. Tilford
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of version 2 of the GNU General Public License
7# as published by the Free Software Foundation.
8#
9# This program is distributed in the hope that it will be useful,
10# but WITHOUT ANY WARRANTY; without even the implied warranty of
11# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12# GNU General Public License for more details.
13#
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
17# USA
18#
19
20VERSION = 1.3.10
21
22# Miscellaneous tools, overridable by the command line.
23ZIP	= zip
24RM	= rm
25CP	= cp
26LN	= ln
27TAR	= tar
28
29# Default make target is the basic ANSI interpreter.
30all:	scare
31
32# Pass-through build targets.
33clean distclean scare glkscare scare-$(VERSION).so sx:
34	cd source; $(MAKE) $@
35
36# Build SCARE's self-test and run it.
37check test: sx
38	source/sx \
39	test/sccore test/scdebug test/scevents test/sclogic		\
40	test/scmaths test/scnpcs test/scprintf test/screstrs		\
41	test/scstring test/sctasks test/scvars test/scrooms		\
42	test/hamper test/humbug test/darkwoods test/akron test/wrecked
43
44# Cleanup.
45maintainer-clean: clean
46	$(RM) -f scare-$(VERSION).zip scare-$(VERSION)_linux.tgz
47
48clobber allclean: maintainer-clean
49
50# Build the SCARE distributions.
51linux-dist:
52	$(MAKE) maintainer-clean
53	cd source; $(MAKE) 'CEXTRA=-DLINUX_GRAPHICS'			\
54	  scare glkscare scare-$(VERSION).so
55	cd source; $(CP) scare glkscare scare-$(VERSION).so ..
56	cd doc; $(CP) RUNNING ..
57	$(TAR) zcvf scare-$(VERSION)_linux.tgz				\
58	  scare glkscare scare-$(VERSION).so				\
59	  ChangeLog README COPYING RUNNING
60	$(RM) -f scare glkscare scare-$(VERSION).so RUNNING
61
62source-dist:
63	$(MAKE) clean
64	$(LN) -s . scare-$(VERSION)
65	$(ZIP) -9 scare-$(VERSION).zip					\
66	  scare-$(VERSION)/ChangeLog scare-$(VERSION)/COPYING		\
67	  scare-$(VERSION)/Makefile scare-$(VERSION)/README		\
68	  scare-$(VERSION)/source/* scare-$(VERSION)/test/*		\
69	  scare-$(VERSION)/doc/*
70	$(RM) -f scare-$(VERSION)
71
72dist: linux-dist source-dist
73
74