source: trunk/makefile_pre.mk@ 1607

Last change on this file since 1607 was 1576, checked in by Gregg Young, 14 years ago

Changes to support .xqs files for the exes and add them to the "clean" targets. Make loading as much code, data and resources as possible in high memory the default (still need to added a low memory build option).

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