updates to get mac OS working again
[feisty_meow.git] / scripts / clam / cpp / rules.def
index e0b723156de1f9dc31df9322ed31347467436e0b..ca59f82360a30ad4341b456d98c1872406c927b5 100644 (file)
@@ -115,7 +115,7 @@ ifeq "$(COMPILER)" "GNU_DARWIN"
   endif
 
   ifneq "$(USE_SSL)" ""
-    LIBS_USED += crypto
+    LIBS_USED += crypto ssl
   endif
   
   ifneq "$(USE_WXWIDGETS)" ""
@@ -246,7 +246,7 @@ ifeq "$(COMPILER)" "VISUAL_CPP"
     LOCAL_HEADERS += $(THIRD_PARTY_DIR)/openssl/include
     LIBRARY_SEARCH_PATH += $(THIRD_PARTY_DIR)/openssl/lib
     LIBS_USED += libcrypto.lib libssl.lib
-    $(shell cp $(THIRD_PARTY_DIR)/openssl/lib/*dll $(EXECUTABLE_DIR) )
+#no, yuck.    $(shell cp $(THIRD_PARTY_DIR)/openssl/lib/*dll $(EXECUTABLE_DIR) )
   endif
   
 endif
@@ -370,12 +370,14 @@ endif
 ACTUAL_FIRST_TARGETS = check_requirements $(EXTRA_FIRST_TARGETS) $(VERSION_TARGET) $(FIRST_TARGETS) pre_compilation
 
 # Adds the primary targets to the list of products to create.
-ifeq "$(NO_COMPILE)" ""
+#ifeq "$(NO_COMPILE)" ""
+
   ifneq "$(COMPILER)" "VISUAL_CPP"
     ACTUAL_TARGETS1 = $(TARGETS:%.exe=$(EXECUTABLE_DIR)/%)
   else
     ACTUAL_TARGETS1 = $(TARGETS:%.exe=$(EXECUTABLE_DIR)/%.exe)
   endif
+
   ifneq "$(COMPILER)" "VISUAL_CPP"
     ACTUAL_TARGETS2 = $(ACTUAL_TARGETS1:%.dll=%.so)
     ACTUAL_TARGETS3 = $(ACTUAL_TARGETS2:%.so=$(DYNAMIC_LIBRARY_DIR)/%$(TRIPART_VERSION).so)
@@ -383,30 +385,23 @@ ifeq "$(NO_COMPILE)" ""
     ACTUAL_TARGETS2 = $(ACTUAL_TARGETS1:%.so=%.dll)
     ACTUAL_TARGETS3 = $(ACTUAL_TARGETS2:%.dll=$(DYNAMIC_LIBRARY_DIR)/%$(TRIPART_VERSION).dll)
   endif
+
   ACTUAL_TARGETS4 = $(ACTUAL_TARGETS3:%.lib=$(STATIC_LIBRARY_DIR)/%$(TRIPART_VERSION).library)
   ACTUAL_TARGETS = $(ACTUAL_TARGETS4:%.elf=$(EXECUTABLE_DIR)/%.elf)
-else #is no_compile
-  ACTUAL_TARGETS1 = $(TARGETS:%.exe=)
-  ACTUAL_TARGETS2 = $(ACTUAL_TARGETS1:%.dll=)
-  ACTUAL_TARGETS3 = $(ACTUAL_TARGETS2:%.so=)
-  ACTUAL_TARGETS4 = $(ACTUAL_TARGETS3:%.lib=)
-  ACTUAL_TARGETS = $(ACTUAL_TARGETS4:%.elf=)
-endif
+
+#else #is no_compile
+#  ACTUAL_TARGETS1 = $(TARGETS:%.exe=)
+#  ACTUAL_TARGETS2 = $(ACTUAL_TARGETS1:%.dll=)
+#  ACTUAL_TARGETS3 = $(ACTUAL_TARGETS2:%.so=)
+#  ACTUAL_TARGETS4 = $(ACTUAL_TARGETS3:%.lib=)
+#  ACTUAL_TARGETS = $(ACTUAL_TARGETS4:%.elf=)
+#endif
 
 # Adds the last few targets for CLAM to do.
 ACTUAL_LAST_TARGETS = post_compilation $(LAST_TARGETS)
 
 ############################################################################
 
-ifneq "$(CLEAN)" ""
-# Add the obligatory junk to be cleaned up.
-set_cleanups_variable:
-       $(eval CLEANUPS += $(ACTUAL_TARGETS) $(ACTUAL_TARGETS:%.exe=%) )
-#      echo "new CLEANUPS variable: $(CLEANUPS)"
-endif
-
-############################################################################
-
 # This section defines the rules used to generate various objects from their
 # source files.
 
@@ -420,13 +415,13 @@ endif
 # without hosing it up.
 %.nil:
 ifeq "$(NO_COMPILE)" ""
-       $(CATCHER)$(CC) -c $(CLAM_DIR)/cpp/blank_target.c -o $@
+       $(CATCHER)$(CC) -c $(CLAM_SCRIPTS)/cpp/blank_target.c -o $@
 endif
 
 %.bad:
        @echo There is a problem with the makefile in the SOURCE variable.
        @echo The offending item is: $@
-       $(HIDESH)$(CLAM_DIR)/exit_make.sh
+       $(HIDESH)$(CLAM_SCRIPTS)/exit_make.sh
 
 ## faked debug object.
 #%.obj: %.cpp
@@ -439,11 +434,39 @@ ifeq "$(CLEAN)" ""
 # recreate dependencies for static applications.
 %.gendeps: %.cpp
        @echo "Generating Static Deps: $*.cpp"
-       $(CATCHER)$(CLAM_DIR)/cpp/buildor_gen_deps.sh "$*.cpp"
+       $(CATCHER)$(CLAM_SCRIPTS)/cpp/buildor_gen_deps.sh "$*.cpp"
 endif
 
 ############################################################################
 
+# trying to delay loading this as long as possible so the built in rule system for CLEANUPS can run with the right values.
+# so far not working right!
+#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
+# defined.
+include rules.def
+
+############################################################################
+
+# this adds in a customization for the cleanup variables, since the base
+# clam code has no idea about a dynamic library directory.
+
+cpp_add_to_cleanups_variable:
+#      echo here is actual targets before hand $(ACTUAL_TARGETS)
+       $(eval CLEANUPS = $(ACTUAL_TARGETS:%.exe=%) $(ACTUAL_TARGETS:$(STATIC_LIBRARY_DIR)/%.library=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%.a) $(CLEANUPS) )
+#      echo "IN CPP, new CLEANUPS variable: $(CLEANUPS)"
+#fodder for anything missing a cleanup.
+#      $(eval CLEANUPS = $(ACTUAL_TARGETS) $(ACTUAL_TARGETS:%.dll=%.so) $(ACTUAL_TARGETS:%.so=%.dll) $(CLEANUPS) )
+
+#dynamic is taken care of in clam base still?
+#DYNAMIC_LIBRARY_DIR
+#hmmm: still should change there in the base and do it
+# here instead.
+
+############################################################################
+
 # C++ source to object file translation.
 # if there is a special set of flags for this source file, we use them
 # instead of the default compiler flags.
@@ -517,7 +540,7 @@ $(STATIC_LIBRARY_DIR)/%.library: $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LO
        $(HIDER)echo Building Static Library [$(notdir $@)]
        @echo $@ >$(DIRTY_FILE)
   ifeq "$(COMPILER)" "VISUAL_CPP"
-       $(HIDESH)-c 'if [ -f $(BUILD_LIST_FILE) ]; then $(SHELL) $(CLAM_DIR)/cpp/rebuild_oldies.sh $(MULTI_BUILD_CMD); fi'
+       $(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"
@@ -550,17 +573,17 @@ $(DYNAMIC_LIBRARY_DIR)/%.dll: $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL
        $(HIDER)echo Building Dynamic Library [$(notdir $@)]
        @echo $@ >$(DIRTY_FILE)
   ifeq "$(COMPILER)" "VISUAL_CPP"
-       $(HIDESH)-c 'if [ -f $(BUILD_LIST_FILE) ]; then $(SHELL) $(CLAM_DIR)/cpp/rebuild_oldies.sh $(MULTI_BUILD_CMD); fi'
+       $(HIDESH)-c 'if [ -f $(BUILD_LIST_FILE) ]; then $(SHELL) $(CLAM_SCRIPTS)/cpp/rebuild_oldies.sh $(MULTI_BUILD_CMD); fi'
   endif
        $(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)
        echo ran link tool.
   ifeq "$(COMPILER_VERSION)" "8"
-       $(HIDESH)$(CLAM_DIR)/cpp/ms_manifest.sh "$@" "2"
+       $(HIDESH)$(CLAM_SCRIPTS)/cpp/ms_manifest.sh "$@" "2"
   endif
   ifeq "$(COMPILER_VERSION)" "10"
-       $(HIDESH)$(CLAM_DIR)/cpp/ms_manifest.sh "$@" "2"
+       $(HIDESH)$(CLAM_SCRIPTS)/cpp/ms_manifest.sh "$@" "2"
   endif
   ifneq "$(VCPP_VISTA_ICON)" ""
        $(HIDER)ReplaceVistaIcon "$@" "$(VCPP_VISTA_ICON)"
@@ -596,15 +619,15 @@ $(EXECUTABLE_DIR)/%.exe: $(OBJECT_DIR)/%.obj $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%)
        $(HIDER)echo Building Application [$(notdir $@)]
        @echo $@ >$(DIRTY_FILE)
     ifeq "$(COMPILER)" "VISUAL_CPP"
-       $(HIDESH)-c 'if [ -f $(BUILD_LIST_FILE) ]; then $(SHELL) $(CLAM_DIR)/cpp/rebuild_oldies.sh $(MULTI_BUILD_CMD); fi'
+       $(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_DIR)/cpp/ms_manifest.sh "$@" "1"
+       $(HIDESH)$(CLAM_SCRIPTS)/cpp/ms_manifest.sh "$@" "1"
     endif
     ifeq "$(COMPILER_VERSION)" "10"
-       $(HIDESH)$(CLAM_DIR)/cpp/ms_manifest.sh "$@" "1"
+       $(HIDESH)$(CLAM_SCRIPTS)/cpp/ms_manifest.sh "$@" "1"
     endif
     ifneq "$(VCPP_VISTA_ICON)" ""
        $(HIDER)ReplaceVistaIcon "$@" "$(VCPP_VISTA_ICON)"
@@ -655,7 +678,7 @@ 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_BINARY_DIR)/version_stamper$(EXE_END) . $(PARAMETER_FILE)
+       $(CATCHER)$(CLAM_BINARIES)/version_stamper$(EXE_END) . $(FEISTY_MEOW_GENERATED_STORE)/versions $(PARAMETER_FILE)
   endif
 endif
 
@@ -663,11 +686,6 @@ 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
-
 # make sure we really want to include the dependencies file.
 ifeq "$(TYPE)" "hierarchy"
   # no dependencies for a simple hierarchy builder.
@@ -734,11 +752,11 @@ else
       endif
     endif
        @echo Dependencies [$(notdir $@)]
-       -$(HIDESH)$(CLAM_DIR)/cpp/preconditions.sh
+       -$(HIDESH)$(CLAM_SCRIPTS)/cpp/preconditions.sh
        @touch $@
 #      @echo dep adds: $(DEPENDENCY_ADDITIONS)
-       @$(CLAM_BINARY_DIR)/makedep$(EXE_END) $(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)
-#      $(CATCHER)$(CLAM_BINARY_DIR)/makedep$(EXE_END) $(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)
+       @$(CLAM_BINARIES)/makedep$(EXE_END) $(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)
+#      $(CATCHER)$(CLAM_BINARIES)/makedep$(EXE_END) $(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)
        @echo $@ >$(SUBMAKE_FLAG)
   endif # non-compile.
  else # cleaning.
@@ -751,10 +769,11 @@ endif # no-deps.
 
 ############################################################################
 
-# examines the required variables and complains if they're missing.
+# examines the required variables and complains if they are missing.
 check_requirements:
-       $(HIDESH) -c 'if [ -z "$(PROJECT)" ]; then echo the PROJECT variable is not defined!; . $(CLAM_DIR)/exit_make.sh; fi'
-       $(HIDESH) -c 'if [ -z "$(TYPE)" ]; then echo the TYPE variable is not defined!; . $(CLAM_DIR)/exit_make.sh; fi'
+       $(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'
+       $(HIDESH) -c 'if [ ! -d $(FEISTY_MEOW_GENERATED_STORE)/versions ]; then mkdir $(FEISTY_MEOW_GENERATED_STORE)/versions; fi'
  
 ############################################################################
 
@@ -776,7 +795,7 @@ endif
 
 # calls the script for preparing output directories and such.
 pre_compilation:
-       $(HIDESH)$(CLAM_DIR)/cpp/preconditions.sh
+       $(HIDESH)$(CLAM_SCRIPTS)/cpp/preconditions.sh
 
 ############################################################################
 
@@ -784,7 +803,7 @@ pre_compilation:
 # we don't bother reporting errors from touch since there will sometimes
 # not be any objects in the final directory.
 post_compilation:
-       $(HIDESH)$(CLAM_DIR)/cpp/postconditions.sh
+       $(HIDESH)$(CLAM_SCRIPTS)/cpp/postconditions.sh
 
 ############################################################################