-
Notifications
You must be signed in to change notification settings - Fork 7
/
config.vs2013.mk
151 lines (131 loc) · 5.4 KB
/
config.vs2013.mk
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
# ******************************************************************************
# config.vs2013.mk make-it-quick project
# ******************************************************************************
#
# File description:
#
# Makefile configuration file for Visual Studio 2013
#
# Compiler options:
# https://msdn.microsoft.com/en-us/library/fwkeyyhe%28v=vs.120%29.aspx
#
#
#
#
#
# ******************************************************************************
# This software is licensed under the GNU General Public License v3
# (C) 2017-2019, Christophe de Dinechin <[email protected]>
# ******************************************************************************
# This file is part of make-it-quick
#
# make-it-quick is free software: you can r redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# make-it-quick is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with make-it-quick, in a file named COPYING.
# If not, see <https://www.gnu.org/licenses/>.
# ******************************************************************************
#------------------------------------------------------------------------------
# Tools
#------------------------------------------------------------------------------
# -nologo: suppresses display of sign-on banner
# -TC: C mode
# -TP: C++ mode
CC= cl -nologo -TC
CXX= cl -nologo -TP -EHsc
CPP= cl -nologo -E
LD= link -nologo
MSLIB= lib -nologo
PYTHON= python
AR= no-ar-on-windows
RANLIB= no-ranlib-on-windows
INSTALL=install
CAT= type
#------------------------------------------------------------------------------
# Compilation flags
#------------------------------------------------------------------------------
#
# Options in Visual Studio are an anti-poem: no rhyme, no reason.
#
# For example, debug options are: -Z7, -ZI and -Zi.
# But don't think -Z is for debugging. -Za and -Ze disable extensions,
# whereas -Zc controls language conformance,
# and -Zg generates function prototypes. All this is perfectly normal.
#
# For a good introduction to the logic of of Microsoft options,
# watch the neuralyzer scenes in Men In Black. Swamp gas, Venus.
#
# For a true (and truly shocking) reference about the options,
# see https://msdn.microsoft.com/en-us/library/958x11bc.aspx
#
# For now, -Wall is hopeless on Visual Studio 2013
# -TP=C++ mode
# -EHa=Exception model catching both structured and unstructured exceptions
CXXFLAGS_BUILDENV_vs2013= -TP -EHa -EHsc
# -Z7=Put debug information in .obj files (don't laugh)
# -Zi=Set debug information format to Program Database
# -O2=Optimise for speed (-O1 is for size, -Ob for inline functions, and so on)
CFLAGS_TARGET_debug= -Zi -DEBUG
CFLAGS_TARGET_opt= -O2 -Zi -DEBUG
CFLAGS_TARGET_release= -O2
# Curiously, the C++ compiler takes the same options as the C compiler. Bug?
CXXFLAGS_TARGET_debug= -Zi -EHa -EHsc -DEBUG
CXXFLAGS_opt= -O2 -Zi -EHa -EHsc -DEBUG
CXXFLAGS_release= -O2 -EHa -EHsc
DEFINES_BUILDENV_vs2013= WIN32
OS_NAME_BUILDENV_vs2013= windows
# Options specific to profiling
# OBJ_PDB is the .pdb file (profile database) associated to a Windows
# binary (.exe, .lib), containing profile and debug information
MIQ_PDB:= $(MIQ_OUTEXE:%.exe=%.pdb)
CFLAGS_TARGET_profile= -Fd$(MIQ_PDB) -O2 -Zi -DEBUG
CXXFLAGS_TARGET_profile=-Fd$(MIQ_PDB) -O2 -Zi -EHa -EHsc -DEBUG
LDFLAGS_TARGET_profile= -pdb:$(MIQ_PDB) -debug
#------------------------------------------------------------------------------
# File extensions
#------------------------------------------------------------------------------
EXT.obj=.obj
EXT.lib=.lib
EXT.exe=.exe
EXT.dll=.dll
PFX.exe=
PFX.lib=
PFX.dll=
LINK_DIR_OPT=-L:
LINK_LIB_OPT=-l:
LINK_DLL_OPT=-l:
#------------------------------------------------------------------------------
# Build rules
#------------------------------------------------------------------------------
# Visual C++ really goes out of its way now to have incompatible options
# For example, -o was recently 'deprecated' in favor of -Fo (!!!!)
#
# For debugging and profiling, we specify the -Fd and -pdb option.
# In order to merge all .pdb information for an executable, we need to pass the -debug
# option to the linker.
COMPILE.c= $(CC) $(MIQ_CFLAGS) -c -Fo$@ $<
COMPILE.cpp= $(CXX) $(MIQ_CXXFLAGS) -c -Fo$@ $<
COMPILE.cc= $(COMPILE.cpp)
MAKE_DIR= mkdir -p $*
MAKE_OBJDIR= $(MAKE_DIR) && touch $@
LINK.lib= $(MSLIB) $(MIQ_LINKOPTS) -out:$@
LINK.dll= $(LD) $(MIQ_LINKOPTS) $(MIQ_LDFLAGS) -dll -out:$@
LINK.exe= $(LD) $(MIQ_LINKOPTS) $(MIQ_LDFLAGS) -out:$@
#------------------------------------------------------------------------------
# Dependencies
#------------------------------------------------------------------------------
# Can't build the dependencies with the Visual Studio compilers at the moment
GNU_CC= gcc
GNU_CXX= g++
GNU_AS= gcc -x assembler-with-cpp
CC_DEPEND= $(GNU_CC) -D_WIN32=1 $(GFLAGS) -MM -MF $@ -MT $(@:.d=) $<
CXX_DEPEND= $(GNU_CXX) -D_WIN32=1 $(GXXFLAGS) -MM -MF $@ -MT $(@:.d=) $<
AS_DEPEND= $(GNU_AS) -D_WIN32=1 $(GASFLAGS) -MM -MF $@ -MT $(@:.d=) $<