discovered that i was reinvoking the make for any cleaning process, just in order to set the CLEAN flag. that's really terribly broken. luckily found the eval command which i can run inside a target to change the value of an existing environment variable. perfect. now in the base clam rules and not getting weird problems from using OTHER_CLEANS
-CONSOLE_MODE = true
+include variables.def
-include cpp/variables.def
+# had to move to this style for these two
+# since having a makefile call another was doing
+# really unpredictable things, where the makefile
+# passed to the -f of make was actually dragging
+# in bits from the main makefile. this was
+# tested even by saying:
+# make -f makefile.stub clean
+# which totally isolates it to the stub file, but
+# the main makefile was still being pulled in.
+# hopefully this approach of having a neutral outer
+# maker will get rid of that broken behavior.
-PROJECT = app_bundle
-TYPE = application
-SOURCE = common_bundle.cpp
-ifeq "$(OMIT_VERSIONS)" ""
- SOURCE += bundler_version.rc
-endif
-DEFINITIONS += __BUILD_STATIC_APPLICATION__=t
-TARGETS = bundle_creator.exe
-LAST_TARGETS += make_stub
-ifeq "$(COMPILER)" "VISUAL_CPP"
- LOCAL_HEADERS += $(THIRD_PARTY_DIR)/zlib/include
- LOCAL_LIBRARIES += $(THIRD_PARTY_DIR)/zlib/lib
- LIBS_USED += zlib.lib
-else
- LIBS_USED += z
-endif
-OTHER_CLEANS += clean_stub
+LAST_TARGETS = maker
+OTHER_CLEANS = breaker
-include cpp/rules.def
+include rules.def
+
+maker:
+ $(MAKE) -f makefile.bundle_creator
+ $(MAKE) -f makefile.unpacker_stub
+
+breaker:
+ $(MAKE) CLEAN=t -f makefile.bundle_creator clean
+ $(MAKE) CLEAN=t -f makefile.unpacker_stub clean
-make_stub:
- $(MAKE) -f makefile.stub
-clean_stub:
- $(MAKE) -f makefile.stub NO_DEPS=t clean
--- /dev/null
+CONSOLE_MODE = true
+
+include cpp/variables.def
+
+PROJECT = app_bundle
+TYPE = application
+SOURCE = common_bundle.cpp
+ifeq "$(OMIT_VERSIONS)" ""
+ SOURCE += bundler_version.rc
+endif
+DEFINITIONS += __BUILD_STATIC_APPLICATION__=t
+TARGETS = bundle_creator.exe
+
+#hmmm: these should be done with a USE_ZLIB macro.
+ifeq "$(COMPILER)" "VISUAL_CPP"
+ LOCAL_HEADERS += $(THIRD_PARTY_DIR)/zlib/include
+ LOCAL_LIBRARIES += $(THIRD_PARTY_DIR)/zlib/lib
+ LIBS_USED += zlib.lib
+else
+ LIBS_USED += z
+endif
+
+include cpp/rules.def
+
+++ /dev/null
-CONSOLE_MODE = true
-
-include cpp/variables.def
-
-PROJECT = app_bundle_stub
-TYPE = application
-SOURCE = common_bundle.cpp
-ifeq "$(OMIT_VERSIONS)" ""
- SOURCE += bundler_version.rc
-endif
-DEFINITIONS += __BUILD_STATIC_APPLICATION__=t
-TARGETS = unpacker_stub.exe
-ifeq "$(COMPILER)" "VISUAL_CPP"
- LIBS_USED += libcmt.lib shlwapi.lib zlib.lib
- LOAD_FLAG_PREFIX += -nodefaultlib:msvcrt.lib
- COMPILER_FLAGS += -MT
- LOCAL_HEADERS += $(THIRD_PARTY_DIR)/zlib/include
- LOCAL_LIBRARIES += $(THIRD_PARTY_DIR)/zlib/lib
-else
- LIBS_USED += z
-endif
-
-include cpp/rules.def
-
--- /dev/null
+CONSOLE_MODE = true
+
+include cpp/variables.def
+
+PROJECT = app_bundle_stub
+TYPE = application
+SOURCE = common_bundle.cpp
+ifeq "$(OMIT_VERSIONS)" ""
+ SOURCE += bundler_version.rc
+endif
+DEFINITIONS += __BUILD_STATIC_APPLICATION__=t
+TARGETS = unpacker_stub.exe
+
+LAST_TARGETS = show_makefilename
+OTHER_CLEANS = mocko
+
+#hmmm: why on earth is this gunk not already available
+# in some specialized vcpp variable? yuck!
+ifeq "$(COMPILER)" "VISUAL_CPP"
+ LIBS_USED += libcmt.lib shlwapi.lib zlib.lib
+ LOAD_FLAG_PREFIX += -nodefaultlib:msvcrt.lib
+ COMPILER_FLAGS += -MT
+ LOCAL_HEADERS += $(THIRD_PARTY_DIR)/zlib/include
+ LOCAL_LIBRARIES += $(THIRD_PARTY_DIR)/zlib/lib
+else
+ LIBS_USED += z
+endif
+
+include cpp/rules.def
+
+show_makefilename:
+ echo hey the makeflags are $(MAKEFLAGS)
+
+
+mocko:
+ echo got to other cleans
+
# specifies the version of the code that is being constructed here.
major=2
minor=140
-revision=82
+revision=84
build=0
# specifies the remainder of the version record info.
# of the License online. Please send any updates to "fred@gruntose.com". #
###############################################################################
+if [ ! -z "$CLEAN" ]; then
+ echo "in cleaning mode, will not build dependencies."
+ exit 0
+fi
+
# this script finds all of the headers used by a cpp file and outputs a
# list of other cpp files that are probably needed for building it.
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
# $(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"
+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.
$(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 "$(CLEAN)" ""
- ifeq "$(NO_DEPS)" ""
- include $(DEPS_FILE)
- endif
-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.
$(DEPS_FILE): $(PARAMETER_FILE)
else
+ ifeq "$(CLEAN)" ""
deps: $(DEPS_FILE)
# this causes the dependency file to be regenerated if the sources or libs
# $(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)
@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.
############################################################################
############################################################################
+# 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
# 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)
+CLEANUPS += $(ACTUAL_TARGETS) $(OUTPUT_PATH) $(DEPS_FILE)
# "GENDEPS" is a flag that causes dependencies to be generated into
# statically built applications.
# files and such that were created by the project. it invokes the makefile
# again with the CLEAN variable defined so that this can be passed down into
# all subsequent makes.
-clean:
- $(HIDER)$(MAKE) --silent CLEAN=t ready_to_clean
+clean: set_cleaner_variable clean_subdirs $(OTHER_CLEANS) ready_to_clean
+ # no code here.
-ready_to_clean: $(OTHER_CLEANS) clean_subdirs
+set_cleaner_variable:
+ $(eval CLEAN := true)
+
+ready_to_clean:
@echo Whacking [$(CLEANUPS)]
$(HIDESH) -c '\
echo the other cleans were: $(OTHER_CLEANS); \
# "clean_subdirs" travels down each subdirectory and cleans using make.
clean_subdirs:
$(HIDESH) -c '\
-for i in *; do \
- if [ -d "$$i" ]; then \
- if [ -f "$$i/$(MAKEFILE_NAME)" -a ! "$$i" -ef `pwd` ]; then \
+for smoot87 in *; do \
+ if [ -d "$$smoot87" ]; then \
+echo "got inside first check of it being dir: $$smoot87"; \
+ if [ -f "$$smoot87/$(MAKEFILE_NAME)" -a ! "$$smoot87" -ef `pwd` ]; then \
+echo "got inside barriers, with filename=$$smoot87 and all conditions met."; \
+echo "the interesting one was: [$(test ! "$$smoot87" -ef `pwd` )]"; \
(cd "$$i"; $(MAKE) --silent NOT_FIRST_MAKE=t -f $(MAKEFILE_NAME) clean); \
else \
echo "Skipping makefile-less directory $$i..."; \
############################################################################
-# "CLEAN" is an powerful flag that affects what clam does. if the flag is
+# "CLEAN" is a powerful flag that affects what clam does. if the flag is
# non-empty, then nothing will be built and every generated file that is
-# known about will be deleted.
+# known about will be deleted. it is intended as exported, since then sub-
+# shells know that they are cleaning and we do not have to pass them a
+# target.
+#hmmm: (although we do?)
export CLEAN
# "CLEANUPS" are things to be removed by the "make clean" command.
-#CLEANUPS =
+undefine CLEANUPS
# OTHER_CLEANS are targets to execute before performing the main clean up.
-#OTHER_CLEANS =
+# we intentionally reset this here to avoid a polluted variable getting
+# to us from a previous make.
+undefine OTHER_CLEANS
# sets the temporary directory.
export CLAM_TMP