32-bit/64-bit Makefile fix
authorlucasart <lucas.braesch@gmail.com>
Fri, 8 Apr 2016 17:47:31 +0000 (18:47 +0100)
committerJoona Kiiski <joona@zoox.com>
Fri, 8 Apr 2016 17:47:31 +0000 (18:47 +0100)
Counter intuitively, make build ARCH=x86-32 does NOT produce a 32-bit compile
when running a 64-bit OS. Nor would ARCH=x86-64 produce a 64-bit compile when
running a 32-bit OS (assuming it compiled w/o errors).

No functional change

Resolves #621

src/Makefile

index 0824072de8e95654f3b303a1dc4695103e1ed8b3..294634f69156656ddf617a0df157f0a550efc3f4 100644 (file)
@@ -145,7 +145,7 @@ endif
 ifeq ($(COMP),gcc)
        comp=gcc
        CXX=g++
-       CXXFLAGS += -pedantic -Wextra -Wshadow
+       CXXFLAGS += -pedantic -Wextra -Wshadow -m$(bits)
        ifneq ($(UNAME),Darwin)
           LDFLAGS += -Wl,--no-as-needed
        endif
@@ -185,7 +185,8 @@ endif
 ifeq ($(COMP),clang)
        comp=clang
        CXX=clang++
-       CXXFLAGS += -pedantic -Wextra -Wshadow
+       CXXFLAGS += -pedantic -Wextra -Wshadow -m$(bits)
+       LDFLAGS += -m$(bits)
        ifeq ($(UNAME),Darwin)
                CXXFLAGS += -stdlib=libc++
                DEPENDFLAGS += -stdlib=libc++