I am trying to build library via following code snippet in makefile. Basically i am trying to split the object files and create two static libraries because of library size exceeds limitation in windows OS. There are totally 537 obj files exists and i am dividing them into two sets and creating .lib static library each.
TEST_OBJECTS := foo.obj bar.obj xyz.obj abc.obj ..... <537 obj files>
TMPOBJ_DIR := $(OUTPUTDIR)/tmpdir
OBJSUFFIX := .obj
N_OBJECTS := $(words $(TEST_OBJECTS))
SYMBOLS := 1
INDEX_LEFT_1 := 1
INDEX_RIGHT_1 := 268
INDEX_LEFT_2 := 269
INDEX_RIGHT_2 := $(TEST_OBJECTS)
TEST_STAT_OBJ_0 := $(wordlist $(INDEX_LEFT_1),$(INDEX_RIGHT_1),$(TEST_OBJECTS))
TEST_STAT_OBJ_1 := $(wordlist $(INDEX_LEFT_2),$(INDEX_RIGHT_2),$(TEST_OBJECTS))
TEST_STAT_0 := $(OUTPUTDIR)/build_static_0.lib
TEST_STAT_1 := $(OUTPUTDIR)/build_static_1.lib
define build_lib
$(info inside define)
$(TEST_STAT_$(1)) : $(TEST_STAT_OBJ_$(1))
ifeq ($(SYMBOLS),1)
$(info inside guard)
$$(foreach kx_file,$$^,$$(call rename_obj,$$(kx_file),tmp$(1)file))
$$(file >$$(OUTPUTDIR)/testParameters.txt,$$(LIBFLAGS) -out:$$@ $$(TMPOBJ_DIR)/tmp$(1)file*$$(OBJSUFFIX))
$$(call TEST_WIN,$$@,$$(libDef),tmp$(1)file)
else
$$(file >$$(OUTPUTDIR)/testParameters.txt,$$(LIBFLAGS) -out:$$@ $$^)
endif
$$(LIBEXE) @$$(OUTPUTDIR)/testParameters.txt
endef
$(eval $(call build_lib,0))
$(eval $(call build_lib,1))
Some reason build is not building required libraries. Build is not failing though, It is able to successfully create obj files.
I try to add debug statements inside define
function and i could see (info ...)
messages in log file. It means it is going inside define function right. How can i get the full debug what is going on in define
function. Some reason its not throwing any errors. And it is not even building libraries. I am sorry that i cant share full snippet.