a645b02f8371c8db88c5800f9e21d77d5c7517ff
[feisty_meow.git] / scripts / clam / dotnet-retired / variables.def
1 ###############################################################################
2
3 # CLAM System default variable definitions for C# compilation.
4
5 ###############################################################################
6
7 # Pull in the base support for CLAM.
8 include variables.def
9
10 ###############################################################################
11
12 #CLAM_BINARIES = $(CLAM_SCRIPTS)/../bin
13
14 ###############################################################################
15
16 ifneq "$(BUILD_PARAMETER_FILE)" ""
17   # define our version of the build parameter file.  this should be set
18   # beforehand so we override the default parameter file for clam.
19   export PARAMETER_FILE = $(BUILD_PARAMETER_FILE)
20 ###no: $(FEISTY_MEOW_APEX)/build/identity.ini
21 endif
22 ifeq "$(PARAMETER_FILE)" ""
23   # last ditch attempt to get one that will work.
24   export PARAMETER_FILE = $(FEISTY_MEOW_APEX)/build.ini
25 endif
26
27 ###############################################################################
28
29 # BASE_CPU is a flag that distinguishes the type of processor, if necessary.
30 export BASE_CPU
31 #BASE_CPU        = m68k
32   # motorola 68000 series.
33 #BASE_CPU        = m68340
34   # motorola 68340.
35 #BASE_CPU        = x86
36   # intel x86.
37 #BASE_CPU        = ppc860
38   # power pc 860.
39
40 # set the CPU default if we do not have one.
41 ifeq "$(BASE_CPU)" ""
42   BASE_CPU = x86
43 endif
44
45 # COMPILER is a flag that specifies the operating system or the compiler for
46 # use in conditional compilation (#ifdef ... #endif) of the compiler dependent
47 # interfaces or implementations.
48 export COMPILER
49 #COMPILER = VISUAL_CPP
50
51 # choose a default compiler if none was specified.
52 ifeq "$(COMPILER)" ""
53   COMPILER = VISUAL_CPP
54 endif
55
56 # COMPILER_VERSION specifies the version of a particular compiler, if this is
57 # needed to distinguish how the code is built.
58 export COMPILER_VERSION
59
60 ###############################################################################
61
62 # "TYPE" is the kind of product being generated by this project.  this is
63 # used to decide where to put the final products of compilation.  this is a
64 # variable in the user's makefile.
65 # Valid Types:
66 #     TYPE = library        (outputs are static or dynamic libraries)
67 #     TYPE = application    (outputs are main-line executables)
68 #     TYPE = test           (outputs are test programs)
69 export TYPE
70
71 ###############################################################################
72
73 # pseudo-boolean variable section.  if these have any value at all, then they
74 # are treated as being true.  note that these are flags that should generally
75 # be passed on the command line to a make.  if they are intended to be used
76 # from inside a makefile, then they must appear before this file is included.
77
78 # "REBUILD" causes a rebuild of all source files if it's true.
79 export REBUILD
80
81 # "DEBUG" is used to specify a debugging build.  the default is for this to
82 # be false, which causes a release build.
83 export DEBUG
84
85 # "OPTIMIZE" creates optimized code.
86 export OPTIMIZE
87
88 # "NO_COMPILE" just runs through the targets without compiling.  it still
89 # promotes headers however.
90 export NO_COMPILE
91
92 # "BUILD_LIST_FILE" is the set of files that need to be recompiled for
93 # visual c++.
94 export BUILD_LIST_FILE = $(CLAM_TMP)/clam_rebuild.$(PROJECT)
95
96 # "BUILD_WHACK_FILE" is the set of object files that should be removed if
97 # a build failure occurs.
98 export BUILD_WHACK_FILE = $(CLAM_TMP)/clam_whack.$(PROJECT)
99
100 # we're adding the build list to the flag files so we know it gets cleaned up.
101 FLAG_FILES += $(BUILD_LIST_FILE) $(BUILD_WHACK_FILE)
102
103 ###############################################################################
104
105 # This section implements the HOOPLE directory scheme.  If your scheme differs,
106 # then you'll want to modify these appropriately.
107
108 # "THIRD_PARTY_DIR" is the root of our support libraries.
109 ifeq "$(OP_SYSTEM)" "UNIX"
110   export THIRD_PARTY_DIR
111 endif
112 ifeq "$(OP_SYSTEM)" "WIN32"
113   export THIRD_PARTY_DIR = $(FEISTY_MEOW_APEX)/3rdparty
114 endif
115
116 # "OUTPUT_ROOT" is the root of all output directories for objects and other
117 # products being built.
118 export OUTPUT_ROOT = $(TARGETS_STORE)/obj
119
120 # "PLATFORM_ADD_IN" is an option discriminator for the intended execution
121 # platform.  it should end in an underscore if it is provided.
122 #PLATFORM_ADD_IN = linux_
123 #PLATFORM_ADD_IN = w32_
124 PLATFORM_ADD_IN =
125
126 # "CPU_BUILD_DIR" distinguishes object directories by including the cpu
127 # name and the type of build.
128 ifneq "$(DEBUG)" ""
129   CPU_BUILD_DIR = $(BASE_CPU)_dbg
130 else
131   CPU_BUILD_DIR = $(BASE_CPU)_$(PLATFORM_ADD_IN)rel
132 endif
133
134 # "BASE_OUTPUT_PATH" is the parent directory of objects for this type of
135 # cpu and this type of build.
136 export BASE_OUTPUT_PATH = $(OUTPUT_ROOT)/$(CPU_BUILD_DIR)
137
138 # "OUTPUT_PATH" is the directory to generate all compiled products into.
139 export OUTPUT_PATH = $(BASE_OUTPUT_PATH)/$(PROJECT)
140
141 # "OBJECT_DIR" is where object files will be stored during compilation for the
142 # target type being produced.
143 export OBJECT_DIR = $(OUTPUT_PATH)
144
145 # These specify where files are to be created or located for our local build.
146 export EXECUTABLE_DIR = $(TARGETS_STORE)/exe
147 export DYNAMIC_LIBRARY_DIR = $(TARGETS_STORE)/dll
148 export STATIC_LIBRARY_DIR = $(TARGETS_STORE)/lib
149 export TESTS_DIR = $(TARGETS_STORE)/tests
150
151 # "HEADER_SEARCH_PATH" is where the class interface files are to be found.
152 #HEADER_SEARCH_PATH =
153
154 # "HOOPLE_HEADERS" are locations where the HOOPLE headers can be found.
155 HOOPLE_HEADERS := $(shell $(FIND) $(FEISTY_MEOW_APEX)/source/lib_src $(FEISTY_MEOW_APEX)/libraries -mindepth 1 -maxdepth 1 -type d)
156
157 # "LOCAL_HEADERS" are overrides that go first in the header search path.
158 #LOCAL_HEADERS =
159
160 # "CODEBASE_HEADERS" is a list that can be changed for a particular codebase.
161 # it is guaranteed that clam will not interfere with this list, whereas
162 # the LOCAL_HEADERS can be modified by clam.
163 #CODEBASE_HEADERS =
164
165 # "LOCAL_LIBRARIES" are overrides that go first in the library search path.
166 #LOCAL_LIBRARIES =
167
168 # "LIBRARY_SEARCH_PATH" is where the library files are to be found.
169 #LIBRARY_SEARCH_PATH =
170
171 # "HOOPLE_LIBRARIES" is where our local libraries are located.
172 HOOPLE_LIBRARIES =
173
174 # "EXTRA_COPIES" is a list of files that are copied to a project's output
175 # directory.
176 export EXTRA_COPIES
177
178 # "EXTRA_VERSIONS" is a list of version files to synchronize with the main
179 # library version for this build.  if a file called "version.ini" exists in
180 # the project directory, then it will automatically be upgraded, so the
181 # extra version files are mainly useful when you have a project with multiple
182 # programs in it and you want them to have independent version files (as you
183 # should perhaps want).
184 export EXTRA_VERSIONS
185
186 # "OMIT_VERSIONS" is another exclusion flag.  this one turns off the creation
187 # of version resource files and eliminates any references that would include
188 # such files.  this is needed when rebuilding version_stamper.
189 #OMIT_VERSIONS = t
190
191 # Add the obligatory junk to be cleaned up.  Individual compiler sections
192 # should customize this by adding their object output directories.
193 CLEANUPS += $(ACTUAL_TARGETS) $(OUTPUT_PATH) 
194 #hmmm: import libs for dynamic libraries on ms-win32 don't currently get
195 #      cleaned up nicely.
196
197 ###############################################################################
198
199 # "SEARCH_DIRS" is a list of directories that should be searched for both C++
200 # header files and for C++ code libraries.  The items placed in SEARCH_DIRS
201 # are fed into both the LIBRARY_SEARCH_PATH and the HEADER_SEARCH_PATH.
202 #SEARCH_DIRS =
203
204 # "DEFINITIONS" is a list of compiler flags that define the value of c macros.
205 # These usually have the format of -D<flag>, but in this variable, only the
206 # <flag> itself should be listed because the compiler option -D is added
207 # automatically.
208 DEFINITIONS = CLAM_BUILT
209
210 ifneq "$(BOOT_STRAPPING)" ""
211   # the software is being built from the ground up, including the binaries
212   # we use for building (like value_tagger and others).
213   DEFINITIONS += BOOT_STRAPPING
214 endif
215
216 # "UNDEFINITIONS" is a list of macros to undefine.
217 #UNDEFINITIONS =
218
219 #hmmm: these kinds of defines (with a value) do not work for csharp.
220 # GLOBAL_PRODUCT_NAME is an important variable for tagging the entire code base
221 # with some branding.  It is provided as a macro definition to all source
222 # files.  The initial value for the macro should come from the build init
223 # file, but if it doesn't, we pick a default.
224 ##ifeq "$(product_name)" ""
225 ##  DEFINITIONS += GLOBAL_PRODUCT_NAME=\\\"HOOPLE\\\"
226 ##else
227 ##  DEFINITIONS += GLOBAL_PRODUCT_NAME=\\\"$(product_name)\\\"
228 ##endif
229
230 # *_PRODUCT_VERSION records parts of our version numbers for the code to see.
231 ###DEFINITIONS += MAJOR_PRODUCT_VERSION=$(major) MINOR_PRODUCT_VERSION=$(minor)
232
233 # "DEBUG_FLAGS" these flags are used for generating specialized versions of
234 # object files, such as ones that include debugging code or that add code for
235 # profiling.
236 # Possible values are -g for adding GDB debugging code and -pg for adding
237 # gprof profiling code.
238 #DEBUG_FLAGS = -g
239 #DEBUG_FLAGS = -pg
240 #DEBUG_FLAGS =
241
242 # "COMPILER_FLAGS" are the flags for the pre-processor and compiler.
243 #COMPILER_FLAGS =
244
245 # "STRICT_WARNINGS" turns on all warnings and forces them to be considered
246 # as errors when encountered.
247 #STRICT_WARNINGS = 
248
249 # "LIBRARIAN_FLAGS" are flags that need to be passed to the library tool
250 # that creates static code libraries.
251 #LIBRARIAN_FLAGS =
252
253 # "SOURCE" is the list of files that are turned into objects.
254 #SOURCE =
255
256 # "LIBS_USED" are system or compiler code libraries that the targets to be
257 # created depend upon.
258 #LIBS_USED =
259
260 # "LOCAL_LIBS_USED" is very similar to the LIBS_USED, but these libraries
261 # actually cause executables and object files to be recompiled when the
262 # libraries specified have changed.  To accomplish this, these libraries MUST
263 # be located in the STATIC_LIBRARY_DIR rather than at some arbitrary place
264 # on the LIBRARY_SEARCH_PATH.
265 #LOCAL_LIBS_USED =
266
267 # Load flags tell the linker and loader how to deal with the files and where
268 # to locate library components.  The prefix goes before object files are
269 # listed, and the suffix after.  The prefix should have things like the
270 # directories to be searched for code libraries (although they should be added
271 # to LIBRARY_SEARCH_PATH) and the loading mode for functions (static/dynamic).
272 # In the suffix, actual library loading statements (like -lmath) can be
273 # included (although they should be listed in a different form in LIBS_USED).
274 # Remember that the unix loader looks for functions in libraries in a bizarre
275 # way: ld searches for a function only when it has already been asked for it.
276 # This means that it doesn't remember what functions it has already been
277 # provided with in the libraries and object files, and it will fail if those
278 # functions are only asked for after they have already been encountered.
279 #LOAD_FLAG_PREFIX =
280 #LOAD_FLAG_SUFFIX =
281
282 # The prefix used on library names, mostly for unix.
283 LIB_PREFIX =
284 # The standard suffix for static or import libraries on this operating system.
285 LIB_ENDING =
286
287 # Flag for specifying the library name to create.
288 #CREATE_LIBRARY_FLAG =
289
290 # Flag for specifying a library to include in linking.
291 LIBRARY_NAME_FLAG = -l
292
293 # Flag for specifying a directory to add to the search path for libs.
294 #LIBRARY_PATH_FLAG = -L
295
296 # Flag for specifying the name of an output from the linker.
297 #LINKER_OUTPUT_FLAG =
298
299 # Flag for separating linker options from compilation options for a combined
300 # compiler / linker.
301 #LINKER_OPTION_SEPARATOR =
302
303 # Flag that passes special options when building executable programs.  It is
304 # passed just before the LOAD_FLAG_PREFIX.
305 #EXE_FLAGS = 
306
307 # The name of the compiler tool.
308 #CC =
309
310 # The name of the library creator tool.
311 #LIBRARY_TOOL =
312
313 # the root name of the version file.  This is currently irrelevant on
314 # non-win32 platforms.
315 VERSION_RC_ROOT = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/rc_name.sh)
316   # we import the rc_name from our close ally, the c++ compiler definitions.
317
318 ###############################################################################
319
320 # Compiler Dependent Flags
321 #
322 # "COMPILER_ROOT_DIR" is the top-level for the C++ compiler location.
323 # "COMPILER_HEADER_DIR" is where the compiler's headers are.
324 export COMPILER_HEADER_DIR
325 # "COMPILER_LIBRARY_DIR" is where archived libraries are.
326 # "CC" is the name of the C++ compiler to be used.
327
328 ifeq "$(COMPILER)" "VISUAL_CPP"
329   # microsoft visual studio 7.
330
331   LIB_ENDING = .dll
332   PLATFORM_ADD_IN = w32_
333
334   # these define special characteristics for a program being built.
335   #   BASE is almost always defined and pulls in fundamental w32 support.
336   #   RPC supplies the remote procedure call libraries.
337   #   OLE pulls in object linking and embedding support.
338   #   SECURITY links with the w32 security APIs.
339   #   CLR sets options that are appropriate for managed code.
340   VCPP_USE_BASE=true
341   VCPP_USE_RPC=
342   VCPP_USE_OLE=
343   VCPP_USE_SECURITY=
344   VCPP_USE_CLR=
345   VCPP_VISTA_ICON=
346
347   # the framework dir points at the .net framework to be used for compilation.
348   ifeq "$(FRAMEWORK_VERSION)" ""
349
350     # older .net 1.1.
351 #    SHORT_FRAMEWORK_VERSION = 1.1
352 #    FRAMEWORK_VERSION = $(SHORT_FRAMEWORK_VERSION).4322
353
354     # old .net 2.0.
355 #    SHORT_FRAMEWORK_VERSION = 2.0
356 #    FRAMEWORK_VERSION = $(SHORT_FRAMEWORK_VERSION).50727
357
358     # current .net 3.5.
359     SHORT_FRAMEWORK_VERSION = 3.5
360     FRAMEWORK_VERSION = $(SHORT_FRAMEWORK_VERSION)
361
362   endif
363   export FRAMEWORK_DIR 
364   ifeq "$(FRAMEWORK_DIR)" ""
365     FRAMEWORK_DIR = $(subst \,/,$(WINDIR))/Microsoft.NET/Framework/v$(FRAMEWORK_VERSION)
366   endif
367
368   # pick a default compiler version for what we tend to use the most at the
369   # current time.
370   ifeq "$(COMPILER_VERSION)" ""
371     COMPILER_VERSION = 7
372   endif
373 ##  DEFINITIONS += COMPILER_VERSION=$(COMPILER_VERSION)
374     # add a macro so programs can check what version is appropriate.
375
376   # C# needs an entry point for exes.  a different one can be specified also.
377   ENTRY_POINT = main
378
379   # C# treats resources differently than simple code files.  the list in this
380   # variable will be embedded in the target.
381   #RESX = 
382
383   # TLBEXPORT is a tool to create TLB files from DLL files.
384   TLBEXPORT = $(COMPILER_ROOT_DIR)/../SDK/v$(SHORT_FRAMEWORK_VERSION)/bin/tlbexp$(EXE_END)
385
386   # calculate the visual studio root directory.
387   export VIS_STU_ROOT := $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/ms_root_dir.sh $(CLAM_BINARIES) )
388   ifneq "$(VIS_STU_ROOT)" ""
389     COMPILER_ROOT_DIR = $(VIS_STU_ROOT)/vc#
390   endif
391   ifeq "$(COMPILER_ROOT_DIR)" ""
392     HOSEUP = $(shell echo The compiler directory is not set.  Please define the environment )
393     HOSEUP = $(shell echo variable VSxCOMNTOOLS to point at the folder where visual C++ is installed. )
394     HOSEUP =
395   endif
396
397   export COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(COMPILER) $(COMPILER_ROOT_DIR) )
398
399   # set a variable for the resource compiler for old-style resources.
400   STANDARD_RC = $(VIS_STU_ROOT)/vc/bin/rc
401
402   # set up a directory for debugging files to be stored.  these are not
403   # moved with the postconditions--they are generated in place.
404   export PDB_DIR=$(TARGETS_STORE)/pdb
405
406   # set these way up here so we can override them later.
407   CC                      = bash $(CLAM_SCRIPTS)/csharp/csharper.sh
408 ##$(FRAMEWORK_DIR)/csc
409
410 #  LINK_TOOL               = $(COMPILER_ROOT_DIR)/bin/link
411
412   # vary the locations for compiler files based on the version.
413   COMPILER_HEADER_DIR = $(VIS_STU_ROOT)/vc/include $(VIS_STU_ROOT)/vc/atlmfc/include $(VIS_STU_ROOT)/vc/platformsdk/include
414   COMPILER_LIBRARY_DIR = 
415 ###$(COMPILER_ROOT_DIR)/lib $(COMPILER_ROOT_DIR)/atlmfc/lib $(COMPILER_ROOT_DIR)/platformsdk/lib
416   RC = $(COMPILER_ROOT_DIR)/../SDK/v2.0/bin/resgen$(EXE_END)
417
418   ifeq "$(COMPILER_HEADER_DIR)" ""
419     HOSEUP = $(shell echo The compiler version is not set.  Please define COMPILER_VERSION.)
420   endif
421
422   DEFINITIONS            += _Windows _WINDOWS WIN32 __WIN32__ __FLAT__ VC_EXTRALEAN WIN32_LEAN_AND_MEAN ATL_NO_LEAN_AND_MEAN _WIN32_WINNT=0x403
423   DEF_FILE                =
424   LIBRARY_TOOL            = $(COMPILER_ROOT_DIR)/bin/lib
425   LOAD_FLAG_PREFIX        = -nologo
426 #-subsystem:windows -machine:IX86 
427   LOAD_FLAG_SUFFIX        =
428
429   MIDL                    = midl -Oicf $(MIDL_DEFS) $(HEADER_SEARCH_PATH:%=-I% ) $(DEFINITIONS:%=-I% )
430   MIDL_DEFS               = -no_robust
431
432   # set the flags used by visual c++.
433   CREATE_LIBRARY_FLAG     = -out:
434   LIBRARY_NAME_FLAG       = -reference:
435   LIBRARY_PATH_FLAG       = -lib:
436   LINKER_OPTION_SEPARATOR = -link
437   LINKER_OUTPUT_FLAG      = -out:
438
439   # Add the extra files created by visual c++.
440 #is this needed now that we whack whole output path?  CLEANUPS += $(OUTPUT_PATH)/*.*db
441
442   # put the common flags into the compiler flags.
443   COMPILER_FLAGS += -nologo 
444 #-Fd$(PDB_DIR)/$(PROJECT)_bookkeeping.pdb -GR -GX -W3 -Zi -EHsc -GS -Gd
445
446   ifneq "$(DEBUG)" ""
447     # disable function inlining and optimizations for debug.
448 #    COMPILER_FLAGS += -Ob0 -Od
449   else
450     # enable function inlining for release only.
451 #    COMPILER_FLAGS += -Ob1
452
453     ifneq "$(OPTIMIZE)" ""
454       # add in fast code optimization.
455 #testing...
456 #      COMPILER_FLAGS += -O2
457 #trying O2 again although it seems to combust too easily.
458     else
459       # no optimizations.
460     endif
461
462   endif
463
464   # check if profiling is to be enabled.
465   PROFILER_FLAG =
466   ifneq "$(PROFILE)" ""
467     PROFILER_FLAG = -profile
468   endif
469
470   # add the common linker flags.  the debugging flag is added because we
471   # want to be able to debug into release code, but since the pdb files
472   # are separate, we're not exposing ourselves when we don't include them.
473   LOAD_FLAG_PREFIX += $(PROFILER_FLAG) -debug
474 #-warn:3
475
476   # "USE_MFC" dictates whether mfc should be allowed in the application.
477   # the default is not to use MFC extension style dlls.  this can be turned
478   # on in the individual makefiles that require MFC.
479   #USE_MFC =
480
481   # the library creator gets a couple of flags.
482   LIBRARIAN_FLAGS += -nologo -machine:IX86
483
484   # now, vary the flag configuration based on the flags that have been set.
485
486   ifneq "$(CONSOLE_MODE)" ""
487     # console type of applications are built using the static flag so that
488     # they are more redistributable.
489     DEFINITIONS += _CONSOLE
490 ###    LOAD_FLAG_SUFFIX += -subsystem:console
491     STATIC = true
492   endif
493
494   # dynamically linked library or application flags.
495   ifneq "$(DEBUG)" ""
496     # debug.
497     DEFINITIONS += _DEBUG
498 #    COMPILER_FLAGS += -MDd
499   else
500     # release.
501     DEFINITIONS += NDEBUG
502 #    COMPILER_FLAGS += -MD
503   endif
504
505   ifneq "$(STRICT_WARNINGS)" ""
506 #    COMPILER_FLAGS       += -W3 -WX
507     # we have not turned on W4 because it is not really warnings for the
508     # microsoft compiler.  instead, it is a bunch of blather about what the
509     # compiler intends to do rather than problems in the code.
510   endif
511
512 endif
513
514