added NO_TEST_RUNS flag to skip running any tests.
[feisty_meow.git] / scripts / clam / variables.def
1
2 # CLAM System default variable definitions.
3
4 ###############################################################################
5
6 # This file contains definitions and descriptions of the variables used
7 # in the CLAM system (Coordinated Library Automagic Make).  This defaults
8 # file should be included near the start of the user's makefile, and then the
9 # rules file should be included after the user has modified the appropriate
10 # variables and added the appropriate rules and targets.
11
12 ###############################################################################
13
14 # OP_SYSTEM is a flag that specifies the operating system under which
15 # the makefile system is executing.
16 export OP_SYSTEM
17 #OP_SYSTEM := UNIX = unix | OS2 = ibm os/2 | SYSV = v unix | DOS = pc dos
18 #    | WIN32 = ms-win32 / NT.
19
20 # OS_SUBCLASS is a finer differentiation of the OP_SYSTEM.  currently only
21 # the darwin subclass for unix is considered.
22 export OS_SUBCLASS
23 #OS_SUBCLASS := darwin | 
24
25 # set the default operating system when none is specified.
26 ifeq "$(OP_SYSTEM)" ""
27 #is there a nice way to join the greps?
28   IS_UNIX := $(shell uname | grep -i linux)
29   ifeq "$(IS_UNIX)" ""
30     IS_UNIX := $(shell uname | grep -i unix)
31     ifeq "$(IS_UNIX)" "" 
32       IS_UNIX := $(shell uname | grep -i darwin)
33       ifneq "$(IS_UNIX)" ""
34         # pick the subclass now that we know this is darwin.
35         OS_SUBCLASS := darwin
36       endif
37     endif
38   endif
39   IS_DOS := $(shell uname | grep -i cygwin)
40   ifeq "$(IS_DOS)" ""
41     IS_DOS := $(shell uname | grep -i ming)
42   endif
43   ifneq "$(IS_UNIX)" ""
44     OP_SYSTEM := UNIX
45   else
46     ifneq "$(IS_DOS)" ""
47       OP_SYSTEM := WIN32
48     else
49       # we don't have other comparisons yet, so we'll assume unix.  fix this
50       # if it's not your default operating system.
51       OP_SYSTEM := UNIX
52     endif
53   endif
54 endif
55
56 # now set a special ending for EXE files, which differs between the OSes.
57 export EXE_END
58 ifeq "$(OP_SYSTEM)" "WIN32"
59   EXE_END := .exe
60 endif
61
62 ###############################################################################
63
64 # "FEISTY_MEOW_DIR" is the root of the "build" for our compilation oriented
65 # features.  All source code and build helper files are usually found there.
66 # The build targets to be built are usually stored there also, although the
67 # targets can be located elsewhere if desired.  see TARGETS_DIR below.
68 export FEISTY_MEOW_DIR
69 ifeq "$(FEISTY_MEOW_DIR)" ""
70 #  FEISTY_MEOW_DIR = 
71 #uhhh, use the current location?
72 #currently we rely on this being set from shell bootstrapping.  is that bad?
73 endif
74
75 # "FEISTY_MEOW_SCRIPTS" is the root location of our scripts.  we expect to
76 # be able to find a few things there reliably.
77 export FEISTY_MEOW_SCRIPTS
78 ifeq "$(FEISTY_MEOW_SCRIPTS)" ""
79   export FEISTY_MEOW_SCRIPTS := $(FEISTY_MEOW_DIR)/scripts
80 endif
81
82 # "PRODUCTION_DIR" is where the built products will be stored, plus any
83 # temporary files that are generated during the build.
84 export PRODUCTION_DIR
85 ifeq "$(PRODUCTION_DIR)" ""
86   PRODUCTION_DIR=$(FEISTY_MEOW_DIR)/production
87 endif
88
89 # "CLAM_DIR" points at where the CLAM source files are located.  this is needed
90 # for finding shell scripts used during compilation.  if you are not using the
91 # standard CLAM location, then modify this appropriately.
92 export CLAM_DIR
93 ifeq "$(CLAM_DIR)" ""
94   export CLAM_DIR := $(FEISTY_MEOW_SCRIPTS)/clam
95 endif
96
97 # "TARGETS_DIR" is where all generated files will end up.  Usually the
98 # files are put in a subdirectory named after their file type, such as
99 # "include".  These subdirectories will all live under the TARGETS_DIR.
100 export TARGETS_DIR
101 ifeq "$(TARGETS_DIR)" ""
102   # the default is to generate files into subdirectories that are at the
103   # top-level of the repository.
104   TARGETS_DIR = $(FEISTY_MEOW_DIR)
105 endif
106
107 # "CLAM_BIN" points at the location for helper binaries and shell scripts.
108 export CLAM_BIN = $(PRODUCTION_DIR)/clam_bin
109
110 # "CURRENT_DIR" is the directory where this make was started.
111 export CURRENT_DIR := $(shell pwd)
112
113 ###############################################################################
114
115 # "PROJECT" is the root name for the project being compiled.  It is used
116 # in generated directory names and for other purposes of uniquification.
117 # This is a variable that _must_ be supplied by the user's makefile.
118 # Examples:
119 #     PROJECT = basis
120 #     PROJECT = test_parser
121 export PROJECT
122
123 # "TARGETS" are the files to be created by CLAM.  It is assumed that each
124 # target listed has a corresponding rule that causes it to be processed.
125 # Targets are automatically deleted when the "make clean" command is used.
126 export TARGETS
127
128 # "ACTUAL_TARGETS" is how the targets are expected to be passed to the rules
129 # file; this allows a plug-in module's rules to manipulate the TARGETS to make
130 # sure that important files don't get deleted by the automatic deletion done
131 # with "make clean."  If the real module used does not create a variable called
132 # ACTUAL_TARGETS from the TARGETS, then the default specified here is used.
133 export ACTUAL_TARGETS = $(TARGETS)
134
135 # "FIRST_TARGETS" and "LAST_TARGETS" are targets that need to be processed
136 # before and after the "TARGETS".
137 #FIRST_TARGETS =
138 #LAST_TARGETS =
139
140 # "ACTUAL_FIRST_TARGETS" is the real variable that should be passed to the
141 # rules for reasons similar to ACTUAL_TARGETS above.  Some language
142 # dependent modules need to modify the first targets by inserting targets
143 # before those provided by the user.  "ACTUAL_LAST_TARGETS" is similar. 
144 ACTUAL_FIRST_TARGETS = $(FIRST_TARGETS)
145 ACTUAL_LAST_TARGETS = $(LAST_TARGETS)
146
147 # "BUILD_BEFORE" is a list of projects that need to be created before this
148 # project can be created.  The projects are expected to match subdirectories
149 # below this project.  make will change to that subdirectory and run the
150 # makefile contained therein.
151 #BUILD_BEFORE =
152
153 # "BUILD_AFTER" is similar to BUILD_BEFORE, but these are done after the rest.
154 #BUILD_AFTER =
155
156 # "RUN_TARGETS" is a list of programs that should be executed as part of a make.
157 export RUN_TARGETS
158 # "NO_TEST_RUNS" turns off execution of the RUN_TARGETS.
159 export NO_TEST_RUNS
160
161 # "MAKEFILE_NAME" works with BUILD_BEFORE and BUILD_AFTER.  This allows
162 # the name of the makefile in the subdirectory to be changed to something other
163 # than 'makefile'.
164 export MAKEFILE_NAME = makefile
165
166 ############################################################################
167
168 # "FIND" is a macro that points to the real find command, which is the unix
169 # find command.  on dosdows, the find command is utter garbage and we need
170 # to make sure we don't accidentally run that inferior one.
171 export FIND = find
172
173 # "PARAMETER_FILE" is the location of our version stamps (if defined) and
174 # also contains any extra flags passed to the compilation.
175 ifeq "$(PARAMETER_FILE)" ""
176   # the default assumes that clam lives under the main hoople branch.
177   export PARAMETER_FILE = $(CLAM_DIR)/clam_parms.ini
178 endif
179
180 # ensure that our version variables are available to sub-shells.
181 export major
182 export minor
183 export revision
184 export build
185 export TRIPART_VERSION = .$(major).$(minor).$(revision)
186
187 # now pull those build parameters in.
188 include $(PARAMETER_FILE)
189
190 ############################################################################
191
192 # "CLEAN" is an powerful flag that affects what clam does.  if the flag is
193 # non-empty, then nothing will be built and every generated file that is
194 # known about will be deleted.
195 export CLEAN
196 # "CLEANUPS" are things to be removed by the "make clean" command.
197 #CLEANUPS =
198 # OTHER_CLEANS are targets to execute before performing the main clean up.
199 #OTHER_CLEANS =
200
201 # sets the temporary directory.
202 export CLAM_TMP
203 ifeq "$(CLAM_TMP)" ""
204   CLAM_TMP := $(WASTE_DIR)
205 endif
206
207 ifeq "$(OP_SYSTEM)" "WIN32"
208   # set these so that compilers and such will use them.
209   export TMP := $(CLAM_TMP)
210   export TEMP := $(CLAM_TMP)
211 endif
212
213 # "FAILURE_FILE" is a file that is used as a flag to track failures.  if the
214 # file exists, then it is assumed that a failure happened during the current
215 # make.
216 export FAILURE_FILE = $(CLAM_TMP)/clam_failure.$(PROJECT)
217
218 # "DIRTY_FILE" is a file that signifies that some targets have been remade.
219 # it is not used at the base level of clam, but language-specific versions
220 # might do something special if targets were remade.
221 export DIRTY_FILE = $(CLAM_TMP)/clam_acted.$(PROJECT)
222
223 # "SUBMAKE_FLAG" is a file whose presence indicates that the submake performed
224 # some actions.  that can be interpreted by some language-specific versions
225 # as a reason to set the dirty flag.
226 export SUBMAKE_FLAG = $(CLAM_TMP)/clam_submake.$(PROJECT)
227
228 # "FLAG_FILES" is a list of all the files that are used for compilation flags.
229 # they are whacked at the beginning and end of a make.
230 export FLAG_FILES = $(FAILURE_FILE) $(DIRTY_FILE)
231
232 # "SUB_FLAG_FILES" is a list of the compilation flag files which should be
233 # destroyed only at the end of a make.  they are communication back
234 # from sub-makefiles.
235 export SUB_FLAG_FILES = $(SUBMAKE_FLAG)
236
237 # "SHELL" is used by gnu make to specify the shell that executes programs.
238 SHELL = /bin/bash
239
240 # "SH" is the shell that will execute all commands.  this is our own variable;
241 # it is not used by gnu make.  currently we just default to the standard
242 # SHELL variable above.
243 export SH = $(SHELL)
244
245 # "HIDER" cloaks the commands that are sent to the operating system.  The
246 # HIDER macro has the "@" symbol in it if the make is _not_ verbose; this
247 # hides the commands that are executed.  If the make _is_ to be verbose,
248 # then the "@" is removed.
249 HIDER_CHAR = @
250 ifneq "$(NOISY)" ""
251   # If the special NOISY flag is true, then the make will be _very_ verbose.
252   HIDER_CHAR =
253 endif
254 # Put together the full hider package.
255 HIDER = $(HIDER_CHAR)
256
257 # "HIDESH" is a hider that executes a sub-shell.  This is needed for proper
258 # execution of inlined shell scripting.  Note that the space at the end of
259 # the line is required.
260 HIDESH = $(HIDER) $(SH) 
261
262 # "CATCHER" is a hider that looks for errors in the command being run and
263 # stops the make if any are seen.
264 CATCHER = $(HIDESH) $(CLAM_DIR)/badness_catcher.sh 
265
266 # "NOISY" causes the compilation to be verbose.  All commands issued are echoed
267 # to the standard output.
268 export NOISY
269
270 # "QUIET" has the effect of silencing certain internal clam printouts.
271 #QUIET =
272
273 # "CLAM_ERROR_SOUND" causes the named file to be played for error conditions that
274 # stop the build.
275 export CLAM_ERROR_SOUND
276
277 # "CLAM_FINISH_SOUND" causes the file specified to be played when the make is
278 # complete.
279 export CLAM_FINISH_SOUND
280