051d23f028aff6182b6f22fe77cbbae874774b75
[feisty_meow.git] / scripts / clam / cpp / rules.def
1 ###############################################################################
2
3 # CLAM System default rules and targets for C++ compilation.
4
5 # This file composite macros and rules for creating compilation objects
6 # (such as library archives, object files, executable programs, and others).
7
8 # This file should be included in the user Makefile after the variables
9 # have been initialized appropriately for the particular project being
10 # compiled.  The user targets should be placed after the include
11 # directive that specifies this file.
12
13 ###############################################################################
14
15 # This section manipulates variable values to prepare them for their use
16 # in the standard CLAM support.
17
18 # see if they have got the clean flag set.  if so, we will not build anything.
19 ifneq "$(CLEAN)" ""
20   NO_COMPILE = t
21 endif
22 # also omit version compilation and some logging when not compiling.
23 ifneq "$(NO_COMPILE)" ""
24   QUIET = t
25 endif
26
27 # add-ins for packages we use.
28
29 # secure socket and crypto libraries.
30 ifneq "$(USE_SSL)" ""
31   LIBS_USED += ssl crypto
32 endif
33
34 # pull in the curl configuration using their tool.
35 ifneq "$(USE_CURL)" ""
36   COMPILER_FLAGS += `curl-config --cflags`
37   LOAD_FLAG_SUFFIX += `curl-config --libs`
38 endif
39
40 # x window system.
41 ifneq "$(USE_XWIN)" ""
42   DEFINITIONS += __XWINDOWS__ __X__
43   LIBS_USED += 
44 #Xm Xt X11 Xft Xp 
45 #need to separate out with a USE_MOTIF kind of thing.
46 #LIBS_USED += Xmu
47   HEADER_SEARCH_PATH += /usr/include/X11 /usr/X11R6/include 
48 #/usr/include/g++
49   LIBRARY_SEARCH_PATH += /usr/X11R6/lib
50 endif
51
52 # generalized wxwidgets toolkit configuration.
53 ifneq "$(USE_WXWIDGETS)" ""
54   DEFINITIONS += __WXWIDGETS__ 
55   use_unicode =
56   ifneq "$(findstring UNICODE, $(DEFINITIONS))" ""
57     use_unicode = true
58   endif
59
60   # decide whether to turn on the unicode flag or not.
61 ###    ifneq "$(findstring UNICODE, $(DEFINITIONS))" ""
62   ifneq "$(use_unicode)" ""
63     UNICODE_FLAG_ADD = --unicode=yes
64     DEFINITIONS += wxUSE_UNICODE
65   else
66     UNICODE_FLAG_ADD = --unicode=no
67   endif
68
69   COMPILER_FLAGS += $(shell wx-config --cxxflags $(UNICODE_FLAG_ADD) )
70   LOAD_FLAG_PREFIX += $(shell wx-config --libs $(UNICODE_FLAG_ADD) )
71 endif
72
73 # add special bits for gnu on unix.
74 ifeq "$(CLAM_COMPILER)" "GNU_LINUX"
75
76 endif
77
78 # some special code for gnu compiler on windows.
79 ifeq "$(CLAM_COMPILER)" "GNU_WINDOWS"
80
81 #hmmm: LOAD_FLAG_PREFIX += -lwsock32 -lmswsock -shared
82 endif
83
84 ###############################################################################
85
86 ifeq "$(CLAM_COMPILER)" "GNU_DARWIN"
87
88   # finds the crypto code on macos.
89 #  HEADER_SEARCH_PATH += /usr/local/opt/openssl/include
90 #  LIBRARY_SEARCH_PATH += /usr/local/opt/openssl/lib/
91 endif
92
93 ###############################################################################
94
95 # Create the real list of local libraries needed.
96 TEMP_LOC1 = $(LOCAL_LIBS_USED:%=%$(TRIPART_VERSION))
97 ACTUAL_LOCAL_LIBS = $(TEMP_LOC1)
98
99 # Create the list of objects from the list of source files.
100 TEMP_OBJ1 = $(SOURCE:%.cpp=%.obj)
101 TEMP_OBJ2 = $(TEMP_OBJ1:%.c=%.obj)
102
103 # replace this when supporting resource files on unix.
104 TEMP_OBJ3 = $(TEMP_OBJ2:%.rc=)
105
106 TEMP_OBJ4 = $(TEMP_OBJ3:%.h=%.bad)
107 OBJECTS = $(TEMP_OBJ4)
108
109 # special case for multi-build and res files that need to be rebuilt.
110 #RES_OBJECTS_0 = $(SOURCE:%.cpp=)
111 #RES_OBJECTS_1 = $(RES_OBJECTS_0:%.c=)
112 #RES_OBJECTS = $(RES_OBJECTS_1:%.rc=$(OBJECT_DIR)/%.res)
113
114 # not much conversion anymore...
115 ACTUAL_OBJECTS = $(OBJECTS) $(EXTRA_OBJECTS)
116
117 # Updates the search path for the compiler and local libraries.
118 BASE_HEADER_PATH := $(CODEBASE_HEADERS) $(LOCAL_HEADERS) bork1 $(FEISTY_MEOW_CPP_HEADERS) bork2 $(SEARCH_DIRS)
119
120 HEADER_SEARCH_PATH += $(BASE_HEADER_PATH) $(COMPILER_HEADER_DIR)
121
122 LIBRARY_SEARCH_PATH += $(LOCAL_LIBRARIES) $(HOOPLE_LIBRARIES) \
123   $(STATIC_LIBRARY_DIR) $(COMPILER_LIBRARY_DIR) $(SEARCH_DIRS)
124
125 # Adds some directories that must be searched onto the search path for
126 # header files, such as the header file directory for the compiler.
127 COMPILER_FLAGS += $(HEADER_SEARCH_PATH:%=-I%) $(DEFINITIONS:%=-D%) $(UNDEFINITIONS:%=-U%) -DGLOBAL_PRODUCT_NAME="$(GLOBAL_PRODUCT_NAME)"
128
129 # The load flags are updated by looking for code libraries in the directories
130 # to search and by adding all of the code libraries that are used.
131 LOAD_FLAG_PREFIX += $(LIBRARY_SEARCH_PATH:%=$(LIBRARY_PATH_FLAG)%)
132 ifeq "$(OPERATING_SYSTEM)" "UNIX"
133   ifneq "$(CLAM_COMPILER)" "GNU_DARWIN"
134     LOAD_FLAG_PREFIX += -Xlinker --start-group
135     LOAD_FLAG_SUFFIX += -Xlinker --end-group
136   endif
137 endif
138 # had to switch from prefix to suffix recently.  oddity.
139 #LOAD_FLAG_PREFIX += $(LIBS_USED:%=$(LIBRARY_NAME_FLAG)%)
140 LOAD_FLAG_SUFFIX += $(LIBS_USED:%=$(LIBRARY_NAME_FLAG)%)
141
142 # we steal the exe targets and represent their dependency from the hidden
143 # cpp for the exe.
144 EXE_TEMP_0 = $(TARGETS:%.dll=)
145 EXE_TEMP_1 = $(EXE_TEMP_0:%.so=)
146 EXE_TEMP_2 = $(EXE_TEMP_1:%.lib=)
147 EXE_TEMP_3 = $(EXE_TEMP_2:%.elf=%.cpp)
148 EXE_CPPS   = $(EXE_TEMP_3:%.exe=%.cpp)
149
150 # used for compiling multiple source files at the same time with visual cpp.
151 MULTI_BUILD_CMD = $(CC) $(COMPILER_FLAGS) -c `cat $(BUILD_LIST_FILE)` $(OBJECT_NAME_FLAG)$(OBJECT_DIR)/
152
153 ifeq "$(OMIT_VERSIONS)" ""
154   ifneq "$(CLAM_VERSION_RC_ROOT)" ""
155     VERSION_TARGET = $(CLAM_VERSION_RC_ROOT)_version.rc
156   endif
157 endif
158
159 # if we are cleaning up, then do not generate dependency file.
160 ifeq "$(CLEAN)" ""
161   ifneq "$(GENDEPS)" ""
162     EXTRA_FIRST_TARGETS += gendeps
163   endif
164
165 # only do the deps generation for makefiles that are properly marked.
166 ifneq "$(findstring __BUILD_STATIC_APPLICATION__, $(DEFINITIONS))" ""
167   # generate static build dependencies for all targets in the makefile.
168   GENERATED_DEPS_LIST = $(TARGETS:%.exe=%.gendeps)
169 else
170   GENERATED_DEPS_LIST =
171 endif
172
173 endif
174
175 # Make sure that the directory for objects exists.
176 ACTUAL_FIRST_TARGETS = check_requirements $(EXTRA_FIRST_TARGETS) $(VERSION_TARGET) $(FIRST_TARGETS) pre_compilation
177
178 # Adds the primary targets to the list of products to create.
179 ACTUAL_TARGETS1 = $(TARGETS:%.exe=$(EXECUTABLE_DIR)/%)
180 ACTUAL_TARGETS2 = $(ACTUAL_TARGETS1:%.dll=%.so)
181 ACTUAL_TARGETS3 = $(ACTUAL_TARGETS2:%.so=$(DYNAMIC_LIBRARY_DIR)/%$(TRIPART_VERSION).so)
182 ACTUAL_TARGETS4 = $(ACTUAL_TARGETS3:%.lib=$(STATIC_LIBRARY_DIR)/%$(TRIPART_VERSION).library)
183 ACTUAL_TARGETS = $(ACTUAL_TARGETS4:%.elf=$(EXECUTABLE_DIR)/%.elf)
184
185 # Adds the last few targets that CLAM works on.
186 ACTUAL_LAST_TARGETS = post_compilation $(LAST_TARGETS)
187
188 ############################################################################
189
190 # This section defines the rules used to generate various objects from their
191 # source files.
192
193 ############################################################################
194
195 # The first section provides simplistic pseudo-targets for testing compilation
196 # rather than generating built products.
197
198 # the blank target is used to (somewhat) safely remove items from the SOURCE
199 # list.  it is an empty file that should be able to go in a library archive
200 # without hosing it up.
201 %.nil:
202 ifeq "$(NO_COMPILE)" ""
203         $(CATCHER)$(CC) -c $(CLAM_SCRIPTS)/cpp/blank_target.c -o $@
204 endif
205
206 %.bad:
207         @echo There is a problem with the makefile in the SOURCE variable.
208         @echo The offending item is: $@
209         $(HIDESH)$(CLAM_SCRIPTS)/exit_make.sh
210
211 ## faked debug object.
212 #%.obj: %.cpp
213 #ifeq "$(NO_COMPILE)" ""
214 #       @echo Bogus [$@].
215 #       $(CATCHER)$(CC) $(COMPILER_FLAGS) -c $< $(OBJECT_NAME_FLAG)$(TEMP)/$@
216 #endif
217
218 ifeq "$(CLEAN)" ""
219 # recreate dependencies for static applications.
220 %.gendeps: %.cpp
221         @echo "Generating Static Deps: $*.cpp"
222         $(CATCHER)$(CLAM_SCRIPTS)/cpp/buildor_gen_deps.sh "$*.cpp"
223 endif
224
225 ############################################################################
226
227 # trying to delay loading this as long as possible so the built in rule system for CLEANUPS can run with the right values.
228 # so far not working right!
229 #hmmm: fix this.
230
231 # Adds the main CLAM system in to get some work done.  This should be placed
232 # after the module rules are defined and before the module targets are
233 # defined.
234 include rules.def
235
236 ############################################################################
237
238 # this adds in a customization for the cleanup variables, since the base
239 # clam code has no idea about a dynamic library directory.
240
241 cpp_add_to_cleanups_variable:
242 #       echo here is actual targets before hand $(ACTUAL_TARGETS)
243         $(eval CLEANUPS = $(ACTUAL_TARGETS:%.exe=%) $(ACTUAL_TARGETS:$(STATIC_LIBRARY_DIR)/%.library=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%.a) $(CLEANUPS) )
244 #       echo "IN CPP, new CLEANUPS variable: $(CLEANUPS)"
245 #fodder for anything missing a cleanup.
246 #       $(eval CLEANUPS = $(ACTUAL_TARGETS) $(ACTUAL_TARGETS:%.dll=%.so) $(ACTUAL_TARGETS:%.so=%.dll) $(CLEANUPS) )
247
248 #dynamic is taken care of in clam base still?
249 #DYNAMIC_LIBRARY_DIR
250 #hmmm: still should change there in the base and do it
251 # here instead.
252
253 ############################################################################
254
255 # C++ source to object file translation.
256 # if there is a special set of flags for this source file, we use them
257 # instead of the default compiler flags.
258
259 $(OBJECT_DIR)/%.obj: $(CURRENT_DIR)/%.cpp
260 ifeq "$(NO_COMPILE)" ""
261         @echo Compiling Object [$(notdir $@)]
262         $(HIDESH)-c 'if [ ! -d $(@D) ]; then mkdir $(@D); fi'
263         $(CATCHER)$(CC) $(COMPILER_FLAGS) -c $< $(OBJECT_NAME_FLAG)$@
264 endif
265
266 ############################################################################
267
268 # C source to object file translation.
269
270 $(OBJECT_DIR)/%.obj: $(CURRENT_DIR)/%.c
271 ifeq "$(NO_COMPILE)" ""
272         @echo Compiling Object [$(notdir $@)]
273         $(HIDESH)-c 'if [ ! -d $(@D) ]; then mkdir $(@D); fi'
274         $(CATCHER)$(CC) $(COMPILER_FLAGS) -c $< $(OBJECT_NAME_FLAG)$@
275 endif
276
277 ############################################################################
278
279 # resource compiler for windoze.
280
281 # we currently do not use rc files.
282 $(OBJECT_DIR)/%.res: %.rc
283   ifeq "$(NO_COMPILE)" ""
284         @echo Bogus resource [$@]
285         @echo >$@
286   endif
287
288 ############################################################################
289
290 # creates static libraries.
291 ifneq "$(NO_COMPILE)" ""
292 $(STATIC_LIBRARY_DIR)/%.library:
293 endif
294
295 ifeq "$(NO_COMPILE)" ""
296 $(STATIC_LIBRARY_DIR)/%.library: $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(PARAMETER_FILE)
297         $(HIDER)echo Building Static Library [$(notdir $@)]
298         @echo $@ >$(DIRTY_FILE)
299         $(CATCHER)$(LIBRARY_TOOL) $(LIBRARIAN_FLAGS) $(CREATE_LIBRARY_FLAG)$@ $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%)
300   ifneq "$(OPERATING_SYSTEM)" "UNIX"
301         $(HIDER)ranlib $@ 
302         $(HIDER)rm -f $(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)$*$(LIB_ENDING)
303         $(HIDER)ln -s $@ $(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)$*$(LIB_ENDING)
304   else
305 #copied from unix above, not right yet, was not right before either though.
306         $(HIDER)ranlib $@ 
307         $(HIDER)rm -f $(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)$*$(LIB_ENDING)
308         $(HIDER)ln -s $@ $(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)$*$(LIB_ENDING)
309   endif
310 endif #no_compile
311
312 ############################################################################
313
314 # creates dynamic libraries.
315
316 # we whack any existing LIB file, since we want to use changes in that file
317 # as a clue for when we should rescan the dependencies.  we'd be fine if
318 # visual c++ didn't keep an existing LIB if it does not change (even when the
319 # DLL does).
320
321 ifneq "$(NO_COMPILE)" ""
322 $(DYNAMIC_LIBRARY_DIR)/%.dll:
323 endif
324
325 ifeq "$(NO_COMPILE)" ""
326 $(DYNAMIC_LIBRARY_DIR)/%.dll: $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(ACTUAL_RESX) $(PARAMETER_FILE) 
327         $(HIDER)echo Building Dynamic Library [$(notdir $@)]
328         @echo $@ >$(DIRTY_FILE)
329         $(HIDER)rm -f $(@:%.dll=%.lib)
330         echo about to run link tool.
331         $(CATCHER)$(LINK_TOOL) $(LINKER_OUTPUT_FLAG)$@ -dll $(LOAD_FLAG_PREFIX) $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_RESX_FLAGS) $(ACTUAL_LOCAL_LIBS:%=$(LIBRARY_NAME_FLAG)$(LIB_PREFIX)%$(LIB_ENDING)) $(LOAD_FLAG_SUFFIX)
332         echo ran link tool.
333   ifeq "$(CLAM_COMPILER_VERSION)" "8"
334         $(HIDESH)$(CLAM_SCRIPTS)/cpp/ms_manifest.sh "$@" "2"
335   endif
336   ifeq "$(CLAM_COMPILER_VERSION)" "10"
337         $(HIDESH)$(CLAM_SCRIPTS)/cpp/ms_manifest.sh "$@" "2"
338   endif
339   ifneq "$(VCPP_VISTA_ICON)" ""
340         $(HIDER)ReplaceVistaIcon "$@" "$(VCPP_VISTA_ICON)"
341   endif
342 endif #no_compile
343
344 ifneq "$(NO_COMPILE)" ""
345 $(DYNAMIC_LIBRARY_DIR)/%.so:
346 endif
347
348 ifeq "$(NO_COMPILE)" ""
349 $(DYNAMIC_LIBRARY_DIR)/%.so: $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(PARAMETER_FILE)
350   ifeq "$(CLAM_COMPILER:%_LINUX=LINUX)" "LINUX"
351         $(HIDER)echo Shared [$@]
352         @echo $@ >$(DIRTY_FILE)
353         $(CATCHER)$(LINK_TOOL) $(LINKER_OUTPUT_FLAG)$@ $(LOAD_FLAG_PREFIX) -shared -Wl,-soname,$*.so $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(LIBRARY_NAME_FLAG)%) $(LOAD_FLAG_SUFFIX) 
354         $(HIDER)rm -f $(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)$*$(LIB_ENDING)
355         $(HIDER)ln -s $@ $(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)$*$(LIB_ENDING)
356   endif
357 endif #no_compile
358
359 ############################################################################
360
361 # creates "exe" executables using all of the appropriate objects.
362
363 ifneq "$(NO_COMPILE)" ""
364 $(EXECUTABLE_DIR)/%:
365 endif
366
367 ifeq "$(NO_COMPILE)" ""
368 $(EXECUTABLE_DIR)/%: $(OBJECT_DIR)/%.obj $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(PARAMETER_FILE)
369         $(HIDER)echo Building Application [$(notdir $@)]
370         @echo $@ >$(DIRTY_FILE)
371         $(CATCHER)$(LINK_TOOL) $(EXE_FLAGS) $(LOAD_FLAG_PREFIX) $< $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(LIBRARY_NAME_FLAG)%) $(LOAD_FLAG_SUFFIX) $(LINKER_OUTPUT_FLAG)$@
372 #hmmm: experimental item below.
373 #$(^:force_rebuild=) 
374 endif #no_compile
375
376 ############################################################################
377
378 # creates firmware "elf" executables with the proper objects.
379
380 ifneq "$(NO_COMPILE)" ""
381 $(EXECUTABLE_DIR)/%.elf:
382 endif
383
384 ifeq "$(NO_COMPILE)" ""
385 $(EXECUTABLE_DIR)/%.elf: $(OBJECT_DIR)/%.obj $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(PARAMETER_FILE)
386         $(HIDER)echo Building Application [$(notdir $@)]
387         @echo $@ >$(DIRTY_FILE)
388         $(CATCHER)$(LINK_TOOL) $(MAP) $(LOAD_FLAG_PREFIX) $< $(LINKER_COMMAND_FILE) $(STARTUP_OBJECT_FILE) $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(LIBRARY_NAME_FLAG)%) $(LOAD_FLAG_SUFFIX) $(LINKER_OUTPUT_FLAG)$@
389 #$(^:force_rebuild=) 
390         @echo Hex [$(EXECUTABLE_DIR)/$*.out]
391         $(CATCHER)$(DDUMP_TOOL) $(DDUMP_OPTIONS) $@ -o$(EXECUTABLE_DIR)/$*.out
392         @echo Binary [$(EXECUTABLE_DIR)/$*.bin]
393         $(CATCHER)$(DDUMP_TOOL) $(DDUMP_BIN_OPTIONS) $@ -o$(EXECUTABLE_DIR)/$*.bin
394 endif #no_compile
395
396 ############################################################################
397
398 # handles creating version resource files if this project has a version.ini.
399
400 ifeq "$(OMIT_VERSIONS)" ""
401   ifneq "$(CLAM_VERSION_RC_ROOT)" ""
402 # only redo the version resource if it or version.ini is out of date.
403 %_version.rc: version.ini $(PARAMETER_FILE)
404         $(CATCHER)$(CLAM_BINARIES)/version_stamper$(EXE_ENDING) . $(FEISTY_MEOW_GENERATED_STORE)/versions $(PARAMETER_FILE)
405   endif
406 endif
407
408 ############################################################################
409
410 # Now the active part of the make process...
411
412 # make sure we really want to include the dependencies file.
413 ifeq "$(TYPE)" "hierarchy"
414   # no dependencies for a simple hierarchy builder.
415   NO_DEPS = t
416 endif
417 ifneq "$(CLEAN)" ""
418   NO_DEPS = t
419 endif
420 ifneq "$(NO_COMPILE)" ""
421   # non compiling projects do not need dependencies.
422   NO_DEPS = t
423 endif
424 ifneq "$(REBUILD)" ""
425   NO_DEPS = t
426   # if we are rebuilding everything, we zap the deps file.
427   $(shell rm -f $(DEPS_FILE))
428 endif
429
430 # preserves intermediate files from being deleted.
431 ifeq "$(CLEAN)" ""
432 .PRECIOUS: $(OBJECT_DIR)/%.obj $(OBJECT_DIR)/%.res $(OBJECT_DIR)/%.resources $(OBJECT_DIR)/%.deps
433 #hmmm: added above deps.  maybe not right.
434 endif
435
436 # zaps things when they could not be created correctly.
437 ####.DELETE_ON_ERROR:
438
439 ############################################################################
440
441 # autodependency file creator.  See the make_dep man page for more info.
442
443 # we do the auto-dependencies unless the disabling flag is set.
444 ifneq "$(NO_DEPS)" ""
445     # makes the dependencies a no-op.
446     deps: $(PARAMETER_FILE)
447
448     $(DEPS_FILE): $(PARAMETER_FILE)
449
450 else
451   ifeq "$(CLEAN)" ""
452   deps: $(DEPS_FILE)
453
454   # this causes the dependency file to be regenerated if the sources or libs
455   # have changed.  we have to touch the deps file in case it is missing;
456   # makedep does not deal well with that.  also, we touch the dirty flag file
457   # to ensure that the fact we redid dependencies for some reason causes us
458   # to re-promote.  we only bother with any of this if we know we are going
459   # to really do some compilation; if in non-compile mode, we'll skip it.
460   ifneq "$(NO_COMPILE)" ""
461     # no dependencies in non-compile mode.
462     $(DEPS_FILE):
463
464   else
465     ifeq "$(LAX_DEPENDENCIES)" ""
466       $(DEPS_FILE): $(SOURCE) $(ACTUAL_LOCAL_LIBS:%=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(wildcard *.h) $(EXE_CPPS)
467     else  # lax dependencies means create if missing or if parm file changed.
468       $(DEPS_FILE): $(PARAMETER_FILE)
469     endif # !lax dependencies.
470     ifneq "$(CLAM_VERSION_RC_ROOT)" ""
471       ifeq "$(OMIT_VERSIONS)" ""
472         $(DEPS_FILE): $(CLAM_VERSION_RC_ROOT)_version.rc
473       endif
474     endif
475         @echo Dependencies [$(notdir $@)]
476         -$(HIDESH)$(CLAM_SCRIPTS)/cpp/preconditions.sh
477         @touch $@
478 #       @echo dep adds: $(DEPENDENCY_ADDITIONS)
479         @$(CLAM_BINARIES)/makedep$(EXE_ENDING) $(DEPENDENCY_DEFINITIONS:%=-D%) $(DEPENDENCY_ADDITIONS) -f$@ -o.obj -p$(OBJECT_DIR)/ -w 420 $(COMPILER_HEADER_DIR:%=-X%) $(THIRD_PARTY_DIR:%=-X%) -- $(COMPILER_FLAGS) $(SOURCE) $(EXE_CPPS)
480 #       $(CATCHER)$(CLAM_BINARIES)/makedep$(EXE_ENDING) $(DEPENDENCY_DEFINITIONS:%=-D%) $(DEPENDENCY_ADDITIONS) -f$@ -o.obj -p$(OBJECT_DIR)/ -w 420 $(COMPILER_HEADER_DIR:%=-X%) $(THIRD_PARTY_DIR:%=-X%) -- $(COMPILER_FLAGS) $(SOURCE) $(EXE_CPPS)
481         @echo $@ >$(SUBMAKE_FLAG)
482   endif # non-compile.
483  else # cleaning.
484     # makes the dependencies a no-op for cleaning.
485     deps: $(PARAMETER_FILE)
486
487     $(DEPS_FILE): $(PARAMETER_FILE)
488  endif
489 endif # no-deps.
490
491 ############################################################################
492
493 # examines the required variables and complains if they are missing.
494 check_requirements:
495         $(HIDESH) -c 'if [ -z "$(PROJECT)" ]; then echo the PROJECT variable is not defined!; . $(CLAM_SCRIPTS)/exit_make.sh; fi'
496         $(HIDESH) -c 'if [ -z "$(TYPE)" ]; then echo the TYPE variable is not defined!; . $(CLAM_SCRIPTS)/exit_make.sh; fi'
497         $(HIDESH) -c 'if [ ! -d $(FEISTY_MEOW_GENERATED_STORE)/versions ]; then mkdir $(FEISTY_MEOW_GENERATED_STORE)/versions; fi'
498  
499 ############################################################################
500
501 # includes the auto-dependency information.  the dependency file is checked
502 # for being up-to-date.  if not, it gets rebuilt and the make is restarted.
503 ifeq "$(CLEAN)" ""
504   ifeq "$(NO_DEPS)" ""
505
506     # thank the buddha for this bit of code, or at least thank this page:
507     # http://stackoverflow.com/questions/5553352/how-do-i-check-if-file-exists-in-makefile
508     ifneq ("$(wildcard $(DEPS_FILE))","")
509       include $(DEPS_FILE)
510     endif
511
512   endif
513 endif
514
515 ############################################################################
516
517 # calls the script for preparing output directories and such.
518 pre_compilation:
519         $(HIDESH)$(CLAM_SCRIPTS)/cpp/preconditions.sh
520
521 ############################################################################
522
523 # calls the script for copying the final products to the library directory.
524 # we do not bother reporting errors from touch since there will sometimes
525 # not be any objects in the final directory.
526 post_compilation:
527         $(HIDESH)$(CLAM_SCRIPTS)/cpp/postconditions.sh
528
529 ############################################################################
530
531 # if REBUILD is defined, then we cause all objects to be recompiled.
532 .PHONY: force_rebuild
533 force_rebuild:
534
535 ifneq "$(REBUILD)" ""
536   # the target below needs the blank rule that it has for this to work.
537   $(FIRST_TARGETS) $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_TARGETS) $(EXE_CPPS:%.cpp=$(OBJECT_DIR)/%.obj) $(LAST_TARGETS): force_rebuild
538 endif
539
540 ############################################################################
541
542 # generate dependencies for any static targets if requested.
543 gendeps: $(GENERATED_DEPS_LIST)
544
545 ############################################################################
546