2 # CLAM System default variable definitions.
4 ###############################################################################
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.
12 ###############################################################################
14 # OP_SYSTEM is a flag that specifies the operating system under which
15 # the makefile system is executing.
17 #OP_SYSTEM := UNIX = unix | OS2 = ibm os/2 | SYSV = v unix | DOS = pc dos
18 # | WIN32 = ms-win32 / NT.
20 # OS_SUBCLASS is a finer differentiation of the OP_SYSTEM. currently only
21 # the darwin subclass for unix is considered.
23 #OS_SUBCLASS := darwin |
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)
30 IS_UNIX := $(shell uname | grep -i unix)
32 IS_UNIX := $(shell uname | grep -i darwin)
34 # pick the subclass now that we know this is darwin.
39 IS_DOS := $(shell uname | grep -i cygwin)
41 IS_DOS := $(shell uname | grep -i ming)
49 # we don't have other comparisons yet, so we'll assume unix. fix this
50 # if it's not your default operating system.
56 # now set a special ending for EXE files, which differs between the OSes.
58 ifeq "$(OP_SYSTEM)" "WIN32"
62 ###############################################################################
64 # "REPOSITORY_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.
69 ifeq "$(REPOSITORY_DIR)" ""
71 #uhhh, use the current location?
74 # "CLAM_DIR" points at where the CLAM source files are located. this is needed
75 # for finding shell scripts used during compilation. if you are not using the
76 # standard CLAM location, then modify this appropriately.
78 # must be set externally!
79 #export CLAM_DIR := $(SHELLDIR)/clam
81 # "TARGETS_DIR" is where all generated files will end up. Usually the
82 # files are put in a subdirectory named after their file type, such as
83 # "include". These subdirectories will all live under the TARGETS_DIR.
85 ifeq "$(TARGETS_DIR)" ""
86 # the default is to generate files into subdirectories that are at the
87 # top-level of the repository.
88 TARGETS_DIR = $(REPOSITORY_DIR)
91 # "CLAM_BIN" points at the location for helper binaries and shell scripts.
92 ifeq "$(OP_SYSTEM)" "UNIX"
93 export CLAM_BIN = $(PRODUCTION_DIR)/clam_bin
96 # "CURRENT_DIR" is the directory where this make was started.
97 export CURRENT_DIR := $(shell pwd)
99 ###############################################################################
101 # "PROJECT" is the root name for the project being compiled. It is used
102 # in generated directory names and for other purposes of uniquification.
103 # This is a variable that _must_ be supplied by the user's makefile.
106 # PROJECT = test_parser
109 # "TARGETS" are the files to be created by CLAM. It is assumed that each
110 # target listed has a corresponding rule that causes it to be processed.
111 # Targets are automatically deleted when the "make clean" command is used.
114 # "ACTUAL_TARGETS" is how the targets are expected to be passed to the rules
115 # file; this allows a plug-in module's rules to manipulate the TARGETS to make
116 # sure that important files don't get deleted by the automatic deletion done
117 # with "make clean." If the real module used does not create a variable called
118 # ACTUAL_TARGETS from the TARGETS, then the default specified here is used.
119 export ACTUAL_TARGETS = $(TARGETS)
121 # "FIRST_TARGETS" and "LAST_TARGETS" are targets that need to be processed
122 # before and after the "TARGETS".
126 # "ACTUAL_FIRST_TARGETS" is the real variable that should be passed to the
127 # rules for reasons similar to ACTUAL_TARGETS above. Some language
128 # dependent modules need to modify the first targets by inserting targets
129 # before those provided by the user. "ACTUAL_LAST_TARGETS" is similar.
130 ACTUAL_FIRST_TARGETS = $(FIRST_TARGETS)
131 ACTUAL_LAST_TARGETS = $(LAST_TARGETS)
133 # "BUILD_BEFORE" is a list of projects that need to be created before this
134 # project can be created. The projects are expected to match subdirectories
135 # below this project. make will change to that subdirectory and run the
136 # makefile contained therein.
139 # "BUILD_AFTER" is similar to BUILD_BEFORE, but these are done after the rest.
142 # "RUN_TARGETS" is a list of programs that should be executed as part of a make.
145 # "MAKEFILE_NAME" works with BUILD_BEFORE and BUILD_AFTER. This allows
146 # the name of the makefile in the subdirectory to be changed to something other
148 export MAKEFILE_NAME = makefile
150 ############################################################################
152 # "FIND" is a macro that points to the real find command, which is the unix
153 # find command. on dosdows, the find command is utter garbage and we need
154 # to make sure we don't accidentally run that inferior one.
156 #ifeq "$(OP_SYSTEM)" "WIN32"
157 # export FIND = $(REPOSITORY_DIR)/msys/bin/find
160 # "PARAMETER_FILE" is the location of our version stamps (if defined) and
161 # also contains any extra flags passed to the compilation.
162 ifeq "$(PARAMETER_FILE)" ""
163 # the default assumes that clam lives under the main hoople branch.
164 export PARAMETER_FILE = $(CLAM_DIR)/clam_parms.ini
167 # ensure that our version variables are available to sub-shells.
172 export TRIPART_VERSION = .$(major).$(minor).$(revision)
174 # now pull those build parameters in.
175 include $(PARAMETER_FILE)
177 ############################################################################
179 # "CLEAN" is an powerful flag that affects what clam does. if the flag is
180 # non-empty, then nothing will be built and every generated file that is
181 # known about will be deleted.
183 # "CLEANUPS" are things to be removed by the "make clean" command.
185 # OTHER_CLEANS are targets to execute before performing the main clean up.
188 # sets the temporary directory.
190 ifeq "$(CLAM_TMP)" ""
191 CLAM_TMP := $(WASTE_DIR)
194 ifeq "$(OP_SYSTEM)" "WIN32"
195 # set these so that compilers and such will use them.
196 export TMP := $(CLAM_TMP)
197 export TEMP := $(CLAM_TMP)
200 # "FAILURE_FILE" is a file that is used as a flag to track failures. if the
201 # file exists, then it is assumed that a failure happened during the current
203 export FAILURE_FILE = $(CLAM_TMP)/clam_failure.$(PROJECT)
205 # "DIRTY_FILE" is a file that signifies that some targets have been remade.
206 # it is not used at the base level of clam, but language-specific versions
207 # might do something special if targets were remade.
208 export DIRTY_FILE = $(CLAM_TMP)/clam_acted.$(PROJECT)
210 # "SUBMAKE_FLAG" is a file whose presence indicates that the submake performed
211 # some actions. that can be interpreted by some language-specific versions
212 # as a reason to set the dirty flag.
213 export SUBMAKE_FLAG = $(CLAM_TMP)/clam_submake.$(PROJECT)
215 # "FLAG_FILES" is a list of all the files that are used for compilation flags.
216 # they are whacked at the beginning and end of a make.
217 export FLAG_FILES = $(FAILURE_FILE) $(DIRTY_FILE)
219 # "SUB_FLAG_FILES" is a list of the compilation flag files which should be
220 # destroyed only at the end of a make. they are communication back
221 # from sub-makefiles.
222 export SUB_FLAG_FILES = $(SUBMAKE_FLAG)
224 # "SHELL" is used by gnu make to specify the shell that executes programs.
227 # "SH" is the shell that will execute all commands. this is our own variable;
228 # it is not used by gnu make. currently we just default to the standard
229 # SHELL variable above.
232 # "HIDER" cloaks the commands that are sent to the operating system. The
233 # HIDER macro has the "@" symbol in it if the make is _not_ verbose; this
234 # hides the commands that are executed. If the make _is_ to be verbose,
235 # then the "@" is removed.
238 # If the special NOISY flag is true, then the make will be _very_ verbose.
241 # Put together the full hider package.
242 HIDER = $(HIDER_CHAR)
244 # "HIDESH" is a hider that executes a sub-shell. This is needed for proper
245 # execution of inlined shell scripting. Note that the space at the end of
246 # the line is required.
247 HIDESH = $(HIDER) $(SH)
249 # "CATCHER" is a hider that looks for errors in the command being run and
250 # stops the make if any are seen.
251 CATCHER = $(HIDESH) $(CLAM_DIR)/badness_catcher.sh
253 # "NOISY" causes the compilation to be verbose. All commands issued are echoed
254 # to the standard output.
257 # "QUIET" has the effect of silencing certain internal clam printouts.
260 # "CLAM_ERROR_SOUND" causes the named file to be played for error conditions that
262 export CLAM_ERROR_SOUND
264 # "CLAM_FINISH_SOUND" causes the file specified to be played when the make is
266 export CLAM_FINISH_SOUND