source: trunk/makefile_pre.mk@ 904

Last change on this file since 904 was 903, checked in by Steven Levine, 18 years ago

Switch to wrc.exe as default resource compiler.
Support USE_RC wmake variable to override.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.4 KB
Line 
1# makefile_pre.mk - common makefile prefix settings for all makefiles
2# $Id: makefile_pre.mk 903 2008-01-05 02:51:36Z stevenhl $
3
4# 01 Sep 06 SHL Adjust .res case
5# 02 Jun 07 SHL Convert to OpenWatcom
6# 27 Jun 07 SHL Use same CFLAGS for all builds
7# 27 Jun 07 SHL Allow DEBUG set from command line or environment
8# 03 Jul 07 SHL Change DEBUG semantics to ifdef/ifndef
9# 04 Jul 07 SHL Pass DEBUG settings to sub-make
10# 22 Sep 07 SHL Switch to 4 byte packing (-zp4)
11# 26 Sep 07 SHL Support USE_WRC from environment
12# 03 Jan 08 SHL Switch to wrc.exe default; support USE_RC from environment
13
14CC = wcc386
15LINK = wlink
16
17!ifndef USE_RC # if not defined on command line
18!ifdef %USE_RC # if defined in environment
19USE_RC = $(%USE_RC)
20!else
21USE_RC = 0
22!endif
23!endif
24
25!if $(USE_RC)
26RC = rc
27!else
28RC = wrc
29!endif
30
31# Keep this code in sync with dll\makefile
32!ifdef DEBUG # if defined on wmake command line
33DEBUG_OPT = DEBUG=$(DEBUG) # set in case needed by sub-make
34!else
35!ifdef %DEBUG # if defined in environment
36DEBUG = $(%DEBUG) # use value from environment
37DEBUG_OPT = DEBUG=$(DEBUG) # set in case needed by sub-make
38!endif
39!endif
40
41# Some flags are order dependent - see OpenWatcom docs
42# -bc console app
43# -bd build target is a Dynamic Link Library (DLL) (see bd)
44# -bg gui app with WinMain entry point
45# -bm multithread libs
46# -bt=os2 target
47# -d2 full debug
48# -d3 full debug w/unref
49# -hd dwarf
50# -j signed char
51# -mf flat
52# -olinars optimze loops, inline, e(n)able fp recip, relax (a)lias, reordering, space
53# -s disable stack checks
54# -sg generate calls to grow the stack
55# -st touch stack through SS first
56# -wcd14 no reference to symbol
57# -wcd726 no reference to formal parameter
58# -wx max warnings
59# -zfp disable fs use
60# -zgp disable gs use
61# -zp4 align 4
62# -zq quiet
63
64# We always compile with debug info to avoid needed a full rebuild just to debug
65CFLAGS = -bt=os2 -mf -bm -d2 -olirs -s -j -wx -zfp -zgp -zp4 -zq -hd
66
67LFLAGS = sys os2v2_pm op quiet op verbose op cache op caseexact op map
68!ifdef DEBUG
69LFLAGS += debug dwarf all
70!endif
71
72# rc Includes can be in current director or dll subdirectory
73!if $(USE_RC)
74RCFLAGS = -r -i dll
75RCFLAGS2 = -x2
76!else
77# Pass 1 flags
78RCFLAGS = -r -i=dll -ad
79# Pass 2 flags
80RCFLAGS2 =-ad
81!endif
82
83.SUFFIXES:
84.SUFFIXES: .obj .c .res .rc .ipf
85
86!if $(USE_RC)
87.rc.res:
88 $(RC) $(RCFLAGS) $*.rc
89 ren $*.res $*.res
90!else
91.rc.res: .AUTODEPEND
92 $(RC) $(RCFLAGS) $*.rc
93!endif
94
95.c.obj: .AUTODEPEND
96 $(CC) $(CFLAGS) $*.c
97
98# The end
Note: See TracBrowser for help on using the repository browser.