source: trunk/makefile_pre.mk@ 1657

Last change on this file since 1657 was 1613, checked in by Steven Levine, 14 years ago

Sort map

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 KB
Line 
1# makefile_pre.mk - common makefile prefix settings for all makefiles
2# $Id: makefile_pre.mk 1613 2011-08-12 07:59:41Z stevenhl $
3
4# Copyright (c) 1993-98 M. Kimes
5# Copyright (c) 2002, 2011 Steven H. Levine
6
7# 03 Jan 08 SHL Switch to wrc.exe default; support USE_RC from environment
8# 23 Jan 08 JBS Add support for building SYM files (Ticket 226)
9# 27 May 08 SHL Add WARNALL and FORTIFY support
10# 22 Jul 08 SHL Pass FORTIFY to subordinate makefiles
11# 06 Oct 08 SHL Pass DEBUG in CFLAGS; clean up USE_RC usage
12# 18 Nov 08 JBS Ticket 297: Various build improvements/corrections
13# 12 Jul 09 GKY Allow FM/2 to load in high memory call exehdr /hi
14# 13 Apr 10 SHL Drop HIMEM support
15# 21 Jun 11 GKY Add exceptq .xqs support
16# 2011-07-01 SHL sort map
17
18# Environment: see dll\makefile
19
20# DEBUG - not defined = release build, defined = debug build
21# WARNALL - add more warnings if defined
22# FORTIFY - build with FORTIFYed memory
23# USE_RC - build with rc.exe if defined, other build with wrc.exe
24
25CC = wcc386
26LINK = wlink
27
28!ifndef USE_RC # if not defined on command line
29!ifdef %USE_RC # if defined in environment
30USE_RC = $(%USE_RC)
31!endif
32!endif
33
34!ifdef USE_RC
35RC = rc -n
36!else
37RC = wrc -q
38!endif
39
40# Keep this code in sync with dll\makefile
41!ifdef DEBUG # if defined on wmake command line
42DEBUG_OPT = DEBUG=$(DEBUG) # set in case needed by sub-make
43!else
44!ifdef %DEBUG # if defined in environment
45DEBUG = $(%DEBUG) # use value from environment
46DEBUG_OPT = DEBUG=$(DEBUG) # set in case needed by sub-make
47!endif
48!endif
49
50!ifdef %WARNALL # if defined in environment
51WARNALL = $(%WARNALL) # use value from environment
52!endif
53
54!ifdef FORTIFY # if defined on wmake command line
55FORTIFY_OPT = FORTIFY=$(FORTIFY) # set in case needed by sub-make
56!else
57!ifdef %FORTIFY # if defined in environment
58FORTIFY = $(%FORTIFY) # use value from environment
59FORTIFY_OPT = FORTIFY=$(FORTIFY) # set in case needed by sub-make
60!endif
61!endif
62
63SYMS = $(BASE).sym #set a target for building SYM files
64
65# Some flags are order dependent - see OpenWatcom docs
66# -bc console app
67# -bd build target is a Dynamic Link Library (DLL) (see bd)
68# -bg gui app with WinMain entry point
69# -bm multithread libs
70# -bt=os2 target
71# -d2 full debug
72# -d3 full debug w/unref
73# -hd dwarf
74# -j signed char
75# -mf flat
76# -olinars optimze loops, inline, e(n)able fp recip, relax (a)lias, reordering, space
77# -s disable stack checks
78# -sg generate calls to grow the stack
79# -st touch stack through SS first
80# -we treat warnings as errors
81# -wx max warnings
82# -zfp disable fs use
83# -zgp disable gs use
84# -zp4 align 4
85# -zq quiet
86
87# -wx excludes these
88# See GenCOptions() in openwatcom\bld\cc\c\coptions.c
89# -wce130 possible loss of precision
90# -wcd=303 no reference to formal parameter
91# -wcd=307 obsolete non-prototype declarator
92# -wcd=308 unprototyped function called
93# -wcd=309 unprototyped function called indirectly
94
95# We always compile with debug info to avoid needing a full rebuild just to debug
96CFLAGS = -bt=os2 -mf -bm -d2 -olirs -s -j -wx -zfp -zgp -zp4 -zq -hd
97
98!ifdef WARNALL
99CFLAGS += -wce=118 -wce=130 -wce=303 -wce=307 -wce=308 -wce=309
100!else
101CFLAGS += -we
102!endif
103
104!ifdef FORTIFY
105CFLAGS += -dFORTIFY
106!endif
107
108LFLAGS = sys os2v2_pm op quiet op verbose op cache op caseexact op map sort global
109!ifdef DEBUG
110CFLAGS += -d$DEBUG_OPT
111LFLAGS += debug dwarf all
112!endif
113
114# rc Includes can be in current director or dll subdirectory
115!ifdef USE_RC
116RCFLAGS = -r -i dll
117RCFLAGS2 = -x2
118!else
119# Pass 1 flags
120RCFLAGS = -r -i=dll -ad
121# Pass 2 flags
122RCFLAGS2 =-ad
123!endif
124
125.SUFFIXES:
126.SUFFIXES: .obj .c .res .rc .ipf .sym .map .xqs
127
128!ifdef USE_RC
129.rc.res:
130 @echo.
131 @echo Compiling resource: $*.rc
132 @echo.
133 $(RC) $(RCFLAGS) $*.rc
134 ren $*.res $*.res
135!else
136.rc.res: .AUTODEPEND
137 @echo.
138 @echo Compiling resource: $*.rc
139 @echo.
140 $(RC) $(RCFLAGS) $*.rc
141!endif
142
143.c.obj: .AUTODEPEND
144 $(CC) $(CFLAGS) $*.c
145
146# The end
Note: See TracBrowser for help on using the repository browser.