forked from statgen/statgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile.toolchain
73 lines (64 loc) · 1.82 KB
/
Makefile.toolchain
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#
# This file allows us to create windows
# 32 and 64 bit binaries instead of binaries
# for the compiling host. It assumes that the
# GNU compiler suite is the compiler for all
# three targets.
#
# TARGET is a bit of a misnomer. The goal is
# really to allow different toolchains to be used
# to build the system.
#
# Supported TARGET values include:
#
# mingw32
# mingw64 (except c++, so mostly not)
# llvm
# clang
#
# Typical use is to say at the toplevel:
# make
# or
# make TARGET=mingw32
# or
# make TARGET=mingw64
#
# But you can also just set it here:
#
# TARGET=mingw32
ifeq ($(TARGET),mingw)
TARGET=mingw32
endif
TOOLCHAIN_DIR=/usr/bin
ifeq ($(TARGET), mingw32)
TOOLCHAIN_PREFIX=i586-mingw32msvc-
else ifeq ($(TARGET), mingw64)
TOOLCHAIN_PREFIX=amd64-mingw32msvc-
else ifeq ($(TARGET),llvm)
TOOLCHAIN_PREFIX=llvm-
else
TOOLCHAIN_PREFIX=
endif
# CPP0X=-std=c++0x
CXX = $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PREFIX)g++ $(CPP0X)
CC = $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PREFIX)gcc
LD = $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PREFIX)ld
AR = $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PREFIX)ar
RANLIB = $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PREFIX)ranlib
OBJCOPY = $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PREFIX)objcopy
OBJDUMP = $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PREFIX)objdump
STRIP = $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PREFIX)strip
NM = $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PREFIX)nm
SIZE = $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PREFIX)size
CPP = $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PREFIX)cpp
AS = $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PREFIX)as
F77 = $(TOOLCHAIN_DIR)/$(TOOLCHAIN_PREFIX)gfortran
#
# clang is a drop in replacement for c++ and cc:
#
ifeq ($(TARGET), clang)
CXX=clang
CC=clang
endif
CCVERSION = $(shell $(CC) -dumpversion )
EXPORT_TOOLCHAIN="export RANLIB=$(RANLIB); export AR=$(AR); export CC='$(CC)'; export CXX='$(CXX)'; export LD=$(LD); export CCVERSION=$(CCVERSION)"