X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fclam%2Fcpp%2Frules.def;h=ca59f82360a30ad4341b456d98c1872406c927b5;hb=5bfb9814f022c83d453a1244f343df2a67501a52;hp=6e4338cb3ebd210c8f57571571f1ce72233c97c1;hpb=fc8ec007bcbe990fc374f1a3019547e13554c496;p=feisty_meow.git diff --git a/scripts/clam/cpp/rules.def b/scripts/clam/cpp/rules.def index 6e4338cb..ca59f823 100644 --- a/scripts/clam/cpp/rules.def +++ b/scripts/clam/cpp/rules.def @@ -15,15 +15,6 @@ # This section manipulates variable values to prepare them for their use # in the standard CLAM support. -# special actions for projects that are tests. -ifneq "$(findstring test, $(TYPE))" "" - # add the clean task at the end, so that we will always rebuild the tests - # and run them again. -#hmmm: this is a kludge to make sure we always run the tests. there has got -# to be a better way. -# LAST_TARGETS += clean -endif - # see if they have got the clean flag set. if so, we will not build anything. ifneq "$(CLEAN)" "" NO_COMPILE = t @@ -36,16 +27,47 @@ endif # implement special bits for gnu on unix. ifeq "$(COMPILER)" "GNU_LINUX" ifneq "$(USE_XWIN)" "" - ifneq "$(OP_SYSTEM)" "WIN32" - DEFINITIONS += __XWINDOWS__ __X__ - LIBS_USED += Xm Xt X11 Xft Xp + DEFINITIONS += __XWINDOWS__ __X__ + LIBS_USED += Xm Xt X11 Xft Xp #need to separate out with a USE_MOTIF kind of thing. LIBS_USED += Xmu - HEADER_SEARCH_PATH += /usr/include/X11 /usr/X11R6/include /usr/include/g++ - LIBRARY_SEARCH_PATH += /usr/X11R6/lib + HEADER_SEARCH_PATH += /usr/include/X11 /usr/X11R6/include /usr/include/g++ + LIBRARY_SEARCH_PATH += /usr/X11R6/lib + endif + + ifneq "$(USE_SSL)" "" + LIBS_USED += ssl crypto + endif + + ifneq "$(USE_WXWIDGETS)" "" + DEFINITIONS += __WXWIDGETS__ + use_unicode = + ifneq "$(findstring UNICODE, $(DEFINITIONS))" "" + use_unicode = true + endif + + # decide whether to turn on the unicode flag or not. + ifneq "$(use_unicode)" "" + DEFINITIONS += wxUSE_UNICODE + UNICODE_FLAG_ADD = --unicode=yes + else + UNICODE_FLAG_ADD = --unicode=no endif + # could add for debugging: --debug=yes + COMPILER_FLAGS += $(shell wx-config --cxxflags $(UNICODE_FLAG_ADD) ) + + LOAD_FLAG_PREFIX += $(shell wx-config --libs $(UNICODE_FLAG_ADD) ) endif + ifneq "$(USE_CURL)" "" + COMPILER_FLAGS += `curl-config --cflags` + LOAD_FLAG_SUFFIX += `curl-config --libs` + endif +endif + +# some special code for gnu compiler on windows. +ifeq "$(COMPILER)" "GNU_WINDOWS" + ifneq "$(USE_SSL)" "" LIBS_USED += ssl crypto endif @@ -54,9 +76,7 @@ LIBS_USED += Xmu DEFINITIONS += __WXWIDGETS__ use_unicode = ifneq "$(findstring UNICODE, $(DEFINITIONS))" "" -# ifeq "$(OP_SYSTEM)" "WIN32" - use_unicode = true -# endif + use_unicode = true endif # decide whether to turn on the unicode flag or not. @@ -72,9 +92,11 @@ LIBS_USED += Xmu LOAD_FLAG_PREFIX += $(shell wx-config --libs $(UNICODE_FLAG_ADD) ) endif +LOAD_FLAG_PREFIX += -lwsock32 -lmswsock -shared + ifneq "$(USE_CURL)" "" COMPILER_FLAGS += `curl-config --cflags` - LOAD_FLAG_SUFFIX += `curl-config --static-libs` + LOAD_FLAG_SUFFIX += `curl-config --libs` endif endif @@ -93,16 +115,14 @@ ifeq "$(COMPILER)" "GNU_DARWIN" endif ifneq "$(USE_SSL)" "" - LIBS_USED += crypto + LIBS_USED += crypto ssl endif ifneq "$(USE_WXWIDGETS)" "" DEFINITIONS += __WXWIDGETS__ use_unicode = ifneq "$(findstring UNICODE, $(DEFINITIONS))" "" -# ifeq "$(OP_SYSTEM)" "WIN32" use_unicode = true -# endif endif # decide whether to turn on the unicode flag or not. @@ -145,7 +165,8 @@ ifneq "$(OP_SYSTEM)" "WIN32" endif # win32 compiler additions. -ifeq "$(OP_SYSTEM)" "WIN32" +#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) @@ -188,12 +209,12 @@ ifeq "$(OP_SYSTEM)" "WIN32" endif ifneq "$(USE_CURL)" "" - DEFINITIONS += _WIN32 +# # curl wants this win32 flag? + DEFINITIONS += WIN32 LOCAL_HEADERS += $(THIRD_PARTY_DIR)/curl/include LIBRARY_SEARCH_PATH += $(THIRD_PARTY_DIR)/curl/lib -# ifeq "$(findstring libcurl, $(LIBS_USED))" "" - LIBS_USED += libcurl.dll.a -# endif +# LIBS_USED += libcurl.dll.a + LIBS_USED += libcurl.lib endif ifneq "$(VCPP_USE_GUI)" "" @@ -224,13 +245,14 @@ ifeq "$(OP_SYSTEM)" "WIN32" ifneq "$(USE_SSL)" "" LOCAL_HEADERS += $(THIRD_PARTY_DIR)/openssl/include LIBRARY_SEARCH_PATH += $(THIRD_PARTY_DIR)/openssl/lib - LIBS_USED += libeay32.lib - $(shell cp $(THIRD_PARTY_DIR)/openssl/lib/*dll $(EXECUTABLE_DIR) ) + 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 "$(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:%) @@ -246,14 +268,18 @@ ACTUAL_LOCAL_LIBS = $(TEMP_LOC1) # Create the list of objects from the list of source files. TEMP_OBJ1 = $(SOURCE:%.cpp=%.obj) TEMP_OBJ2 = $(TEMP_OBJ1:%.c=%.obj) -ifeq "$(OP_SYSTEM)" "WIN32" +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 - TEMP_OBJ3 = $(TEMP_OBJ3a:%.rc=%.res) + 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=) @@ -309,7 +335,8 @@ MULTI_BUILD_CMD = $(CC) $(COMPILER_FLAGS) -c `cat $(BUILD_LIST_FILE)` $(OBJECT_N # 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 "$(OP_SYSTEM)" "WIN32" + ifeq "$(COMPILER)" "VISUAL_CPP" # set the flag that says we are doing mfc extension dlls. DEFINITIONS += _AFXDLL DEPENDENCY_DEFINITIONS += _MT _DLL @@ -323,42 +350,52 @@ ifeq "$(OMIT_VERSIONS)" "" endif endif -ifneq "$(GENDEPS)" "" - EXTRA_FIRST_TARGETS += gendeps -endif +# if we are cleaning up, then do not generate dependency file. +ifeq "$(CLEAN)" "" + ifneq "$(GENDEPS)" "" + EXTRA_FIRST_TARGETS += gendeps + endif # only do the deps generation for makefiles that are properly marked. ifneq "$(findstring __BUILD_STATIC_APPLICATION__, $(DEFINITIONS))" "" # generate static build dependencies for all targets in the makefile. GENERATED_DEPS_LIST = $(TARGETS:%.exe=%.gendeps) +else + GENERATED_DEPS_LIST = +endif + endif # Make sure that the directory for objects exists. 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 "$(OP_SYSTEM)" "UNIX" +#ifeq "$(NO_COMPILE)" "" + + ifneq "$(COMPILER)" "VISUAL_CPP" ACTUAL_TARGETS1 = $(TARGETS:%.exe=$(EXECUTABLE_DIR)/%) else ACTUAL_TARGETS1 = $(TARGETS:%.exe=$(EXECUTABLE_DIR)/%.exe) endif - ifeq "$(OP_SYSTEM)" "UNIX" + + ifneq "$(COMPILER)" "VISUAL_CPP" ACTUAL_TARGETS2 = $(ACTUAL_TARGETS1:%.dll=%.so) ACTUAL_TARGETS3 = $(ACTUAL_TARGETS2:%.so=$(DYNAMIC_LIBRARY_DIR)/%$(TRIPART_VERSION).so) else 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) @@ -378,13 +415,13 @@ ACTUAL_LAST_TARGETS = post_compilation $(LAST_TARGETS) # 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 @@ -393,10 +430,40 @@ endif # $(CATCHER)$(CC) $(COMPILER_FLAGS) -c $< $(OBJECT_NAME_FLAG)$(TEMP)/$@ #endif +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. ############################################################################ @@ -407,7 +474,7 @@ endif $(OBJECT_DIR)/%.obj: $(CURRENT_DIR)/%.cpp ifeq "$(NO_COMPILE)" "" ifneq "$(COMPILER)" "VISUAL_CPP" - @echo Compiling [$(shell basename $@)] + @echo Compiling Object [$(notdir $@)] $(HIDESH)-c 'if [ ! -d $(@D) ]; then mkdir $(@D); fi' $(CATCHER)$(CC) $(COMPILER_FLAGS) -c $< $(OBJECT_NAME_FLAG)$@ else @@ -424,7 +491,7 @@ endif $(OBJECT_DIR)/%.obj: $(CURRENT_DIR)/%.c ifeq "$(NO_COMPILE)" "" ifneq "$(COMPILER)" "VISUAL_CPP" - @echo Compiling [$@] + @echo Compiling Object [$(notdir $@)] $(HIDESH)-c 'if [ ! -d $(@D) ]; then mkdir $(@D); fi' $(CATCHER)$(CC) $(COMPILER_FLAGS) -c $< $(OBJECT_NAME_FLAG)$@ else @@ -438,7 +505,7 @@ endif # resource compiler for win32. -ifeq "$(OP_SYSTEM)" "WIN32" +ifeq "$(COMPILER)" "VISUAL_CPP" $(OBJECT_DIR)/%.res: %.rc $(PARAMETER_FILE) ifeq "$(NO_COMPILE)" "" @echo Resource [$@] @@ -452,7 +519,7 @@ $(OBJECT_DIR)/%.resources: %.resx $(PARAMETER_FILE) $(HIDESH)-c 'if [ ! -d $(@D) ]; then mkdir $(@D); fi' $(VCS_ROOT)/../SDK/v1.1/bin/resgen $< $@ endif -else #non-win32 +else #non-visual studio # this platform probably does not use rc files. $(OBJECT_DIR)/%.res: %.rc ifeq "$(NO_COMPILE)" "" @@ -470,10 +537,10 @@ endif ifeq "$(NO_COMPILE)" "" $(STATIC_LIBRARY_DIR)/%.library: $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(PARAMETER_FILE) - $(HIDER)echo Static [$@] + $(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" @@ -503,18 +570,20 @@ ifeq "$(NO_COMPILE)" "" $(DYNAMIC_LIBRARY_DIR)/%.dll: $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(ACTUAL_RESX) $(PARAMETER_FILE) #hmmm: use the res objects variable to rebuild res files as needed. ###$(RES_OBJECTS) - $(HIDER)echo Dynamic [$@] + $(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)" @@ -540,40 +609,40 @@ endif #no_compile # creates "exe" executables using all of the appropriate objects. -ifeq "$(OP_SYSTEM)" "WIN32" +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 Application [$@] + $(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)" endif endif #no_compile -endif #win32 +endif #visual studio -ifeq "$(OP_SYSTEM)" "UNIX" +ifneq "$(COMPILER)" "VISUAL_CPP" ifneq "$(NO_COMPILE)" "" $(EXECUTABLE_DIR)/%: endif ifeq "$(NO_COMPILE)" "" $(EXECUTABLE_DIR)/%: $(OBJECT_DIR)/%.obj $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(PARAMETER_FILE) - $(HIDER)echo Application [$@] + $(HIDER)echo Building Application [$(notdir $@)] @echo $@ >$(DIRTY_FILE) $(CATCHER)$(LINK_TOOL) $(EXE_FLAGS) $(LOAD_FLAG_PREFIX) $< $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(LIBRARY_NAME_FLAG)%) $(LOAD_FLAG_SUFFIX) $(LINKER_OUTPUT_FLAG)$@ #hmmm: experimental item below. @@ -591,7 +660,7 @@ endif ifeq "$(NO_COMPILE)" "" $(EXECUTABLE_DIR)/%.elf: $(OBJECT_DIR)/%.obj $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(STATIC_LIBRARY_DIR)/$(LIB_PREFIX)%$(LIB_ENDING)) $(PARAMETER_FILE) - $(HIDER)echo Application [$@] + $(HIDER)echo Building Application [$(notdir $@)] @echo $@ >$(DIRTY_FILE) $(CATCHER)$(LINK_TOOL) $(MAP) $(LOAD_FLAG_PREFIX) $< $(LINKER_COMMAND_FILE) $(STARTUP_OBJECT_FILE) $(ACTUAL_OBJECTS:%=$(OBJECT_DIR)/%) $(ACTUAL_LOCAL_LIBS:%=$(LIBRARY_NAME_FLAG)%) $(LOAD_FLAG_SUFFIX) $(LINKER_OUTPUT_FLAG)$@ #$(^:force_rebuild=) @@ -609,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_BIN)/version_stamper$(EXE_END) . $(PARAMETER_FILE) + $(CATCHER)$(CLAM_BINARIES)/version_stamper$(EXE_END) . $(FEISTY_MEOW_GENERATED_STORE)/versions $(PARAMETER_FILE) endif endif @@ -617,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. @@ -630,7 +694,7 @@ endif ifneq "$(CLEAN)" "" NO_DEPS = t # no dependencies get left when we are cleaning up. - $(shell rm -f $(DEPS_FILE)) +# $(shell rm -f $(DEPS_FILE)) endif ifneq "$(NO_COMPILE)" "" # non compiling projects do not need dependencies. @@ -642,15 +706,10 @@ ifneq "$(REBUILD)" "" $(shell rm -f $(DEPS_FILE)) endif -# includes the auto-dependency information. the dependency file is checked -# for being up-to-date. if not, it gets rebuilt and the make is restarted. -ifeq "$(NO_DEPS)" "" - include $(DEPS_FILE) -endif - # preserves intermediate files from being deleted. ifeq "$(CLEAN)" "" -.PRECIOUS: $(OBJECT_DIR)/%.obj $(OBJECT_DIR)/%.res $(OBJECT_DIR)/%.resources +.PRECIOUS: $(OBJECT_DIR)/%.obj $(OBJECT_DIR)/%.res $(OBJECT_DIR)/%.resources $(OBJECT_DIR)/%.deps +#hmmm: added above deps. maybe not right. endif # zaps things when they could not be created correctly. @@ -668,6 +727,7 @@ ifneq "$(NO_DEPS)" "" $(DEPS_FILE): $(PARAMETER_FILE) else + ifeq "$(CLEAN)" "" deps: $(DEPS_FILE) # this causes the dependency file to be regenerated if the sources or libs @@ -691,28 +751,51 @@ else $(DEPS_FILE): $(VERSION_RC_ROOT)_version.rc endif endif - @echo Dependencies [$(shell basename $@)] - -$(HIDESH)$(CLAM_DIR)/cpp/preconditions.sh + @echo Dependencies [$(notdir $@)] + -$(HIDESH)$(CLAM_SCRIPTS)/cpp/preconditions.sh @touch $@ # @echo dep adds: $(DEPENDENCY_ADDITIONS) - @$(CLAM_BIN)/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_BIN)/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. + # makes the dependencies a no-op for cleaning. + deps: $(PARAMETER_FILE) + + $(DEPS_FILE): $(PARAMETER_FILE) + endif 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' ############################################################################ +# includes the auto-dependency information. the dependency file is checked +# for being up-to-date. if not, it gets rebuilt and the make is restarted. +ifeq "$(CLEAN)" "" + ifeq "$(NO_DEPS)" "" + + # thank the buddha for this bit of code, or at least thank this page: + # http://stackoverflow.com/questions/5553352/how-do-i-check-if-file-exists-in-makefile + ifneq ("$(wildcard $(DEPS_FILE))","") + include $(DEPS_FILE) + endif + + endif +endif + +############################################################################ + # calls the script for preparing output directories and such. pre_compilation: - $(HIDESH)$(CLAM_DIR)/cpp/preconditions.sh + $(HIDESH)$(CLAM_SCRIPTS)/cpp/preconditions.sh ############################################################################ @@ -720,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 ############################################################################