Debian Codegraph @

terps/scare/Makefile

raw symbols SCIP
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
20 VERSION = 1.3.10
21
22 #
23 # Compiler and Glk library setup. Configure this section to match the
24 # system you're using to build SCARE, or override with VARIABLE= on the
25 # make command line.
26 #
27
28 # GCC compiler and linker flags.
29 CC = gcc
30 DEBUG =
31 CEXTRA =
32 CFLAGS = -O2 -D__NO_STRING_INLINES -fPIC -ansi -D_STRICT_ANSI_ -Wall -W \
33 -pedantic -Wshadow -Wpointer-arith -Wstrict-prototypes \
34 -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls \
35 -Wwrite-strings -Wundef -Wbad-function-cast -Waggregate-return \
36 -Wnested-externs \
37 $(DEBUG) $(CEXTRA)
38 LDLIBS =
39 LDEXTRA =
40 LDFLAGS = $(DEBUG) $(LDEXTRA)
41
42 # Generic compiler and linker flags.
43 #CC = cc
44 #DEBUG =
45 #CEXTRA =
46 #CFLAGS =
47 #LDLIBS =
48 #LDEXTRA=
49 #LDFLAGS=
50
51 # Glk library selection and library location.
52 GLK = xglk
53 #GLK = glkterm
54 #GLK = cheapglk
55 #GLK = winglk
56 GLKDIR = ../..
57
58 # Glk platform selection; normally, the platform's compiler will define
59 # one of these automatically, but if not, pick one to suit your system.
60 #GLKARCH= -D__unix
61 #GLKARCH= -D_WIN32
62
63 #
64 # End of compiler and Glk library set. The rest of the Makefile is SCARE
65 # generic.
66 #
67
68 # Set up link libraries and path to Glk. The Glk library make inclusion
69 # sets up LINKLIBS and GLKLIB for us; if the file is missing (say, we're
70 # building only the ANSI interface version), the include should not fail.
71 # This will of course make GLKLIBS gibberish, but we'll check that later.
72 # If your make can't handle sinclude or -include, and you're not building
73 # for Glk, comment out the include line.
74 GLKPATH = $(GLKDIR)/$(GLK)
75 sinclude $(GLKPATH)/Make.$(GLK)
76 GLKLIBS = -L$(GLKPATH) $(GLKLIB) $(LINKLIBS)
77
78 # Always use the Bourne shell.
79 SHELL = /bin/sh
80
81 # Miscellaneous tools, overridable by the command line.
82 UNZIP = unzip
83 RM = rm
84 TEST = test
85
86 # SCARE objects and headers.
87 OBJECTS = sctafpar.o sctaffil.o scprops.o scvars.o scexpr.o scprintf.o \
88 scinterf.o scparser.o sclibrar.o scrunner.o scevents.o \
89 scnpcs.o scobjcts.o sctasks.o screstrs.o scgamest.o scserial.o\
90 scresour.o scmemos.o scutils.o sclocale.o scdebug.o
91 HEADERS = scare.h scprotos.h scgamest.h
92
93 # SCARE verifier objects and headers.
94 XOBJECTS= sxmain.o sxutils.o sxglob.o sxtester.o sxscript.o sxfile.o \
95 sxstubs.o
96 XHEADERS= sxprotos.h
97
98 # Zlib components used by SCARE.
99 ZLIBVER = 123
100 ZLIBSRC = zlib$(ZLIBVER).zip
101 ZOBJECTS= crc32.o inffast.o inflate.o inftrees.o zutil.o compress.o \
102 adler32.o deflate.o trees.o
103 ZSOURCES= crc32.c inffast.c inflate.c inftrees.c zutil.c compress.c \
104 adler32.c deflate.c trees.c
105 ZHEADERS= crc32.h inffast.h inflate.h inftrees.h inffixed.h zutil.h \
106 zconf.h deflate.h trees.h zlib.h
107
108 # Default make target is the basic ANSI interpreter.
109 all: scare
110
111 $(ZOBJECTS): $(ZHEADERS) $(ZSOURCES)
112
113 $(ZHEADERS) $(ZSOURCES): $(ZLIBSRC)
114 @$(UNZIP) -uqqa $(ZLIBSRC) $@
115
116 $(OBJECTS): $(HEADERS)
117
118 scare: $(ZOBJECTS) $(OBJECTS) os_ansi.o
119 $(CC) $(LDFLAGS) -o scare $(OBJECTS) $(ZOBJECTS) os_ansi.o $(LDLIBS)
120
121 # Option to build the SCARE verifier.
122 $(XOBJECTS): $(XHEADERS)
123
124 sx: $(ZOBJECTS) $(OBJECTS) $(XOBJECTS)
125 $(CC) $(LDFLAGS) -o sx $(OBJECTS) $(ZOBJECTS) $(XOBJECTS) $(LDLIBS)
126
127 # Option to build the Glk port of SCARE.
128 glkscare: $(ZOBJECTS) $(OBJECTS) os_glk.o
129 @$(TEST) -n "$(GLKLIB)" \
130 || ( echo "Could not include $(GLKPATH)/Make.$(GLK)"; exit 1 )
131 $(CC) $(LDFLAGS) -o glkscare $(OBJECTS) $(ZOBJECTS) os_glk.o \
132 $(LDLIBS) $(GLKLIBS)
133
134 os_glk.o: os_glk.c $(HEADERS)
135 $(CC) $(GLKARCH) $(CFLAGS) -Wno-write-strings \
136 -I $(GLKDIR)/$(GLK) -c -o $@ $<
137
138 # Option to build an IFP plugin version of SCARE.
139 scare_plugin.c: scare.hdr
140 ifphdr $< >$@
141
142 scare_plugin.o: scare_plugin.c
143 @$(TEST) -n "$(GLKLIB)" \
144 || ( echo "Could not include $(GLKPATH)/Make.$(GLK)"; exit 1 )
145 $(CC) -I$(GLKPATH) $(CFLAGS) -c -o $@ $<
146
147 PLUGIN_LIBS = -lifppi
148 PLUGIN_OBJS = scare_plugin.o
149 scare-$(VERSION).so: $(ZOBJECTS) $(OBJECTS) os_glk.o $(PLUGIN_OBJS)
150 $(CC) -shared -Wl,-u,ifpi_force_link -Wl,-Bsymbolic \
151 -o $@ $(ZOBJECTS) $(OBJECTS) os_glk.o $(PLUGIN_OBJS) \
152 $(PLUGIN_LIBS) -lc
153
154 # Cleanup.
155 clean:
156 $(RM) -f scare sx glkscare *.o core core.* *.gcov *.gcno *.gcda
157 $(RM) -f scare_plugin.c scare-$(VERSION).so
158 $(RM) -f $(ZSOURCES)
159 $(RM) -f $(ZHEADERS)
160
161 distclean: clean
162
163 clobber: clean
164
165 maintainer-clean: clobber
166
167 # Unimplemented targets.
168 dist check:
169