Your tool chain should support both bits; your compiler and linker should be able to emit both 64-bit and 32-bit code, or you can have two separate toolchains. Suppose your compiler is set to 64-bit by default and accepts a switch to create 32-bit code. You can use target variables in make to set this switch for a 32-bit build.
Besides the compiler, you will also have to set other variables differently for the two assemblies. The things that come to mind are OBJ_DIR and LIB_DIR , so the output files do not mix; LIB_INCLUDES , because both collectors require their own versions of the libraries that you reference (so you will need two versions of SampleApi.dll ).
Your makefile will look something like this:
32bit: CC += -m32 32bit: OBJ_DIR = obj32 32bit: LIB_DIR := $(LIB_DIR)32 32bit: LIB_INCLUDES = -L$(SAMPLE_DIR)/lib32 all: 64bit 32bit 64bit 32bit: $(DIRS) $(TARGET)
(I excluded parts that do not need to be changed.)
source share