ifndef TARGETDEFS TARGETDEFS := done ifndef ARCH $(error Please define $$(ARCH).) endif VALIDARCH := no DEFS := $(EXTRADEFS) ifeq ($(ARCH),x86) CROSS := i686-polintos- DEFS += -DBITFIELD_LE -D__LITTLE_ENDIAN VALIDARCH := yes endif ifeq ($(ARCH),x64) CROSS := x86_64-polintos- DEFS += -DBITFIELD_LE -D__LITTLE_ENDIAN VALIDARCH := yes endif ifeq ($(VALIDARCH),no) $(error $(ARCH) is not a supported target.) endif ifndef USECROSS CROSS := endif ifdef NOSMP DEFS += -D_LL_NOSMP endif # C++ prohibits defeferencing a NULL non-POD pointer (and thus # prohibits using offsetof on non-POD types, even though there's no # good reason to disallow it). Some headers use offsetof on non-POD # types (typically, the types are non-POD only because they have a # constructor to initialize fields to a known state (or with # passed-in values); hardly a reason to make it completely non-POD # and throw out a bazillion otherwise legal actions). # # Thus, since I know of no way (such as a #pragma) for code to # disable a warning itself for a specific region of code, everything # needs to disable this warning. On one hand, I consider it a bogus # warning, and thus it's not that big of a deal. On the other hand, # having the warning suppressed means you won't know if your code # will produce the warning in other environments without actually # trying it there. Oh well; blame the C++ and/or GCC people, not me. # # This warning option requires at least GCC 3.4. If you want to use # an older compiler, remove this and live with the warnings (as well # as whatever other unknown issues you encounter). CXXWARN += $(WARN) -Wno-invalid-offsetof ifndef BUILDTYPE BUILDTYPE := user endif BUILDNAME := build BASEBUILDDIR := $(TOP)/$(BUILDNAME) ARCHBUILDDIR := $(TOP)/$(BUILDNAME)/$(ARCH) ifeq ($(ARCHINDEP),y) BUILDDIR := $(BASEBUILDDIR)/$(BUILDTYPE)/$(COMP) else BUILDDIR := $(ARCHBUILDDIR)/$(BUILDTYPE)/$(COMP) endif UTILBUILDDIR := $(BASEBUILDDIR)/build/utils SERVERDIR := $(BUILDDIR)/include/servers IFACES := $(BASEBUILDDIR)/build/idl/ifaces GENINCLUDES := $(ARCHBUILDDIR)/build/include/generated BUILDCC := gcc BUILDCXX := g++ CC := $(CROSS)gcc CXX := $(CROSS)g++ AS := $(CROSS)as AR := $(CROSS)ar LD := $(CROSS)ld STRIP := $(CROSS)strip DEFS += -D_LL_ARCH_$(ARCH) -D_LL_ARCH=$(ARCH) MKDIR := mkdir -p MV := mv OBJCOPY := $(CROSS)objcopy RANLIB := $(CROSS)ranlib RM := rm -f RMDIR := rm -rf LN := ln -s IDLC_target := $(BASEBUILDDIR)/build/idlcomp/idlc IDLC := valgrind -q $(BASEBUILDDIR)/build/idlcomp/idlc TOUCH := touch BISON := bison FLEX := flex # If you want to cross-compile idlc, set BUILD_ENDIAN to LE or BE # and build only the idlc component. Also, set BUILDCXX to the # cross compiler. ifndef BUILD_ENDIAN $(shell $(MKDIR) $(UTILBUILDDIR)) $(shell $(BUILDCC) $(TOP)/utils/buildendian.c -o $(UTILBUILDDIR)/buildendian) BUILD_ENDIAN := $(shell $(UTILBUILDDIR)/buildendian) endif ifndef BUILD_BFENDIAN $(shell $(MKDIR) $(UTILBUILDDIR)) $(shell $(BUILDCC) $(TOP)/utils/buildbfendian.c -o $(UTILBUILDDIR)/buildbfendian) BUILD_BFENDIAN := $(shell $(UTILBUILDDIR)/buildendian) endif BUILDDEFS += -DBITFIELD_$(BUILD_BFENDIAN) endif