Skip to content

Commit

Permalink
build: in Makefile.m32 moved target autodetection.
Browse files Browse the repository at this point in the history
Moved target autodetection block after defining CC macro.
  • Loading branch information
gknauf committed Nov 19, 2014
1 parent 140ca2d commit cf510ad
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
20 changes: 10 additions & 10 deletions lib/Makefile.m32
Expand Up @@ -54,16 +54,6 @@ ifndef LIBCARES_PATH
LIBCARES_PATH = $(PROOT)/ares
endif

# Set environment var ARCH to your architecture to override autodetection.
ifndef ARCH
TARGET := $(shell $(CC) -dumpmachine)
ifeq ($(findstring x86_64,$(TARGET)),x86_64)
ARCH = w64
else
ARCH = w32
endif
endif

CC = $(CROSSPREFIX)gcc
CFLAGS = -g -O2 -Wall
CFLAGS += -fno-strict-aliasing
Expand All @@ -75,6 +65,16 @@ RC = $(CROSSPREFIX)windres
RCFLAGS = --include-dir=$(PROOT)/include -DDEBUGBUILD=0 -O COFF
STRIP = $(CROSSPREFIX)strip -g

# Set environment var ARCH to your architecture to override autodetection.
ifndef ARCH
TARGET := $(shell $(CC) -dumpmachine)
ifeq ($(findstring x86_64,$(TARGET)),x86_64)
ARCH = w64
else
ARCH = w32
endif
endif

ifeq ($(ARCH),w64)
CFLAGS += -D_AMD64_
RCFLAGS += -F pe-x86-64
Expand Down
20 changes: 10 additions & 10 deletions src/Makefile.m32
Expand Up @@ -66,16 +66,6 @@ ifndef LIBCARES_PATH
LIBCARES_PATH = $(PROOT)/ares
endif

# Set environment var ARCH to your architecture to override autodetection.
ifndef ARCH
TARGET := $(shell $(CC) -dumpmachine)
ifeq ($(findstring x86_64,$(TARGET)),x86_64)
ARCH = w64
else
ARCH = w32
endif
endif

CC = $(CROSSPREFIX)gcc
CFLAGS = -g -O2 -Wall
CFLAGS += -fno-strict-aliasing
Expand All @@ -90,6 +80,16 @@ STRIP = $(CROSSPREFIX)strip -g
# PERL = perl
# NROFF = nroff

# Set environment var ARCH to your architecture to override autodetection.
ifndef ARCH
TARGET := $(shell $(CC) -dumpmachine)
ifeq ($(findstring x86_64,$(TARGET)),x86_64)
ARCH = w64
else
ARCH = w32
endif
endif

ifeq ($(ARCH),w64)
CFLAGS += -D_AMD64_
RCFLAGS += -F pe-x86-64
Expand Down

0 comments on commit cf510ad

Please sign in to comment.