aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorEric B Munson <ebmunson@us.ibm.com>2009-07-21 16:19:43 +0100
committerEric B Munson <ebmunson@us.ibm.com>2009-07-22 11:24:10 +0100
commitb971147b507b73aedcdb6ef068e64434bfb6a3a5 (patch)
treea00f95973289e1c0bbcd1cea463688604297c733 /Makefile
parent8e8fcc43ccc4f46b5fd881f1dbbd051d9fec6490 (diff)
downloadlibhugetlbfs-b971147b507b73aedcdb6ef068e64434bfb6a3a5.tar.gz
Adjust tool compiler to build 64 bit tools if available
The make process currently builds all lib huge tools as 32 bit binaries regardless of the build environment. This causes a problem on ppc64 when attempting to deal with 16GB pages as their size is larger than a 32 bit long long. This patch updates the tools build to use the 64 bit compiler whenever it is available. Signed-off-by: Eric B Munson <ebmunson@us.ibm.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile16
1 files changed, 11 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 0140303..acd17f2 100644
--- a/Makefile
+++ b/Makefile
@@ -95,6 +95,12 @@ ifdef CC64
OBJDIRS += obj64
endif
+ifdef CC64
+CCBIN = $(CC64)
+else
+CCBIN = $(CC32)
+endif
+
ifdef ELF32
LIBOBJS32 = obj32/elflink.o obj32/sys-$(ELF32).o
endif
@@ -302,29 +308,29 @@ obj64/%.s: %.c
$(BIN_OBJ_DIR)/%.o: %.c
@$(VECHO) CCHOST $@
@mkdir -p $(BIN_OBJ_DIR)
- $(CC) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ -c $<
+ $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ -c $<
$(BIN_OBJ_DIR)/hugectl: $(BIN_OBJ_DIR)/hugectl.o
@$(VECHO) LDHOST $@
mkdir -p $(BIN_OBJ_DIR)
- $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ $^
+ $(CCBIN) $(CPPFLAGS) $(CFLAGS) -o $@ $^
$(BIN_OBJ_DIR)/hugeedit: $(BIN_OBJ_DIR)/hugeedit.o
@$(VECHO) LDHOST $@
mkdir -p $(BIN_OBJ_DIR)
- $(CC) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^
+ $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^
HUGEADM_OBJ=hugeadm.o libhugetlbfs_privutils.a
$(BIN_OBJ_DIR)/hugeadm: $(foreach file,$(HUGEADM_OBJ),$(BIN_OBJ_DIR)/$(file))
@$(VECHO) LDHOST $@
mkdir -p $(BIN_OBJ_DIR)
- $(CC) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^
+ $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^
PAGESIZE_OBJ=pagesize.o libhugetlbfs_privutils.a
$(BIN_OBJ_DIR)/pagesize: $(foreach file,$(PAGESIZE_OBJ),$(BIN_OBJ_DIR)/$(file))
@$(VECHO) LDHOST $@
mkdir -p $(BIN_OBJ_DIR)
- $(CC) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^
+ $(CCBIN) $(CPPFLAGS) $(CFLAGS) $(LIBPATHS) -o $@ $^
clean:
@$(VECHO) CLEAN