this removes the visual studio compiler support, which was a nasty bit of glue and tacks.
we're moving to commodity gcc for our builds, which means we can leave behind a lot of ugly special casing for microsoft's bent way of doing things.
COMPILER=$1
COMPILER_ROOT_DIR=$2
if [ "$COMPILER" = "GNU_LINUX" \
- -o "$COMPILER" = "GNU_DARWIN" ]; then
+ -o "$COMPILER" = "GNU_DARWIN" \
+ -o "$COMPILER" = "GNU_WINDOWS" ]; then
# compiler version report for the gnu compiler on linux and darwin.
# older code is needed for some versions of gcc / suse.
elif [ "$COMPILER" = "GNU_ARM_LINUX" ]; then
# compiler version report for the gnu compiler on the arm processor.
gcc -### 2>&1 | grep "gcc version" | sed -e 's/^gcc version \([0-9.][0-9.]*\) .*$/\1/'
-elif [ "$COMPILER" = "VISUAL_CPP" ]; then
- # compiler version report for ms visual studio.
- ver_raw=`$COMPILER_ROOT_DIR/bin/cl 2>&1 | head -1 | sed -e 's/.*Version \([0-9][0-9]*\)\..*$/\1/'`
- if [ "$ver_raw" = "12" ]; then echo 6;
- elif [ "$ver_raw" = "13" ]; then echo 7;
- elif [ "$ver_raw" = "14" ]; then echo 8;
- elif [ "$ver_raw" = "15" ]; then echo 9;
- elif [ "$ver_raw" = "16" ]; then echo 10;
- fi
+#elif [ "$COMPILER" = "VISUAL_CPP" ]; then
+# # compiler version report for ms visual studio.
+# ver_raw=`$COMPILER_ROOT_DIR/bin/cl 2>&1 | head -1 | sed -e 's/.*Version \([0-9][0-9]*\)\..*$/\1/'`
+# if [ "$ver_raw" = "12" ]; then echo 6;
+# elif [ "$ver_raw" = "13" ]; then echo 7;
+# elif [ "$ver_raw" = "14" ]; then echo 8;
+# elif [ "$ver_raw" = "15" ]; then echo 9;
+# elif [ "$ver_raw" = "16" ]; then echo 10;
+# fi
else
echo "0"
fi
+++ /dev/null
-#!/bin/bash
-# spits out the root directory of visual studio, calculated from the common
-# tools directory that always seems to be reliably set.
-
-# code snagged from vis_stu_vars...
-if [ -z "$VSxTOOLS" ]; then
- export VSxTOOLS="$VS90COMNTOOLS"
- if [ -z "$VSxTOOLS" ]; then
- export VSxTOOLS="$VS80COMNTOOLS"
- fi
-fi
-if [ -z "$VSxTOOLS" ]; then
- #echo Failure to locate visual studio tools.
- # don't want to echo anything; need to be able to check that this provided nothing.
- exit 33
-fi
-
-cygpath -w -s "$VSxTOOLS" | sed -e 's/\\/\//g' | sed -e 's/^\(.*\)\/[^\/]*\/[^\/]*[\/]$/\1/'
-
# This file composite macros and rules for creating compilation objects
# (such as library archives, object files, executable programs, and others).
-# This file should be included in the user's Makefile after the variables
+# This file should be included in the user Makefile after the variables
# have been initialized appropriately for the particular project being
-# compiled. The user's own targets should be placed after the include
+# compiled. The user targets should be placed after the include
# directive that specifies this file.
###############################################################################
ifneq "$(ENABLE_FREETDS)" ""
# establish the headers if freetds is enabled. that just means things
# can be compiled against it. to link in the db-lib, the makefile should
- # have a 'USE_FREETDS = true' statement.
+ # have a "USE_FREETDS = true" statement.
# is this particular library or app using freetds?
ifneq "$(USE_FREETDS)" ""
endif
endif
-# win32 compiler additions.
-#ifeq "$(OP_SYSTEM)" "WIN32"
-ifeq "$(COMPILER)" "VISUAL_CPP"
- # processes the def file for linkage, if one has been specified.
- ifneq "$(DEF_FILE)" ""
- LOAD_FLAG_PREFIX += -def:$(DEF_FILE)
- endif
-
- ifneq "$(TYPE)" "library"
- ifneq "$(USE_MFC)" ""
- ifneq "$(findstring UNICODE, $(DEFINITIONS))" ""
- # specify the winmain type for unicode explicitly.
- LOAD_FLAG_PREFIX += -entry:wWinMainCRTStartup
- endif
- endif
- endif
-
- # these are loaded after any special debugging libs.
- ifneq "$(VCPP_USE_BASE)" ""
- # the first set will be included in almost any old program. we include
- # winmm for multimedia in the base support since we make heavy use of the
- # more accurate uptime function.
- LOAD_FLAG_PREFIX += kernel32.lib user32.lib advapi32.lib shell32.lib \
- version.lib winmm.lib shlwapi.lib
- endif
-
- ifneq "$(USE_WXWIDGETS)" ""
- DEFINITIONS += __WXWIDGETS__ __WXMSW__
- LOCAL_HEADERS += $(THIRD_PARTY_DIR)/wxwidgets/include
- LIBRARY_SEARCH_PATH += $(THIRD_PARTY_DIR)/wxwidgets/lib
-# ifeq "$(findstring UNICODE, $(DEFINITIONS))" ""
- LIBS_USED += wxmsw28_core.lib
- LOCAL_HEADERS += $(THIRD_PARTY_DIR)/wxwidgets/lib/msw
-# else
-# DEFINITIONS += wxUSE_UNICODE
-# LIBS_USED += wxmsw28u_core.lib
-# LOCAL_HEADERS += $(THIRD_PARTY_DIR)/wxwidgets/lib/mswu
+## win32 compiler additions.
+##ifeq "$(OP_SYSTEM)" "WIN32"
+#ifeq "$(COMPILER)" "VISUAL_CPP"
+# # processes the def file for linkage, if one has been specified.
+# ifneq "$(DEF_FILE)" ""
+# LOAD_FLAG_PREFIX += -def:$(DEF_FILE)
+# endif
+#
+# ifneq "$(TYPE)" "library"
+# ifneq "$(USE_MFC)" ""
+# ifneq "$(findstring UNICODE, $(DEFINITIONS))" ""
+# # specify the winmain type for unicode explicitly.
+# LOAD_FLAG_PREFIX += -entry:wWinMainCRTStartup
+# endif
# endif
+# endif
+#
+# # these are loaded after any special debugging libs.
+# ifneq "$(VCPP_USE_BASE)" ""
+# # the first set will be included in almost any old program. we include
+# # winmm for multimedia in the base support since we make heavy use of the
+# # more accurate uptime function.
+# LOAD_FLAG_PREFIX += kernel32.lib user32.lib advapi32.lib shell32.lib \
+# version.lib winmm.lib shlwapi.lib
+# endif
+#
+# ifneq "$(USE_WXWIDGETS)" ""
+# DEFINITIONS += __WXWIDGETS__ __WXMSW__
+# LOCAL_HEADERS += $(THIRD_PARTY_DIR)/wxwidgets/include
+# LIBRARY_SEARCH_PATH += $(THIRD_PARTY_DIR)/wxwidgets/lib
+## ifeq "$(findstring UNICODE, $(DEFINITIONS))" ""
+# LIBS_USED += wxmsw28_core.lib
+# LOCAL_HEADERS += $(THIRD_PARTY_DIR)/wxwidgets/lib/msw
+## else
+## DEFINITIONS += wxUSE_UNICODE
+## LIBS_USED += wxmsw28u_core.lib
+## LOCAL_HEADERS += $(THIRD_PARTY_DIR)/wxwidgets/lib/mswu
+## endif
+#
+### LOAD_FLAG_PREFIX += comctl32.lib shell32.lib
+# VCPP_USE_GUI = t
+# VCPP_USE_OLE = t
+# endif
+#
+# ifneq "$(USE_CURL)" ""
+## # curl wants this win32 flag?
+# DEFINITIONS += WIN32
+# LOCAL_HEADERS += $(THIRD_PARTY_DIR)/curl/include
+# LIBRARY_SEARCH_PATH += $(THIRD_PARTY_DIR)/curl/lib
+## LIBS_USED += libcurl.dll.a
+# LIBS_USED += libcurl.lib
+# endif
+#
+# ifneq "$(VCPP_USE_GUI)" ""
+# LOAD_FLAG_PREFIX += comctl32.lib comdlg32.lib gdi32.lib winspool.lib
+# endif
+#
+# ifneq "$(VCPP_USE_OLE)" ""
+# LOAD_FLAG_PREFIX += ole32.lib oleaut32.lib uuid.lib
+# VCPP_USE_RPC = t
+# endif
+# ifneq "$(VCPP_USE_RPC)" ""
+# ifeq "$(COMPILER_VERSION)" "8"
+# LOAD_FLAG_PREFIX += rpcndr.lib rpcns4.lib rpcrt4.lib
+# endi#f
+# ifeq "$(COMPILER_VERSION)" "10"
+# LOAD_FLAG_PREFIX += rpcrt4.lib
+# endif
+# VCPP_USE_SOCK = t
+# endif
+# ifneq "$(VCPP_USE_SOCK)" ""
+# LOAD_FLAG_PREFIX += netapi32.lib ws2_32.lib
+# endif
+# ifneq "$(VCPP_USE_CLR)" ""
+# LOAD_FLAG_PREFIX += -noentry -include:"__DllMainCRTStartup@12"
+# COMPILER_FLAGS += -EHa -clr -AI "$(FRAMEWORK_DIR)" -AI "$(DYNAMIC_LIBRARY_DIR)" -FU "mscorlib.dll" -FU "System.dll" -FU "System.Data.dll" -FU "System.Windows.Forms.dll" -FU "System.Drawing.dll"
+# endif
+#
+# ifneq "$(USE_SSL)" ""
+# LOCAL_HEADERS += $(THIRD_PARTY_DIR)/openssl/include
+# LIBRARY_SEARCH_PATH += $(THIRD_PARTY_DIR)/openssl/lib
+# LIBS_USED += libcrypto.lib libssl.lib
+##no, yuck. $(shell cp $(THIRD_PARTY_DIR)/openssl/lib/*dll $(EXECUTABLE_DIR) )
+# endif
+#
+#endif
-## LOAD_FLAG_PREFIX += comctl32.lib shell32.lib
- VCPP_USE_GUI = t
- VCPP_USE_OLE = t
- endif
-
- ifneq "$(USE_CURL)" ""
-# # curl wants this win32 flag?
- DEFINITIONS += WIN32
- LOCAL_HEADERS += $(THIRD_PARTY_DIR)/curl/include
- LIBRARY_SEARCH_PATH += $(THIRD_PARTY_DIR)/curl/lib
-# LIBS_USED += libcurl.dll.a
- LIBS_USED += libcurl.lib
- endif
-
- ifneq "$(VCPP_USE_GUI)" ""
- LOAD_FLAG_PREFIX += comctl32.lib comdlg32.lib gdi32.lib winspool.lib
- endif
-
- ifneq "$(VCPP_USE_OLE)" ""
- LOAD_FLAG_PREFIX += ole32.lib oleaut32.lib uuid.lib
- VCPP_USE_RPC = t
- endif
- ifneq "$(VCPP_USE_RPC)" ""
- ifeq "$(COMPILER_VERSION)" "8"
- LOAD_FLAG_PREFIX += rpcndr.lib rpcns4.lib rpcrt4.lib
- endif
- ifeq "$(COMPILER_VERSION)" "10"
- LOAD_FLAG_PREFIX += rpcrt4.lib
- endif
- VCPP_USE_SOCK = t
- endif
- ifneq "$(VCPP_USE_SOCK)" ""
- LOAD_FLAG_PREFIX += netapi32.lib ws2_32.lib
- endif
- ifneq "$(VCPP_USE_CLR)" ""
- LOAD_FLAG_PREFIX += -noentry -include:"__DllMainCRTStartup@12"
- COMPILER_FLAGS += -EHa -clr -AI "$(FRAMEWORK_DIR)" -AI "$(DYNAMIC_LIBRARY_DIR)" -FU "mscorlib.dll" -FU "System.dll" -FU "System.Data.dll" -FU "System.Windows.Forms.dll" -FU "System.Drawing.dll"
- endif
-
- ifneq "$(USE_SSL)" ""
- LOCAL_HEADERS += $(THIRD_PARTY_DIR)/openssl/include
- LIBRARY_SEARCH_PATH += $(THIRD_PARTY_DIR)/openssl/lib
- LIBS_USED += libcrypto.lib libssl.lib
-#no, yuck. $(shell cp $(THIRD_PARTY_DIR)/openssl/lib/*dll $(EXECUTABLE_DIR) )
- endif
-
-endif
-
-#ifeq "$(OP_SYSTEM)" "WIN32"
-ifeq "$(COMPILER)" "VISUAL_CPP"
- # prep the actual source variable so that certain file names are translated.
- ACTUAL_RESX = $(RESX:%.resx=$(OBJECT_DIR)/%.resources)
- ACTUAL_RESX_FLAGS = $(ACTUAL_RESX:%=-ASSEMBLYLINKRESOURCE:%)
-else
+#ifeq "$(COMPILER)" "VISUAL_CPP"
+# # prep the actual source variable so that certain file names are translated.
+# ACTUAL_RESX = $(RESX:%.resx=$(OBJECT_DIR)/%.resources)
+# ACTUAL_RESX_FLAGS = $(ACTUAL_RESX:%=-ASSEMBLYLINKRESOURCE:%)
+#else
ACTUAL_RESX =
ACTUAL_RESX_FLAGS =
-endif
+#endif
# Create the real list of local libraries needed.
TEMP_LOC1 = $(LOCAL_LIBS_USED:%=%$(TRIPART_VERSION))
# Create the list of objects from the list of source files.
TEMP_OBJ1 = $(SOURCE:%.cpp=%.obj)
TEMP_OBJ2 = $(TEMP_OBJ1:%.c=%.obj)
-ifeq "$(COMPILER)" "VISUAL_CPP"
- ifneq "$(OMIT_VERSIONS)" ""
- # remove version rc files if we're not dealing with versions.
- TEMP_OBJ3a = $(TEMP_OBJ2:%_version.rc=)
- else
- TEMP_OBJ3a = $(TEMP_OBJ2)
- endif
- ifeq "$(COMPILER)" "VISUAL_CPP"
- TEMP_OBJ3 = $(TEMP_OBJ3a:%.rc=%.res)
- else
- TEMP_OBJ3 = $(TEMP_OBJ3a)
- endif
-else
- # replace this when supporting resource files on unix.
- TEMP_OBJ3 = $(TEMP_OBJ2:%.rc=)
-endif
+#ifeq "$(COMPILER)" "VISUAL_CPP"
+# ifneq "$(OMIT_VERSIONS)" ""
+# # remove version rc files if we are not dealing with versions.
+# TEMP_OBJ3a = $(TEMP_OBJ2:%_version.rc=)
+# else
+# TEMP_OBJ3a = $(TEMP_OBJ2)
+# endif
+# ifeq "$(COMPILER)" "VISUAL_CPP"
+# TEMP_OBJ3 = $(TEMP_OBJ3a:%.rc=%.res)
+# else
+# TEMP_OBJ3 = $(TEMP_OBJ3a)
+# endif
+#else
+
+# replace this when supporting resource files on unix.
+TEMP_OBJ3 = $(TEMP_OBJ2:%.rc=)
+
+#endif
+
TEMP_OBJ4 = $(TEMP_OBJ3:%.h=%.bad)
OBJECTS = $(TEMP_OBJ4)
# prepare for mfc style DLLs. currently we plan on all dlls we create being
# based on MFC. this is an unfortunate requirement for using the mfc debug
-# support for allocations; if regular new and DEBUG_NEW get mixed together,
+# support for allocations. if regular new and DEBUG_NEW get mixed together,
# crashes used to result. supposedly these are gone now at least.
ifneq "$(USE_MFC)" ""
-# ifeq "$(OP_SYSTEM)" "WIN32"
- ifeq "$(COMPILER)" "VISUAL_CPP"
- # set the flag that says we are doing mfc extension dlls.
- DEFINITIONS += _AFXDLL
- DEPENDENCY_DEFINITIONS += _MT _DLL
- DEPENDENCY_DEFINITIONS += __AFXWIN_H__ # add this flag to shut stdafx up.
- endif
+# ifeq "$(COMPILER)" "VISUAL_CPP"
+# # set the flag that says we are doing mfc extension dlls.
+# DEFINITIONS += _AFXDLL
+# DEPENDENCY_DEFINITIONS += _MT _DLL
+# DEPENDENCY_DEFINITIONS += __AFXWIN_H__ # add this flag to shut stdafx up.
+# endif
endif
ifeq "$(OMIT_VERSIONS)" ""
# Adds the primary targets to the list of products to create.
#ifeq "$(NO_COMPILE)" ""
- ifneq "$(COMPILER)" "VISUAL_CPP"
+ ifneq "$(OP_SYSTEM)" "WIN32"
ACTUAL_TARGETS1 = $(TARGETS:%.exe=$(EXECUTABLE_DIR)/%)
else
ACTUAL_TARGETS1 = $(TARGETS:%.exe=$(EXECUTABLE_DIR)/%.exe)
endif
- ifneq "$(COMPILER)" "VISUAL_CPP"
+ ifneq "$(OP_SYSTEM)" "WIN32"
ACTUAL_TARGETS2 = $(ACTUAL_TARGETS1:%.dll=%.so)
ACTUAL_TARGETS3 = $(ACTUAL_TARGETS2:%.so=$(DYNAMIC_LIBRARY_DIR)/%$(TRIPART_VERSION).so)
else
#hmmm: fix this.
# Adds the main CLAM system in to get some work done. This should be placed
-# after the module's rules are defined and before the module's targets are
+# after the module rules are defined and before the module targets are
# defined.
include rules.def
$(OBJECT_DIR)/%.obj: $(CURRENT_DIR)/%.cpp
ifeq "$(NO_COMPILE)" ""
- ifneq "$(COMPILER)" "VISUAL_CPP"
+# ifneq "$(COMPILER)" "VISUAL_CPP"
@echo Compiling Object [$(notdir $@)]
$(HIDESH)-c 'if [ ! -d $(@D) ]; then mkdir $(@D); fi'
$(CATCHER)$(CC) $(COMPILER_FLAGS) -c $< $(OBJECT_NAME_FLAG)$@
- else
- @echo $< >>$(BUILD_LIST_FILE)
- @echo $@ >>$(BUILD_WHACK_FILE)
- @echo >$@
- endif
+# else
+# @echo $< >>$(BUILD_LIST_FILE)
+# @echo $@ >>$(BUILD_WHACK_FILE)
+# @echo >$@
+# endif
endif
############################################################################
$(OBJECT_DIR)/%.obj: $(CURRENT_DIR)/%.c
ifeq "$(NO_COMPILE)" ""
- ifneq "$(COMPILER)" "VISUAL_CPP"
+# ifneq "$(COMPILER)" "VISUAL_CPP"
@echo Compiling Object [$(notdir $@)]
$(HIDESH)-c 'if [ ! -d $(@D) ]; then mkdir $(@D); fi'
$(CATCHER)$(CC) $(COMPILER_FLAGS) -c $< $(OBJECT_NAME_FLAG)$@
- else
- @echo $< >>$(BUILD_LIST_FILE)
- @echo $@ >>$(BUILD_WHACK_FILE)
- @echo >$@
- endif
+# else
+# @echo $< >>$(BUILD_LIST_FILE)
+# @echo $@ >>$(BUILD_WHACK_FILE)
+# @echo >$@
+# endif
endif
############################################################################
# resource compiler for win32.
-ifeq "$(COMPILER)" "VISUAL_CPP"
-$(OBJECT_DIR)/%.res: %.rc $(PARAMETER_FILE)
- ifeq "$(NO_COMPILE)" ""
- @echo Resource [$@]
- $(HIDESH)-c 'if [ ! -d $(@D) ]; then mkdir $(@D); fi'
- $(CATCHER)$(RC) -r $(DEFINITIONS:%=-D%) $(HEADER_SEARCH_PATH:%=-i%) -fo $@ $<
- endif
-
-$(OBJECT_DIR)/%.resources: %.resx $(PARAMETER_FILE)
- ifeq "$(NO_COMPILE)" ""
- @echo Resource [$@]
- $(HIDESH)-c 'if [ ! -d $(@D) ]; then mkdir $(@D); fi'
- $(VCS_ROOT)/../SDK/v1.1/bin/resgen $< $@
- endif
-else #non-visual studio
+#ifeq "$(COMPILER)" "VISUAL_CPP"
+#$(OBJECT_DIR)/%.res: %.rc $(PARAMETER_FILE)
+# ifeq "$(NO_COMPILE)" ""
+# @echo Resource [$@]
+# $(HIDESH)-c 'if [ ! -d $(@D) ]; then mkdir $(@D); fi'
+# $(CATCHER)$(RC) -r $(DEFINITIONS:%=-D%) $(HEADER_SEARCH_PATH:%=-i%) -fo $@ $<
+# endif
+#
+#$(OBJECT_DIR)/%.resources: %.resx $(PARAMETER_FILE)
+# ifeq "$(NO_COMPILE)" ""
+# @echo Resource [$@]
+# $(HIDESH)-c 'if [ ! -d $(@D) ]; then mkdir $(@D); fi'
+# $(VCS_ROOT)/../SDK/v1.1/bin/resgen $< $@
+# endif
+#else #non-visual studio
# this platform probably does not use rc files.
$(OBJECT_DIR)/%.res: %.rc
ifeq "$(NO_COMPILE)" ""
@echo Bogus resource [$@]
@echo >$@
endif
-endif #win32
+#endif #win32
############################################################################
$(STATIC_LIBRARY_DIR)/%.library: $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(PARAMETER_FILE)
$(HIDER)echo Building Static Library [$(notdir $@)]
@echo $@ >$(DIRTY_FILE)
- ifeq "$(COMPILER)" "VISUAL_CPP"
- $(HIDESH)-c 'if [ -f $(BUILD_LIST_FILE) ]; then $(SHELL) $(CLAM_SCRIPTS)/cpp/rebuild_oldies.sh $(MULTI_BUILD_CMD); fi'
- endif
+# ifeq "$(COMPILER)" "VISUAL_CPP"
+# $(HIDESH)-c 'if [ -f $(BUILD_LIST_FILE) ]; then $(SHELL) $(CLAM_SCRIPTS)/cpp/rebuild_oldies.sh $(MULTI_BUILD_CMD); fi'
+# endif
$(CATCHER)$(LIBRARY_TOOL) $(LIBRARIAN_FLAGS) $(CREATE_LIBRARY_FLAG)$@ $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%)
ifneq "$(OP_SYSTEM)" "UNIX"
$(HIDER)mv $@ $(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)$*$(LIB_ENDING)
# we whack any existing LIB file, since we want to use changes in that file
# as a clue for when we should rescan the dependencies. we'd be fine if
-# visual c++ didn't keep an existing LIB if it doesn't change (even when the
+# visual c++ didn't keep an existing LIB if it does not change (even when the
# DLL does).
ifneq "$(NO_COMPILE)" ""
###$(RES_OBJECTS)
$(HIDER)echo Building Dynamic Library [$(notdir $@)]
@echo $@ >$(DIRTY_FILE)
- ifeq "$(COMPILER)" "VISUAL_CPP"
- $(HIDESH)-c 'if [ -f $(BUILD_LIST_FILE) ]; then $(SHELL) $(CLAM_SCRIPTS)/cpp/rebuild_oldies.sh $(MULTI_BUILD_CMD); fi'
- endif
+# ifeq "$(COMPILER)" "VISUAL_CPP"
+# $(HIDESH)-c 'if [ -f $(BUILD_LIST_FILE) ]; then $(SHELL) $(CLAM_SCRIPTS)/cpp/rebuild_oldies.sh $(MULTI_BUILD_CMD); fi'
+# endif
+#hmmm: this is way way out of date. not right now.
$(HIDER)rm -f $(@:%.dll=%.lib)
echo about to run link tool.
$(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)
# creates "exe" executables using all of the appropriate objects.
-ifeq "$(COMPILER)" "VISUAL_CPP"
- ifneq "$(NO_COMPILE)" ""
-$(EXECUTABLE_DIR)/%.exe:
- endif
-
- ifeq "$(NO_COMPILE)" ""
-$(EXECUTABLE_DIR)/%.exe: $(OBJECT_DIR)/%.obj $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(ACTUAL_RESX) $(PARAMETER_FILE)
- $(HIDER)echo Building Application [$(notdir $@)]
- @echo $@ >$(DIRTY_FILE)
- ifeq "$(COMPILER)" "VISUAL_CPP"
- $(HIDESH)-c 'if [ -f $(BUILD_LIST_FILE) ]; then $(SHELL) $(CLAM_SCRIPTS)/cpp/rebuild_oldies.sh $(MULTI_BUILD_CMD); fi'
- endif
- $(CATCHER)$(LINK_TOOL) $(EXE_FLAGS) $(LOAD_FLAG_PREFIX) $< $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_RESX_FLAGS) $(ACTUAL_LOCAL_LIBS:%=$(LIBRARY_NAME_FLAG)$(LIB_PREFIX)%$(LIB_ENDING)) $(LOAD_FLAG_SUFFIX) $(LINKER_OUTPUT_FLAG)$@
-#$(^:force_rebuild=)
- ifeq "$(COMPILER_VERSION)" "8"
- $(HIDESH)$(CLAM_SCRIPTS)/cpp/ms_manifest.sh "$@" "1"
- endif
- ifeq "$(COMPILER_VERSION)" "10"
- $(HIDESH)$(CLAM_SCRIPTS)/cpp/ms_manifest.sh "$@" "1"
- endif
- ifneq "$(VCPP_VISTA_ICON)" ""
- $(HIDER)ReplaceVistaIcon "$@" "$(VCPP_VISTA_ICON)"
- endif
- endif #no_compile
-endif #visual studio
+#ifeq "$(COMPILER)" "VISUAL_CPP"
+# ifneq "$(NO_COMPILE)" ""
+#$(EXECUTABLE_DIR)/%.exe:
+# endif
+#
+# ifeq "$(NO_COMPILE)" ""
+#$(EXECUTABLE_DIR)/%.exe: $(OBJECT_DIR)/%.obj $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(ACTUAL_RESX) $(PARAMETER_FILE)
+# $(HIDER)echo Building Application [$(notdir $@)]
+# @echo $@ >$(DIRTY_FILE)
+# ifeq "$(COMPILER)" "VISUAL_CPP"
+# $(HIDESH)-c 'if [ -f $(BUILD_LIST_FILE) ]; then $(SHELL) $(CLAM_SCRIPTS)/cpp/rebuild_oldies.sh $(MULTI_BUILD_CMD); fi'
+# endif
+# $(CATCHER)$(LINK_TOOL) $(EXE_FLAGS) $(LOAD_FLAG_PREFIX) $< $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_RESX_FLAGS) $(ACTUAL_LOCAL_LIBS:%=$(LIBRARY_NAME_FLAG)$(LIB_PREFIX)%$(LIB_ENDING)) $(LOAD_FLAG_SUFFIX) $(LINKER_OUTPUT_FLAG)$@
+##$(^:force_rebuild=)
+# ifeq "$(COMPILER_VERSION)" "8"
+# $(HIDESH)$(CLAM_SCRIPTS)/cpp/ms_manifest.sh "$@" "1"
+# endif
+# ifeq "$(COMPILER_VERSION)" "10"
+# $(HIDESH)$(CLAM_SCRIPTS)/cpp/ms_manifest.sh "$@" "1"
+# endif
+# ifneq "$(VCPP_VISTA_ICON)" ""
+# $(HIDER)ReplaceVistaIcon "$@" "$(VCPP_VISTA_ICON)"
+# endif
+# endif #no_compile
+#endif #visual studio
-ifneq "$(COMPILER)" "VISUAL_CPP"
+#ifneq "$(COMPILER)" "VISUAL_CPP"
ifneq "$(NO_COMPILE)" ""
$(EXECUTABLE_DIR)/%:
endif
#hmmm: experimental item below.
#$(^:force_rebuild=)
endif #no_compile
-endif #unix
+#endif #unix
############################################################################
deps: $(DEPS_FILE)
# this causes the dependency file to be regenerated if the sources or libs
- # have changed. we have to touch the deps file in case it's missing;
- # makedep doesn't deal well with that. also, we touch the dirty flag file
+ # have changed. we have to touch the deps file in case it is missing;
+ # makedep does not deal well with that. also, we touch the dirty flag file
# to ensure that the fact we redid dependencies for some reason causes us
- # to re-promote. we only bother with any of this if we know we're going
+ # to re-promote. we only bother with any of this if we know we are going
# to really do some compilation; if in non-compile mode, we'll skip it.
ifneq "$(NO_COMPILE)" ""
# no dependencies in non-compile mode.
# code. It is mainly used within CLAM itself for determining the proper
# compiler flags.
export COMPILER
-#COMPILER := GNU_LINUX | GNU_ARM_LINUX | GNU_DARWIN | GNU_WINDOWS | VISUAL_CPP
+#COMPILER := GNU_LINUX | GNU_ARM_LINUX | GNU_DARWIN | GNU_WINDOWS
+##| VISUAL_CPP
# choose a default compiler if none was specified.
ifeq "$(COMPILER)" ""
endif
endif
ifeq "$(OP_SYSTEM)" "WIN32"
-# COMPILER := GNU_WINDOWS
- COMPILER := VISUAL_CPP
+ COMPILER := GNU_WINDOWS
+# COMPILER := VISUAL_CPP
endif
ifeq "$(COMPILER)" ""
# if we get into this case, we have no idea how to set the default
# compiler specific section below.
############################################################################
-ifeq "$(COMPILER)" "GNU_LINUX"
+# wide open match of any compiler besides gnu darwin.
+#hmmm: this will erroneously match the arm one. but have we used that in a while?
+ifneq "$(COMPILER)" "GNU_DARWIN"
# Unix GNU compiler...
CC = g++
COMPILER_ROOT_DIR = /
ifeq "$(COMPILER)" "VISUAL_CPP"
# microsoft visual c++ 4.x, 5.x or 6.x.
+bork bork should not be here.
+
PLATFORM_ADD_IN = w32_
TRIPART_VERSION =
# load up the helper variables for visual studio on winders.
if [ "$OPERATING_SYSTEM" == "WIN32" ]; then
- source "$BUILD_SCRIPTS_PATH/vis_stu_vars.sh"
+#no. source "$BUILD_SCRIPTS_PATH/vis_stu_vars.sh"
+ # we are trying to move back to our good path of using gcc, not visual studio.
+ # the visual studio rig was for version 6? a long time ago, and has withered
+ # on the vine. meanwhile gnu cc is still cooking along and available.
+#what vars needed?
+#trying just unixy ones, since we're doing cygwin on doze.
+export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TARGETS_STORE"
else
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$TARGETS_STORE"
fi
+++ /dev/null
-#!/bin/bash
-
-# this file attempts to provide all of the variables needed for compiling
-# with the microsoft visual studio compiler (dot net version). it requires
-# one environment variable (called VSxCOMNTOOLS) be set that points at the
-# location of the common tools in the visual studio installation.
-# The value of x can be 80, 90 or 100.
-
-function print_usage {
- echo "The VS80COMNTOOLS, VS90COMNTOOLS and VS100COMNTOOLS variables are not set."
- echo "This usually means that the Visual Studio compiler is not installed."
- echo ""
-}
-
-if [[ "$1" =~ .*help.* ]]; then
- print_usage
- exit 0
-fi
-
-function setup_visual_studio_variables()
-{
- # we try to use the most recent compiler location, and work backwards as
- # needed for the supported range (10 = vs 2010, 9 = vs 2008, 8 = vs 2005).
- export VSxTOOLS="$VS100COMNTOOLS"
- if [ -z "$VSxTOOLS" ]; then
- export VSxTOOLS="$VS90COMNTOOLS"
- if [ -z "$VSxTOOLS" ]; then
- export VSxTOOLS="$VS80COMNTOOLS"
- fi
- fi
-
- if [ -z "$VSxTOOLS" ]; then
- return 33
- fi
- export VSxTOOLS="$(cygpath -w -s "$VSxTOOLS" | tr "A-Z" "a-z" | sed -e 's/\\/\//g' )"
-#| sed -e 's/^\(.\):/\/\1/' )"
-
- export VIS_STU_ROOT="$(echo $VSxTOOLS | sed -e 's/^\(.*\)\/[^\/]*\/[^\/]*[\/]$/\1/' )"
-#| sed -e 's/^\(.\):/\/\1/' )"
- export VSINSTALLDIR="$VIS_STU_ROOT"
-
- export WINDIR="$(cygpath -w -s "$WINDIR" | tr A-Z a-z | sed -e 's/\\/\//g' )"
-#| sed -e 's/^\(.\):/\/\1/' )"
-
- export VCINSTALLDIR="$VSINSTALLDIR/VC"
- export VSCOMMONROOT="$VSINSTALLDIR/Common7"
- export VS_TOOLS_DIR="$VSCOMMONROOT/tools"
- export DevEnvDir="$VSCOMMONROOT/IDE"
- export MSVCDir="$VCINSTALLDIR"
- export FrameworkDir="$WINDIR/Microsoft.NET/Framework"
- export FrameworkVersion=v4.0.30319
- #old export FrameworkSDKDir="$VSINSTALLDIR/SDK/v2.0"
-
- export PLATFORM_DIR="$VCINSTALLDIR/PlatformSDK"
- if [ ! -d "$PLATFORM_DIR" ]; then
-
-#on hold: export PLATFORM_DIR="$(cygpath -w -s "$PROGRAMFILES/Microsoft SDKs/Windows/v7.0A" | tr "A-Z" "a-z" | sed -e 's/^\(.*\)\/[^\/]*\/[^\/]*[\/]$/\1/' )"
-##| sed -e 's/^\(.\):/\/\1/' )"
-
- # guess at where we can find this damned directory in its short form.
-#hmmm: this is needed until there's a replacement for short path, or we can build again.
- export PLATFORM_DIR="c:/progra~2/micros~1/windows/v7.0a"
- if [ ! -d "$PLATFORM_DIR" ]; then
- PLATFORM_DIR="c:/progra~1/micros~1/windows/v7.0a"
- if [ ! -d "$PLATFORM_DIR" ]; then
- PLATFORM_DIR="c:/progra~1/micros~2/windows/v7.0a"
- if [ ! -d "$PLATFORM_DIR" ]; then
- PLATFORM_DIR="c:/progra~2/micros~2/windows/v7.0a"
- fi
- fi
- fi
-
- if [ ! -d "$PLATFORM_DIR" ]; then
- echo "*** Failure to calculate the platform directory based on several attempts using c:\\program files\\microsoft sdks\\windows\\v7.0a as the basic pattern"
- fi
-
-
- fi
- export WindowsSdkDir="$PLATFORM_DIR"
-
- #echo "path before is $PATH"
- local filena
- for filena in "$DevEnvDir" "$VCINSTALLDIR/BIN" "$VSxTOOLS" "$VSxTOOLS/bin" "$FrameworkDir/$FrameworkVersion" "$FrameworkDir/v3.5" "$VCINSTALLDIR/VCPackages" "$VSINSTALLDIR/Common7/Tools" "$PLATFORM_DIR/bin"; do
- export PATH="$PATH:$(dos_to_unix_path $filena)"
- done
- #echo "path after is $PATH"
-
- export INCLUDE="$VCINSTALLDIR/ATLMFC/INCLUDE:$VCINSTALLDIR/INCLUDE:$PLATFORM_DIR/include"
- #:$FrameworkSDKDir/include"
-
- export LIB="$VCINSTALLDIR/ATLMFC/LIB:$VCINSTALLDIR/LIB:$PLATFORM_DIR/lib"
- #:$FrameworkSDKDir/lib"
-
- # convert framework dir back or things yell like hell.
- export FrameworkDir=$(unix_to_dos_path $FrameworkDir)
- # the redirection of stderr to null is to get around an obnoxious cygwin
- # warning that seems to be erroneously complaining about backslashes.
-
- ##############
-
- echo "calculated variables for dos/windoze builds:"
- var VIS_STU_ROOT VSxTOOLS WINDIR VSxTOOLS VSINSTALLDIR PLATFORM_DIR FrameworkDir
-
- ##############
-}
-
-# run the above, very nasty, function.
-setup_visual_studio_variables
-
-
--- /dev/null
+#!/bin/bash\r
+declare -a flipped=()\r
+for i in $*; do\r
+ flip=$(echo $i | sed -e 's/\/\([a-zA-Z]\)\//\1:\//' | tr '/' '\\')\r
+ flipped+=($flip)\r
+done\r
+${FRAMEWORK_DIR}/csc ${flipped[*]}\r
+\r
--- /dev/null
+#!/bin/bash
+# copies the final products of the current project into the repository.
+
+# check whether a failure should prevent promotion from occurring.
+if [ -f $FAILURE_FILE ]; then
+ echo Postconditions will not promote due to a failure:
+ cat $FAILURE_FILE
+ . $CLAM_SCRIPTS/exit_make.sh
+fi
+
+# make sure that we actually did something during the make.
+if [ ! -f "$DIRTY_FILE" -a ! -f "$SUBMAKE_FLAG" ]; then
+ # nothing was built, seemingly, so we do no promotion.
+ exit
+fi
+
+# toss the flag files so we don't see them again.
+rm -f "$DIRTY_FILE" "$SUBMAKE_FLAG"
+
+# clean up generated resource files after the build.
+for i in *.resources; do rm -f "$i"; done
+
+# these variables define the locations for final products. all of them
+# descend from the root of the repository.
+ROOT=$TARGETS_STORE
+LIB_DIR=$ROOT/lib
+DLL_DIR=$ROOT/dll
+EXE_DIR=$ROOT/exe
+TEST_ROOT=$ROOT/tests
+TEST_DIR=$TEST_ROOT/$PROJECT
+
+# causes the shell to quit.
+DIE=". $CLAM_SCRIPTS/exit_make.sh"
+
+if [ "$TYPE" = "library" ]; then
+
+ # make sure the required directories exist.
+ if [ ! -d $ROOT ]; then mkdir -p $ROOT; fi
+ if [ ! -d $LIB_DIR ]; then mkdir $LIB_DIR; fi
+ if [ ! -d $DLL_DIR ]; then mkdir $DLL_DIR; fi
+
+ if [ -z "$NO_COMPILE" ]; then
+ # we ensure that none of the normal products are copied for a non-compiling
+ # style of project.
+
+ # copy the import libraries for any DLLs.
+ if [ ! -z "`$FIND "$DYNAMIC_LIBRARY_DIR" -iname "*.lib"`" ]; then
+ echo Moving import libraries to $LIB_DIR.
+ mv "$DYNAMIC_LIBRARY_DIR"/*.lib $LIB_DIR
+ fi
+
+ fi
+
+elif [ "$TYPE" = "application" ]; then
+
+ # sets up the directory for executable programs and copies any found in the
+ # this project's final directory.
+
+ # first make sure the executable directory is around.
+ if [ ! -d $EXE_DIR ]; then mkdir $EXE_DIR; fi
+
+ if [ -z "$NO_COMPILE" ]; then
+ # we ensure that none of the normal products are copied for a non-compiling
+ # style of project.
+
+ # copy anything extra over.
+ if [ ! -z "$EXTRA_COPIES" ]; then
+ echo Copying extra files to $EXE_DIR.
+ echo [$EXTRA_COPIES]
+ cp -f $EXTRA_COPIES $EXE_DIR || $DIE
+ fi
+
+ fi
+
+elif [ "$TYPE" = "test" ]; then
+
+ # sets up a directory for test programs based on the project name and copies
+ # the generated programs into there.
+
+ # first make sure the test program root directory is around.
+ if [ ! -d $TEST_ROOT ]; then mkdir $TEST_ROOT; fi
+
+ # create the target directory if it doesn't exist.
+ if [ ! -d $TEST_DIR ]; then mkdir $TEST_DIR; fi
+
+ if [ -z "$NO_COMPILE" ]; then
+ # we ensure that none of the normal products are copied for a non-compiling
+ # style of project.
+
+ # make the files writable. this is required for some tests' data files,
+ # which come in from the build and could be read-only.
+ chmod 777 $TEST_DIR/* $TEST_DIR/*/* $TEST_DIR/*/*/* >/dev/null 2>&1
+
+ # copy anything extra over.
+ if [ ! -z "$EXTRA_COPIES" ]; then
+ echo Copying extra files to $TEST_DIR.
+ echo [$EXTRA_COPIES]
+ cp -f $EXTRA_COPIES $TEST_DIR || $DIE
+ fi
+
+ fi
+
+else
+ echo "Unknown type for project [$TYPE]; cancelling postconditions!"
+ . $CLAM_SCRIPTS/exit_make.sh
+fi
+
--- /dev/null
+#!/bin/bash
+# prepares the project for compilation by creating the appropriate directories.
+
+# make sure the top-level repository exists.
+if [ ! -d $FEISTY_MEOW_APEX ]; then mkdir -p $FEISTY_MEOW_APEX; fi
+# make sure our temp directory is there.
+if [ ! -d $CLAM_TMP ]; then mkdir -p $CLAM_TMP; fi
+# make sure the generated files have a home.
+if [ ! -d $TARGETS_STORE ]; then mkdir -p $TARGETS_STORE; fi
+# create the generated files storage area.
+if [ ! -d $OUTPUT_ROOT ]; then mkdir -p $OUTPUT_ROOT; fi
+# create the top level object directory if it doesn't exist.
+if [ ! -d $BASE_OUTPUT_PATH ]; then mkdir -p $BASE_OUTPUT_PATH; fi
+# create the project level object directory if it is non-existent.
+if [ ! -d $OUTPUT_PATH ]; then mkdir -p $OUTPUT_PATH; fi
+# create a directory to hold any debugging files, if necessary.
+if [ ! -d $PDB_DIR ]; then mkdir -p $PDB_DIR; fi
+#
+if [ ! -d $TESTS_DIR ]; then mkdir -p $TESTS_DIR; fi
+#
+if [ ! -d $EXECUTABLE_DIR ]; then mkdir -p $EXECUTABLE_DIR; fi
+#
+if [ ! -d $DYNAMIC_LIBRARY_DIR ]; then mkdir -p $DYNAMIC_LIBRARY_DIR; fi
+#
+if [ ! -d $STATIC_LIBRARY_DIR ]; then mkdir -p $STATIC_LIBRARY_DIR; fi
+
+# set versions on any extras that were specified in the makefile.
+if [ ! -z "$EXTRA_VERSIONS" ]; then
+ for i in $EXTRA_VERSIONS; do $CLAM_BINARIES/version_stamper$EXE_END $i $PARAMETER_FILE; done
+fi
+
+# create all the directories that objects will go into.
+###for i in $OUTPUT_DIRECTORY_LIST; do
+### if [ ! -d "$OUTPUT_PATH/$i" ]; then mkdir "$OUTPUT_PATH/$i"; fi
+###done
+
+# for firmware compilations set the compiler to the correct processor platform
+if [ "$COMPILER" = "DIAB" ]; then
+ $COMPILER_CONTROL $COMPILER_CONTROL_FLAGS
+fi
+
--- /dev/null
+
+
+this is out of date!
+
+it used to compile c# assets on windows pretty well.
+now it probably does nothing.
+
+we intend to refurbish it for use with mono.
+
--- /dev/null
+###############################################################################
+
+# CLAM System default rules and targets for C++ compilation.
+
+# This file composite macros and rules for creating compilation objects
+# (such as library archives, object files, executable programs, and others).
+
+# This file should be included in the user's Makefile after the variables
+# have been initialized appropriately for the particular project being
+# compiled. The user's own targets should be placed after the include
+# directive that specifies this file.
+
+###############################################################################
+
+# This section manipulates variable values to prepare them for their use
+# in the standard CLAM support.
+
+# Modify the output directory for executable files if we're building a
+# test project.
+ifeq "$(TYPE)" "test"
+ EXECUTABLE_DIR = $(TARGETS_STORE)/tests/$(PROJECT)
+ ifneq "$(CONSOLE_MODE)" ""
+ COMPILER_FLAGS += -target:exe
+ else
+ COMPILER_FLAGS += -target:winexe
+ endif
+endif
+ifeq "$(TYPE)" "application"
+ ifneq "$(CONSOLE_MODE)" ""
+ COMPILER_FLAGS += -target:exe
+ else
+ COMPILER_FLAGS += -target:winexe
+ endif
+endif
+ifeq "$(TYPE)" "library"
+ COMPILER_FLAGS += -target:library
+endif
+
+# prep the actual source variable so that certain file names are translated.
+ACTUAL_RESX = $(RESX:%.resx=%.resources)
+
+ifeq "$(OP_SYSTEM)" "WIN32"
+ ifneq "$(OMIT_VERSIONS)" ""
+ # remove version rc files if we're not dealing with versions.
+ ACTUAL_RESOURCE = $(RESOURCE:%.rc=)
+ else
+ ACTUAL_RESOURCE = $(RESOURCE:%.rc=%.res)
+ endif
+else
+ # replace this when supporting resource files on unix.
+ ACTUAL_RESOURCE = $(RESOURCE:%.rc=)
+endif
+
+# patch the sources so that subdirs work.
+ACTUAL_SOURCE = $(SOURCE:%.cs=$(CURRENT_DIR)/%.cs)
+
+# visual studio settings.
+ifeq "$(COMPILER)" "VISUAL_CPP"
+ # processes the def file for linkage, if one has been specified.
+ ifneq "$(DEF_FILE)" ""
+ LOAD_FLAG_PREFIX += -def:$(DEF_FILE)
+ endif
+
+ # these are loaded after any special debugging libs.
+ ifneq "$(VCPP_USE_BASE)" ""
+ # the first set will be included in almost any old program. we include
+ # winmm for multimedia in the base support since we make heavy use of the
+ # more accurate uptime function.
+# LOAD_FLAG_PREFIX += advapi32.lib kernel32.lib version.lib winmm.lib
+ endif
+#is advapi32 really part of the base required stuff? will it work on
+#win98? how about win95?
+
+ ifneq "$(VCPP_USE_GUI)" ""
+ LOAD_FLAG_PREFIX += comdlg32.lib gdi32.lib user32.lib winspool.lib
+ endif
+
+ ifneq "$(VCPP_USE_OLE)" ""
+ LOAD_FLAG_PREFIX += ole32.lib oleaut32.lib uuid.lib
+ VCPP_USE_RPC = t
+ endif
+ ifneq "$(VCPP_USE_RPC)" ""
+ LOAD_FLAG_PREFIX += rpcndr.lib rpcns4.lib rpcrt4.lib
+ VCPP_USE_SOCK = t
+ endif
+ ifneq "$(VCPP_USE_SOCK)" ""
+ LOAD_FLAG_PREFIX += netapi32.lib ws2_32.lib
+ endif
+endif
+
+# Updates the search path for the compiler and local libraries.
+BASE_HEADER_PATH = $(CODEBASE_HEADERS) $(LOCAL_HEADERS) $(HOOPLE_HEADERS) $(SEARCH_DIRS)
+HEADER_SEARCH_PATH += $(BASE_HEADER_PATH) $(COMPILER_HEADER_DIR)
+
+LIBRARY_SEARCH_PATH += $(LOCAL_LIBRARIES) $(HOOPLE_LIBRARIES) \
+ $(STATIC_LIBRARY_DIR) $(COMPILER_LIBRARY_DIR) $(SEARCH_DIRS)
+
+# Adds some directories that must be searched onto the search path for
+# header files, such as the compiler's own special header file directory.
+COMPILER_FLAGS += $(DEFINITIONS:%=-D:%) $(UNDEFINITIONS:%=-U%)
+#$(HEADER_SEARCH_PATH:%=-I%)
+
+# The load flags are updated by looking for code libraries in the directories
+# to search and by adding all of the code libraries that are used.
+LOAD_FLAG_PREFIX += $(LIBRARY_SEARCH_PATH:%=$(LIBRARY_PATH_FLAG)%)
+LOAD_FLAG_PREFIX += $(LIBS_USED:%=$(LIBRARY_NAME_FLAG)%)
+
+# prepare for mfc style DLLs. currently we plan on all dlls we create being
+# based on MFC. this is an unfortunate requirement for using the mfc debug
+# support for allocations; if regular new and DEBUG_NEW get mixed together,
+# crashes used to result. supposedly these are gone now at least.
+ifneq "$(USE_MFC)" ""
+ # set the flag that says we are doing mfc extension dlls.
+ DEFINITIONS += _AFXDLL
+
+ # add in the mfc directories.
+ COMPILER_HEADER_DIR += $(COMPILER_ROOT_DIR)/mfc/include
+ COMPILER_LIBRARY_DIR += $(COMPILER_ROOT_DIR)/mfc/lib
+endif
+
+ifeq "$(OMIT_VERSIONS)" ""
+ ifneq "$(VERSION_RC_ROOT)" ""
+ VERSION_TARGET = $(VERSION_RC_ROOT)_version.rc
+ endif
+endif
+
+# Make sure that the directory for objects exists.
+ACTUAL_FIRST_TARGETS = check_requirements $(VERSION_TARGET) $(FIRST_TARGETS) pre_compilation
+
+# Adds the primary targets to the list of products to create.
+ACTUAL_TARGETS1 = $(TARGETS:%.exe=$(EXECUTABLE_DIR)/%.exe)
+ACTUAL_TARGETS2 = $(ACTUAL_TARGETS1:%.dll=$(DYNAMIC_LIBRARY_DIR)/%.dynlibrary)
+ACTUAL_TARGETS3 = $(ACTUAL_TARGETS2:%.so=$(DYNAMIC_LIBRARY_DIR)/%.so)
+ACTUAL_TARGETS4 = $(ACTUAL_TARGETS3:%.lib=$(STATIC_LIBRARY_DIR)/%.library)
+ACTUAL_TARGETS = $(ACTUAL_TARGETS4:%.elf=$(EXECUTABLE_DIR)/%.elf)
+
+# Adds the last few targets for CLAM to do.
+ACTUAL_LAST_TARGETS = post_compilation $(LAST_TARGETS)
+
+############################################################################
+
+# This section defines the rules used to generate various objects from their
+# source files.
+
+############################################################################
+
+# resource compiler for c#.
+
+%.resources: %.resx
+ @echo Creating resource file [$@].
+ $(RC) $< $@
+# $(CATCHER)$(RC) $< $@
+
+############################################################################
+
+# resource compiler for standard resource files.
+
+ifeq "$(OP_SYSTEM)" "WIN32"
+%.res: %.rc
+ @echo Creating resource file [$@].
+ifeq "$(NO_COMPILE)" ""
+ $(CATCHER)$(STANDARD_RC) -r $(DEFINITIONS:%=-D%) $(HEADER_SEARCH_PATH:%=-i%) -fo $@ $<
+endif
+endif
+
+############################################################################
+
+# creates dynamic libraries.
+
+# we whack any existing LIB file, since we want to use changes in that file
+# as a clue for when we should rescan the dependencies. we'd be fine if
+# visual c++ didn't keep an existing LIB if it doesn't change (even when the
+# DLL does).
+
+$(DYNAMIC_LIBRARY_DIR)/%.dynlibrary: $(LOCAL_LIBS_USED:%=$(DYNAMIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(ACTUAL_RESX) $(ACTUAL_SOURCE) $(ACTUAL_RESOURCE)
+ $(HIDER)echo Creating dynamic library [$@].
+ @echo $@ >$(DIRTY_FILE)
+ $(HIDER)rm -f $(@:%.dll=%.lib)
+ $(CATCHER)$(CC) $(COMPILER_FLAGS) $(EXE_FLAGS) $(LOAD_FLAG_PREFIX) $(LOCAL_LIBS_USED:%=$(LIBRARY_NAME_FLAG)$(DYNAMIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(LOAD_FLAG_SUFFIX) $(LINKER_OUTPUT_FLAG)$@ $(ACTUAL_SOURCE) $(ACTUAL_RESX:%=-res:%) $(ACTUAL_RESOURCE:%=-win32res:%)
+ifneq "$(VCPP_VISTA_ICON)" ""
+ $(HIDER)ReplaceVistaIcon "$@" "$(VCPP_VISTA_ICON)"
+endif
+ $(HIDER)mv $@ $(DYNAMIC_LIBRARY_DIR)/$(LIB_PREFIX)$*$(LIB_ENDING)
+ifneq "$(CREATE_TLB)" ""
+ $(CATCHER)$(TLBEXPORT) $(DYNAMIC_LIBRARY_DIR)/$(LIB_PREFIX)$*$(LIB_ENDING) -out:$(DYNAMIC_LIBRARY_DIR)/$(LIB_PREFIX)$*.tlb
+endif
+ $(HIDER)echo nil >$@
+
+#$(LINKER_OUTPUT_FLAG)$@ -dll $(LOAD_FLAG_PREFIX) $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(LOCAL_LIBS_USED:%=$(LIBRARY_NAME_FLAG)$(LIB_PREFIX)%$(LIB_ENDING)) $(LOAD_FLAG_SUFFIX)
+
+############################################################################
+
+# creates "exe" executables using all of the appropriate objects.
+$(EXECUTABLE_DIR)/%.exe: $(LOCAL_LIBS_USED:%=$(DYNAMIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(ACTUAL_RESX) $(ACTUAL_SOURCE) $(ACTUAL_RESOURCE)
+ $(HIDER)echo Building program [$@].
+ @echo $@ >$(DIRTY_FILE)
+ $(CATCHER)$(CC) $(COMPILER_FLAGS) $(EXE_FLAGS) $(LOAD_FLAG_PREFIX) $(LOCAL_LIBS_USED:%=$(LIBRARY_NAME_FLAG)$(DYNAMIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(LOAD_FLAG_SUFFIX) $(LINKER_OUTPUT_FLAG)$@ $(ACTUAL_SOURCE) $(ACTUAL_RESX:%=-res:%) $(ACTUAL_RESOURCE:%=-win32res:%)
+ifneq "$(VCPP_VISTA_ICON)" ""
+ $(HIDER)ReplaceVistaIcon "$@" "$(VCPP_VISTA_ICON)"
+endif
+
+############################################################################
+
+# handles creating version resource files if this project has a version.ini.
+
+ifeq "$(OMIT_VERSIONS)" ""
+ ifneq "$(VERSION_RC_ROOT)" ""
+# only redo the version resource if it or version.ini is out of date.
+%_version.rc: version.ini $(PARAMETER_FILE)
+ $(CATCHER)$(CLAM_BINARIES)/version_stamper$(EXE_END) . $(PARAMETER_FILE)
+ endif
+endif
+
+############################################################################
+
+# Now the active part of the make process...
+
+# Adds the main CLAM system in to get some work done. This should be placed
+# after the module's rules are defined and before the module's targets are
+# defined.
+include rules.def
+
+# preserves intermediate files from being deleted.
+##.PRECIOUS: %.resources
+
+# zaps things when they could not be created correctly.
+.DELETE_ON_ERROR:
+
+############################################################################
+
+# examines the required variables and complains if they're missing.
+check_requirements:
+ $(HIDESH) -c 'if [ -z "$(PROJECT)" ]; then echo the PROJECT variable is not defined!; . $(CLAM_SCRIPTS)/exit_make.sh; fi'
+ $(HIDESH) -c 'if [ -z "$(TYPE)" ]; then echo the TYPE variable is not defined!; . $(CLAM_SCRIPTS)/exit_make.sh; fi'
+
+############################################################################
+
+# calls the script for preparing output directories and such.
+pre_compilation:
+ $(HIDESH)$(CLAM_SCRIPTS)/csharp/preconditions.sh
+
+############################################################################
+
+# calls the script for copying the final products to the library directory.
+# we don't bother reporting errors from touch since there will sometimes
+# not be any objects in the final directory.
+post_compilation:
+ $(HIDESH)$(CLAM_SCRIPTS)/csharp/postconditions.sh
+
+############################################################################
+
+# if REBUILD is defined, then we cause all objects to be recompiled.
+.PHONY: force_rebuild
+force_rebuild:
+
+ifneq "$(REBUILD)" ""
+ # the target below needs the blank rule that it has for this to work.
+ $(FIRST_TARGETS) $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_TARGETS) $(LAST_TARGETS): force_rebuild
+endif
+
+############################################################################
+
--- /dev/null
+###############################################################################
+
+# CLAM System default variable definitions for C# compilation.
+
+###############################################################################
+
+# Pull in the base support for CLAM.
+include variables.def
+
+###############################################################################
+
+#CLAM_BINARIES = $(CLAM_SCRIPTS)/../bin
+
+###############################################################################
+
+ifneq "$(BUILD_PARAMETER_FILE)" ""
+ # define our version of the build parameter file. this should be set
+ # beforehand so we override the default parameter file for clam.
+ export PARAMETER_FILE = $(BUILD_PARAMETER_FILE)
+###no: $(FEISTY_MEOW_APEX)/build/identity.ini
+endif
+ifeq "$(PARAMETER_FILE)" ""
+ # last ditch attempt to get one that will work.
+ export PARAMETER_FILE = $(FEISTY_MEOW_APEX)/build.ini
+endif
+
+###############################################################################
+
+# BASE_CPU is a flag that distinguishes the type of processor, if necessary.
+export BASE_CPU
+#BASE_CPU = m68k
+ # motorola 68000 series.
+#BASE_CPU = m68340
+ # motorola 68340.
+#BASE_CPU = x86
+ # intel x86.
+#BASE_CPU = ppc860
+ # power pc 860.
+
+# set the CPU default if we do not have one.
+ifeq "$(BASE_CPU)" ""
+ BASE_CPU = x86
+endif
+
+# COMPILER is a flag that specifies the operating system or the compiler for
+# use in conditional compilation (#ifdef ... #endif) of the compiler dependent
+# interfaces or implementations.
+export COMPILER
+#COMPILER = VISUAL_CPP
+
+# choose a default compiler if none was specified.
+ifeq "$(COMPILER)" ""
+ COMPILER = VISUAL_CPP
+endif
+
+# COMPILER_VERSION specifies the version of a particular compiler, if this is
+# needed to distinguish how the code is built.
+export COMPILER_VERSION
+
+###############################################################################
+
+# "TYPE" is the kind of product being generated by this project. this is
+# used to decide where to put the final products of compilation. this is a
+# variable in the user's makefile.
+# Valid Types:
+# TYPE = library (outputs are static or dynamic libraries)
+# TYPE = application (outputs are main-line executables)
+# TYPE = test (outputs are test programs)
+export TYPE
+
+###############################################################################
+
+# pseudo-boolean variable section. if these have any value at all, then they
+# are treated as being true. note that these are flags that should generally
+# be passed on the command line to a make. if they are intended to be used
+# from inside a makefile, then they must appear before this file is included.
+
+# "REBUILD" causes a rebuild of all source files if it's true.
+export REBUILD
+
+# "DEBUG" is used to specify a debugging build. the default is for this to
+# be false, which causes a release build.
+export DEBUG
+
+# "OPTIMIZE" creates optimized code.
+export OPTIMIZE
+
+# "NO_COMPILE" just runs through the targets without compiling. it still
+# promotes headers however.
+export NO_COMPILE
+
+# "BUILD_LIST_FILE" is the set of files that need to be recompiled for
+# visual c++.
+export BUILD_LIST_FILE = $(CLAM_TMP)/clam_rebuild.$(PROJECT)
+
+# "BUILD_WHACK_FILE" is the set of object files that should be removed if
+# a build failure occurs.
+export BUILD_WHACK_FILE = $(CLAM_TMP)/clam_whack.$(PROJECT)
+
+# we're adding the build list to the flag files so we know it gets cleaned up.
+FLAG_FILES += $(BUILD_LIST_FILE) $(BUILD_WHACK_FILE)
+
+###############################################################################
+
+# This section implements the HOOPLE directory scheme. If your scheme differs,
+# then you'll want to modify these appropriately.
+
+# "THIRD_PARTY_DIR" is the root of our support libraries.
+ifeq "$(OP_SYSTEM)" "UNIX"
+ export THIRD_PARTY_DIR
+endif
+ifeq "$(OP_SYSTEM)" "WIN32"
+ export THIRD_PARTY_DIR = $(FEISTY_MEOW_APEX)/3rdparty
+endif
+
+# "OUTPUT_ROOT" is the root of all output directories for objects and other
+# products being built.
+export OUTPUT_ROOT = $(TARGETS_STORE)/obj
+
+# "PLATFORM_ADD_IN" is an option discriminator for the intended execution
+# platform. it should end in an underscore if it is provided.
+#PLATFORM_ADD_IN = linux_
+#PLATFORM_ADD_IN = w32_
+PLATFORM_ADD_IN =
+
+# "CPU_BUILD_DIR" distinguishes object directories by including the cpu
+# name and the type of build.
+ifneq "$(DEBUG)" ""
+ CPU_BUILD_DIR = $(BASE_CPU)_dbg
+else
+ CPU_BUILD_DIR = $(BASE_CPU)_$(PLATFORM_ADD_IN)rel
+endif
+
+# "BASE_OUTPUT_PATH" is the parent directory of objects for this type of
+# cpu and this type of build.
+export BASE_OUTPUT_PATH = $(OUTPUT_ROOT)/$(CPU_BUILD_DIR)
+
+# "OUTPUT_PATH" is the directory to generate all compiled products into.
+export OUTPUT_PATH = $(BASE_OUTPUT_PATH)/$(PROJECT)
+
+# "OBJECT_DIR" is where object files will be stored during compilation for the
+# target type being produced.
+export OBJECT_DIR = $(OUTPUT_PATH)
+
+# These specify where files are to be created or located for our local build.
+export EXECUTABLE_DIR = $(TARGETS_STORE)/exe
+export DYNAMIC_LIBRARY_DIR = $(TARGETS_STORE)/dll
+export STATIC_LIBRARY_DIR = $(TARGETS_STORE)/lib
+export TESTS_DIR = $(TARGETS_STORE)/tests
+
+# "HEADER_SEARCH_PATH" is where the class interface files are to be found.
+#HEADER_SEARCH_PATH =
+
+# "HOOPLE_HEADERS" are locations where the HOOPLE headers can be found.
+HOOPLE_HEADERS := $(shell $(FIND) $(FEISTY_MEOW_APEX)/source/lib_src $(FEISTY_MEOW_APEX)/libraries -mindepth 1 -maxdepth 1 -type d)
+
+# "LOCAL_HEADERS" are overrides that go first in the header search path.
+#LOCAL_HEADERS =
+
+# "CODEBASE_HEADERS" is a list that can be changed for a particular codebase.
+# it is guaranteed that clam will not interfere with this list, whereas
+# the LOCAL_HEADERS can be modified by clam.
+#CODEBASE_HEADERS =
+
+# "LOCAL_LIBRARIES" are overrides that go first in the library search path.
+#LOCAL_LIBRARIES =
+
+# "LIBRARY_SEARCH_PATH" is where the library files are to be found.
+#LIBRARY_SEARCH_PATH =
+
+# "HOOPLE_LIBRARIES" is where our local libraries are located.
+HOOPLE_LIBRARIES =
+
+# "EXTRA_COPIES" is a list of files that are copied to a project's output
+# directory.
+export EXTRA_COPIES
+
+# "EXTRA_VERSIONS" is a list of version files to synchronize with the main
+# library version for this build. if a file called "version.ini" exists in
+# the project directory, then it will automatically be upgraded, so the
+# extra version files are mainly useful when you have a project with multiple
+# programs in it and you want them to have independent version files (as you
+# should perhaps want).
+export EXTRA_VERSIONS
+
+# "OMIT_VERSIONS" is another exclusion flag. this one turns off the creation
+# of version resource files and eliminates any references that would include
+# such files. this is needed when rebuilding version_stamper.
+#OMIT_VERSIONS = t
+
+# Add the obligatory junk to be cleaned up. Individual compiler sections
+# should customize this by adding their object output directories.
+CLEANUPS += $(ACTUAL_TARGETS) $(OUTPUT_PATH)
+#hmmm: import libs for dynamic libraries on ms-win32 don't currently get
+# cleaned up nicely.
+
+###############################################################################
+
+# "SEARCH_DIRS" is a list of directories that should be searched for both C++
+# header files and for C++ code libraries. The items placed in SEARCH_DIRS
+# are fed into both the LIBRARY_SEARCH_PATH and the HEADER_SEARCH_PATH.
+#SEARCH_DIRS =
+
+# "DEFINITIONS" is a list of compiler flags that define the value of c macros.
+# These usually have the format of -D<flag>, but in this variable, only the
+# <flag> itself should be listed because the compiler option -D is added
+# automatically.
+DEFINITIONS = CLAM_BUILT
+
+ifneq "$(BOOT_STRAPPING)" ""
+ # the software is being built from the ground up, including the binaries
+ # we use for building (like value_tagger and others).
+ DEFINITIONS += BOOT_STRAPPING
+endif
+
+# "UNDEFINITIONS" is a list of macros to undefine.
+#UNDEFINITIONS =
+
+#hmmm: these kinds of defines (with a value) do not work for csharp.
+# GLOBAL_PRODUCT_NAME is an important variable for tagging the entire code base
+# with some branding. It is provided as a macro definition to all source
+# files. The initial value for the macro should come from the build init
+# file, but if it doesn't, we pick a default.
+##ifeq "$(product_name)" ""
+## DEFINITIONS += GLOBAL_PRODUCT_NAME=\\\"HOOPLE\\\"
+##else
+## DEFINITIONS += GLOBAL_PRODUCT_NAME=\\\"$(product_name)\\\"
+##endif
+
+# *_PRODUCT_VERSION records parts of our version numbers for the code to see.
+###DEFINITIONS += MAJOR_PRODUCT_VERSION=$(major) MINOR_PRODUCT_VERSION=$(minor)
+
+# "DEBUG_FLAGS" these flags are used for generating specialized versions of
+# object files, such as ones that include debugging code or that add code for
+# profiling.
+# Possible values are -g for adding GDB debugging code and -pg for adding
+# gprof profiling code.
+#DEBUG_FLAGS = -g
+#DEBUG_FLAGS = -pg
+#DEBUG_FLAGS =
+
+# "COMPILER_FLAGS" are the flags for the pre-processor and compiler.
+#COMPILER_FLAGS =
+
+# "STRICT_WARNINGS" turns on all warnings and forces them to be considered
+# as errors when encountered.
+#STRICT_WARNINGS =
+
+# "LIBRARIAN_FLAGS" are flags that need to be passed to the library tool
+# that creates static code libraries.
+#LIBRARIAN_FLAGS =
+
+# "SOURCE" is the list of files that are turned into objects.
+#SOURCE =
+
+# "LIBS_USED" are system or compiler code libraries that the targets to be
+# created depend upon.
+#LIBS_USED =
+
+# "LOCAL_LIBS_USED" is very similar to the LIBS_USED, but these libraries
+# actually cause executables and object files to be recompiled when the
+# libraries specified have changed. To accomplish this, these libraries MUST
+# be located in the STATIC_LIBRARY_DIR rather than at some arbitrary place
+# on the LIBRARY_SEARCH_PATH.
+#LOCAL_LIBS_USED =
+
+# Load flags tell the linker and loader how to deal with the files and where
+# to locate library components. The prefix goes before object files are
+# listed, and the suffix after. The prefix should have things like the
+# directories to be searched for code libraries (although they should be added
+# to LIBRARY_SEARCH_PATH) and the loading mode for functions (static/dynamic).
+# In the suffix, actual library loading statements (like -lmath) can be
+# included (although they should be listed in a different form in LIBS_USED).
+# Remember that the unix loader looks for functions in libraries in a bizarre
+# way: ld searches for a function only when it has already been asked for it.
+# This means that it doesn't remember what functions it has already been
+# provided with in the libraries and object files, and it will fail if those
+# functions are only asked for after they have already been encountered.
+#LOAD_FLAG_PREFIX =
+#LOAD_FLAG_SUFFIX =
+
+# The prefix used on library names, mostly for unix.
+LIB_PREFIX =
+# The standard suffix for static or import libraries on this operating system.
+LIB_ENDING =
+
+# Flag for specifying the library name to create.
+#CREATE_LIBRARY_FLAG =
+
+# Flag for specifying a library to include in linking.
+LIBRARY_NAME_FLAG = -l
+
+# Flag for specifying a directory to add to the search path for libs.
+#LIBRARY_PATH_FLAG = -L
+
+# Flag for specifying the name of an output from the linker.
+#LINKER_OUTPUT_FLAG =
+
+# Flag for separating linker options from compilation options for a combined
+# compiler / linker.
+#LINKER_OPTION_SEPARATOR =
+
+# Flag that passes special options when building executable programs. It is
+# passed just before the LOAD_FLAG_PREFIX.
+#EXE_FLAGS =
+
+# The name of the compiler tool.
+#CC =
+
+# The name of the library creator tool.
+#LIBRARY_TOOL =
+
+# the root name of the version file. This is currently irrelevant on
+# non-win32 platforms.
+VERSION_RC_ROOT = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/rc_name.sh)
+ # we import the rc_name from our close ally, the c++ compiler definitions.
+
+###############################################################################
+
+# Compiler Dependent Flags
+#
+# "COMPILER_ROOT_DIR" is the top-level for the C++ compiler location.
+# "COMPILER_HEADER_DIR" is where the compiler's headers are.
+export COMPILER_HEADER_DIR
+# "COMPILER_LIBRARY_DIR" is where archived libraries are.
+# "CC" is the name of the C++ compiler to be used.
+
+ifeq "$(COMPILER)" "VISUAL_CPP"
+ # microsoft visual studio 7.
+
+ LIB_ENDING = .dll
+ PLATFORM_ADD_IN = w32_
+
+ # these define special characteristics for a program being built.
+ # BASE is almost always defined and pulls in fundamental w32 support.
+ # RPC supplies the remote procedure call libraries.
+ # OLE pulls in object linking and embedding support.
+ # SECURITY links with the w32 security APIs.
+ # CLR sets options that are appropriate for managed code.
+ VCPP_USE_BASE=true
+ VCPP_USE_RPC=
+ VCPP_USE_OLE=
+ VCPP_USE_SECURITY=
+ VCPP_USE_CLR=
+ VCPP_VISTA_ICON=
+
+ # the framework dir points at the .net framework to be used for compilation.
+ ifeq "$(FRAMEWORK_VERSION)" ""
+
+ # older .net 1.1.
+# SHORT_FRAMEWORK_VERSION = 1.1
+# FRAMEWORK_VERSION = $(SHORT_FRAMEWORK_VERSION).4322
+
+ # old .net 2.0.
+# SHORT_FRAMEWORK_VERSION = 2.0
+# FRAMEWORK_VERSION = $(SHORT_FRAMEWORK_VERSION).50727
+
+ # current .net 3.5.
+ SHORT_FRAMEWORK_VERSION = 3.5
+ FRAMEWORK_VERSION = $(SHORT_FRAMEWORK_VERSION)
+
+ endif
+ export FRAMEWORK_DIR
+ ifeq "$(FRAMEWORK_DIR)" ""
+ FRAMEWORK_DIR = $(subst \,/,$(WINDIR))/Microsoft.NET/Framework/v$(FRAMEWORK_VERSION)
+ endif
+
+ # pick a default compiler version for what we tend to use the most at the
+ # current time.
+ ifeq "$(COMPILER_VERSION)" ""
+ COMPILER_VERSION = 7
+ endif
+## DEFINITIONS += COMPILER_VERSION=$(COMPILER_VERSION)
+ # add a macro so programs can check what version is appropriate.
+
+ # C# needs an entry point for exes. a different one can be specified also.
+ ENTRY_POINT = main
+
+ # C# treats resources differently than simple code files. the list in this
+ # variable will be embedded in the target.
+ #RESX =
+
+ # TLBEXPORT is a tool to create TLB files from DLL files.
+ TLBEXPORT = $(COMPILER_ROOT_DIR)/../SDK/v$(SHORT_FRAMEWORK_VERSION)/bin/tlbexp$(EXE_END)
+
+ # calculate the visual studio root directory.
+ export VIS_STU_ROOT := $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/ms_root_dir.sh $(CLAM_BINARIES) )
+ ifneq "$(VIS_STU_ROOT)" ""
+ COMPILER_ROOT_DIR = $(VIS_STU_ROOT)/vc#
+ endif
+ ifeq "$(COMPILER_ROOT_DIR)" ""
+ HOSEUP = $(shell echo The compiler directory is not set. Please define the environment )
+ HOSEUP = $(shell echo variable VSxCOMNTOOLS to point at the folder where visual C++ is installed. )
+ HOSEUP =
+ endif
+
+ export COMPILER_VERSION = $(shell $(SHELL) $(CLAM_SCRIPTS)/cpp/get_version.sh $(COMPILER) $(COMPILER_ROOT_DIR) )
+
+ # set a variable for the resource compiler for old-style resources.
+ STANDARD_RC = $(VIS_STU_ROOT)/vc/bin/rc
+
+ # set up a directory for debugging files to be stored. these are not
+ # moved with the postconditions--they are generated in place.
+ export PDB_DIR=$(TARGETS_STORE)/pdb
+
+ # set these way up here so we can override them later.
+ CC = bash $(CLAM_SCRIPTS)/csharp/csharper.sh
+##$(FRAMEWORK_DIR)/csc
+
+# LINK_TOOL = $(COMPILER_ROOT_DIR)/bin/link
+
+ # vary the locations for compiler files based on the version.
+ COMPILER_HEADER_DIR = $(VIS_STU_ROOT)/vc/include $(VIS_STU_ROOT)/vc/atlmfc/include $(VIS_STU_ROOT)/vc/platformsdk/include
+ COMPILER_LIBRARY_DIR =
+###$(COMPILER_ROOT_DIR)/lib $(COMPILER_ROOT_DIR)/atlmfc/lib $(COMPILER_ROOT_DIR)/platformsdk/lib
+ RC = $(COMPILER_ROOT_DIR)/../SDK/v2.0/bin/resgen$(EXE_END)
+
+ ifeq "$(COMPILER_HEADER_DIR)" ""
+ HOSEUP = $(shell echo The compiler version is not set. Please define COMPILER_VERSION.)
+ endif
+
+ DEFINITIONS += _Windows _WINDOWS WIN32 __WIN32__ __FLAT__ VC_EXTRALEAN WIN32_LEAN_AND_MEAN ATL_NO_LEAN_AND_MEAN _WIN32_WINNT=0x403
+ DEF_FILE =
+ LIBRARY_TOOL = $(COMPILER_ROOT_DIR)/bin/lib
+ LOAD_FLAG_PREFIX = -nologo
+#-subsystem:windows -machine:IX86
+ LOAD_FLAG_SUFFIX =
+
+ MIDL = midl -Oicf $(MIDL_DEFS) $(HEADER_SEARCH_PATH:%=-I% ) $(DEFINITIONS:%=-I% )
+ MIDL_DEFS = -no_robust
+
+ # set the flags used by visual c++.
+ CREATE_LIBRARY_FLAG = -out:
+ LIBRARY_NAME_FLAG = -reference:
+ LIBRARY_PATH_FLAG = -lib:
+ LINKER_OPTION_SEPARATOR = -link
+ LINKER_OUTPUT_FLAG = -out:
+
+ # Add the extra files created by visual c++.
+#is this needed now that we whack whole output path? CLEANUPS += $(OUTPUT_PATH)/*.*db
+
+ # put the common flags into the compiler flags.
+ COMPILER_FLAGS += -nologo
+#-Fd$(PDB_DIR)/$(PROJECT)_bookkeeping.pdb -GR -GX -W3 -Zi -EHsc -GS -Gd
+
+ ifneq "$(DEBUG)" ""
+ # disable function inlining and optimizations for debug.
+# COMPILER_FLAGS += -Ob0 -Od
+ else
+ # enable function inlining for release only.
+# COMPILER_FLAGS += -Ob1
+
+ ifneq "$(OPTIMIZE)" ""
+ # add in fast code optimization.
+#testing...
+# COMPILER_FLAGS += -O2
+#trying O2 again although it seems to combust too easily.
+ else
+ # no optimizations.
+ endif
+
+ endif
+
+ # check if profiling is to be enabled.
+ PROFILER_FLAG =
+ ifneq "$(PROFILE)" ""
+ PROFILER_FLAG = -profile
+ endif
+
+ # add the common linker flags. the debugging flag is added because we
+ # want to be able to debug into release code, but since the pdb files
+ # are separate, we're not exposing ourselves when we don't include them.
+ LOAD_FLAG_PREFIX += $(PROFILER_FLAG) -debug
+#-warn:3
+
+ # "USE_MFC" dictates whether mfc should be allowed in the application.
+ # the default is not to use MFC extension style dlls. this can be turned
+ # on in the individual makefiles that require MFC.
+ #USE_MFC =
+
+ # the library creator gets a couple of flags.
+ LIBRARIAN_FLAGS += -nologo -machine:IX86
+
+ # now, vary the flag configuration based on the flags that have been set.
+
+ ifneq "$(CONSOLE_MODE)" ""
+ # console type of applications are built using the static flag so that
+ # they are more redistributable.
+ DEFINITIONS += _CONSOLE
+### LOAD_FLAG_SUFFIX += -subsystem:console
+ STATIC = true
+ endif
+
+ # dynamically linked library or application flags.
+ ifneq "$(DEBUG)" ""
+ # debug.
+ DEFINITIONS += _DEBUG
+# COMPILER_FLAGS += -MDd
+ else
+ # release.
+ DEFINITIONS += NDEBUG
+# COMPILER_FLAGS += -MD
+ endif
+
+ ifneq "$(STRICT_WARNINGS)" ""
+# COMPILER_FLAGS += -W3 -WX
+ # we have not turned on W4 because it is not really warnings for the
+ # microsoft compiler. instead, it is a bunch of blather about what the
+ # compiler intends to do rather than problems in the code.
+ endif
+
+endif
+
+
--- /dev/null
+#!/bin/bash
+# spits out the root directory of visual studio, calculated from the common
+# tools directory that always seems to be reliably set.
+
+# code snagged from vis_stu_vars...
+if [ -z "$VSxTOOLS" ]; then
+ export VSxTOOLS="$VS90COMNTOOLS"
+ if [ -z "$VSxTOOLS" ]; then
+ export VSxTOOLS="$VS80COMNTOOLS"
+ fi
+fi
+if [ -z "$VSxTOOLS" ]; then
+ #echo Failure to locate visual studio tools.
+ # don't want to echo anything; need to be able to check that this provided nothing.
+ exit 33
+fi
+
+cygpath -w -s "$VSxTOOLS" | sed -e 's/\\/\//g' | sed -e 's/^\(.*\)\/[^\/]*\/[^\/]*[\/]$/\1/'
+
--- /dev/null
+#!/bin/bash
+
+# this file attempts to provide all of the variables needed for compiling
+# with the microsoft visual studio compiler (dot net version). it requires
+# one environment variable (called VSxCOMNTOOLS) be set that points at the
+# location of the common tools in the visual studio installation.
+# The value of x can be 80, 90 or 100.
+
+function print_usage {
+ echo "The VS80COMNTOOLS, VS90COMNTOOLS and VS100COMNTOOLS variables are not set."
+ echo "This usually means that the Visual Studio compiler is not installed."
+ echo ""
+}
+
+if [[ "$1" =~ .*help.* ]]; then
+ print_usage
+ exit 0
+fi
+
+function setup_visual_studio_variables()
+{
+ # we try to use the most recent compiler location, and work backwards as
+ # needed for the supported range (10 = vs 2010, 9 = vs 2008, 8 = vs 2005).
+ export VSxTOOLS="$VS100COMNTOOLS"
+ if [ -z "$VSxTOOLS" ]; then
+ export VSxTOOLS="$VS90COMNTOOLS"
+ if [ -z "$VSxTOOLS" ]; then
+ export VSxTOOLS="$VS80COMNTOOLS"
+ fi
+ fi
+
+ if [ -z "$VSxTOOLS" ]; then
+ return 33
+ fi
+ export VSxTOOLS="$(cygpath -w -s "$VSxTOOLS" | tr "A-Z" "a-z" | sed -e 's/\\/\//g' )"
+#| sed -e 's/^\(.\):/\/\1/' )"
+
+ export VIS_STU_ROOT="$(echo $VSxTOOLS | sed -e 's/^\(.*\)\/[^\/]*\/[^\/]*[\/]$/\1/' )"
+#| sed -e 's/^\(.\):/\/\1/' )"
+ export VSINSTALLDIR="$VIS_STU_ROOT"
+
+ export WINDIR="$(cygpath -w -s "$WINDIR" | tr A-Z a-z | sed -e 's/\\/\//g' )"
+#| sed -e 's/^\(.\):/\/\1/' )"
+
+ export VCINSTALLDIR="$VSINSTALLDIR/VC"
+ export VSCOMMONROOT="$VSINSTALLDIR/Common7"
+ export VS_TOOLS_DIR="$VSCOMMONROOT/tools"
+ export DevEnvDir="$VSCOMMONROOT/IDE"
+ export MSVCDir="$VCINSTALLDIR"
+ export FrameworkDir="$WINDIR/Microsoft.NET/Framework"
+ export FrameworkVersion=v4.0.30319
+ #old export FrameworkSDKDir="$VSINSTALLDIR/SDK/v2.0"
+
+ export PLATFORM_DIR="$VCINSTALLDIR/PlatformSDK"
+ if [ ! -d "$PLATFORM_DIR" ]; then
+
+#on hold: export PLATFORM_DIR="$(cygpath -w -s "$PROGRAMFILES/Microsoft SDKs/Windows/v7.0A" | tr "A-Z" "a-z" | sed -e 's/^\(.*\)\/[^\/]*\/[^\/]*[\/]$/\1/' )"
+##| sed -e 's/^\(.\):/\/\1/' )"
+
+ # guess at where we can find this damned directory in its short form.
+#hmmm: this is needed until there's a replacement for short path, or we can build again.
+ export PLATFORM_DIR="c:/progra~2/micros~1/windows/v7.0a"
+ if [ ! -d "$PLATFORM_DIR" ]; then
+ PLATFORM_DIR="c:/progra~1/micros~1/windows/v7.0a"
+ if [ ! -d "$PLATFORM_DIR" ]; then
+ PLATFORM_DIR="c:/progra~1/micros~2/windows/v7.0a"
+ if [ ! -d "$PLATFORM_DIR" ]; then
+ PLATFORM_DIR="c:/progra~2/micros~2/windows/v7.0a"
+ fi
+ fi
+ fi
+
+ if [ ! -d "$PLATFORM_DIR" ]; then
+ echo "*** Failure to calculate the platform directory based on several attempts using c:\\program files\\microsoft sdks\\windows\\v7.0a as the basic pattern"
+ fi
+
+
+ fi
+ export WindowsSdkDir="$PLATFORM_DIR"
+
+ #echo "path before is $PATH"
+ local filena
+ for filena in "$DevEnvDir" "$VCINSTALLDIR/BIN" "$VSxTOOLS" "$VSxTOOLS/bin" "$FrameworkDir/$FrameworkVersion" "$FrameworkDir/v3.5" "$VCINSTALLDIR/VCPackages" "$VSINSTALLDIR/Common7/Tools" "$PLATFORM_DIR/bin"; do
+ export PATH="$PATH:$(dos_to_unix_path $filena)"
+ done
+ #echo "path after is $PATH"
+
+ export INCLUDE="$VCINSTALLDIR/ATLMFC/INCLUDE:$VCINSTALLDIR/INCLUDE:$PLATFORM_DIR/include"
+ #:$FrameworkSDKDir/include"
+
+ export LIB="$VCINSTALLDIR/ATLMFC/LIB:$VCINSTALLDIR/LIB:$PLATFORM_DIR/lib"
+ #:$FrameworkSDKDir/lib"
+
+ # convert framework dir back or things yell like hell.
+ export FrameworkDir=$(unix_to_dos_path $FrameworkDir)
+ # the redirection of stderr to null is to get around an obnoxious cygwin
+ # warning that seems to be erroneously complaining about backslashes.
+
+ ##############
+
+ echo "calculated variables for dos/windoze builds:"
+ var VIS_STU_ROOT VSxTOOLS WINDIR VSxTOOLS VSINSTALLDIR PLATFORM_DIR FrameworkDir
+
+ ##############
+}
+
+# run the above, very nasty, function.
+setup_visual_studio_variables
+
+