summaryrefslogtreecommitdiff
path: root/include/makeinclude/compiler.bor
blob: a19075be82ff85448ebd3141fffc62f6a3727653 (plain)
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
#
# Defines specific to a particular version of the compiler
#
# Inputs:
# ~~~~~~~
# STATIC - if defined means creating a static library or executable
# PASCAL - if defined means link dll against pascal run-time library
# DEBUG - if defined means building with debug information
# UNICODE - if defined means building unicode
#
# Outputs:
# ~~~~~~~~
# CC - name of compiler
# LD - name of linker
# AR - name of librarian
# RC - name of resource compiler
# COMMON_CFLAGS - compiler flags for all targets
# COMMON_LFLAGS - linker flags for all targets
# COMMON_LIBS - linker library files for all targets
# DLL_CFLAGS - compiler flags specific to DLL targets
# DLL_LFLAGS - linker flags specific to DLL targets
# DLL_STARTUP_OBJ - start-up object files for DLL targets
# EXE_CFLAGS - compiler flags specific to EXE targets
# EXE_LFLAGS - linker flags specific to EXE targets
# EXE_STARTUP_OBJ - start-up object files for EXE targets
# LIB_CFLAGS - compiler flags specific to static lib targets
# LIB_LFLAGS - flags specific to static lib targets (passed to
#              librarian)
#


!include <$(ACE_ROOT)\include\makeinclude\ace_flags.bor>

#
# Build tools
#

CC = bcc32
LD = ilink32
AR = tlib
RC = brcc32

#
# Common flags
#

!ifdef DEBUG
DEBUG_CFLAGS = -v -y -Od -r- -vi- -k -D_DEBUG -DACE_NO_INLINE=1
DEBUG_LFLAGS = -v
!else
DEBUG_CFLAGS = -O2 -DNDEBUG
DEBUG_LFLAGS =
!endif

!ifdef STATIC
STATIC_CFLAGS =
STATIC_LFLAGS =
!else
STATIC_CFLAGS = -tWR
STATIC_LFLAGS =
!endif

!ifdef CODEGUARD
CODEGUARD_CFLAGS = -vG
!endif

!ifdef UNICODE
UNICODE_CFLAGS = -DACE_USES_WCHAR -WU
!endif

!ifdef PCH_HEADER
PCH_CFLAGS = -H=$(OBJDIR)\$(NAME).csm -Hh=$(PCH_HEADER)
!endif

THREAD_CFLAGS = -D_MT -tWM
WARNINGS_CFLAGS = -w-rvl -w-rch -w-ccc -w-obs -w-aus -w-pia -w-inl
DEFINES_CFLAGS = -DWIN32;_NO_VCL
QUIET_CFLAGS = -q
MISC_CFLAGS = -a8 -b
DECORATOR_CFLAGS = -DACE_LD_DECORATOR_STR=ACE_LIB_TEXT(\"$(LIB_DECORATOR)\")

COMMON_CFLAGS = $(QUIET_CFLAGS) $(DEBUG_CFLAGS) $(THREAD_CFLAGS) \
	$(STATIC_CFLAGS) $(WARNINGS_CFLAGS) $(DEFINES_CFLAGS) \
	$(MISC_CFLAGS) $(CODEGUARD_CFLAGS) $(UNICODE_CFLAGS) \
	$(DECORATOR_CFLAGS) $(PCH_CFLAGS)

COMMON_LFLAGS = $(DEBUG_LFLAGS) $(STATIC_LFLAGS) -x -w-dup -Gn

#
# DLL specific flags
#

DLL_CFLAGS = -tWD
DLL_LFLAGS = -Tpd -Gi
!ifdef PASCAL
!ifdef UNICODE
DLL_STARTUP_OBJ = c0d32w.obj sysinit.obj
!else
DLL_STARTUP_OBJ = c0d32.obj sysinit.obj
!endif
!else
!ifdef UNICODE
DLL_STARTUP_OBJ = c0d32w.obj
!else
DLL_STARTUP_OBJ = c0d32.obj
!endif
!endif

#
# EXE specific flags
#

EXE_CFLAGS =
EXE_LFLAGS = -Tpe
!ifdef PASCAL
!ifdef UNICODE
EXE_STARTUP_OBJ = c0x32w.obj sysinit.obj
!else
EXE_STARTUP_OBJ = c0x32.obj sysinit.obj
!endif
!else
!ifdef UNICODE
EXE_STARTUP_OBJ = c0x32w.obj
!else
EXE_STARTUP_OBJ = c0x32.obj
!endif
!endif

#
# Static lib specific flags
#

LIB_CFLAGS =
!ifdef DEBUG
LIB_LFLAGS = /C /P4096
!else
LIB_LFLAGS = /C /P512
!endif

#
# VCL lib version number
#

!if $(BCBVER) == 6
VCLVER =
!else
!if $(BCBVER) == 5
VCLVER = 50
!else
VCLVER = 40
!endif
!endif

#
# Libraries to be linked
#

!ifdef CODEGUARD
CODEGUARD_LIB = cg32.lib
!endif

!ifdef STATIC
!ifdef PASCAL
COMMON_LIBS = $(CODEGUARD_LIB) import32.lib vcl$(VCLVER).lib vcle$(VCLVER).lib cp32mt.lib ws2_32.lib
!else
COMMON_LIBS = $(CODEGUARD_LIB) import32.lib cw32mt.lib ws2_32.lib
!endif
!else
!ifdef PASCAL
COMMON_LIBS = $(CODEGUARD_LIB) import32.lib vcl$(VCLVER).bpi vcle$(VCLVER).lib cp32mti.lib ws2_32.lib
!else
COMMON_LIBS = $(CODEGUARD_LIB) import32.lib cw32mti.lib ws2_32.lib
!endif
!endif