source: trunk/makefile_pre.mk@ 982

Last change on this file since 982 was 976, checked in by John Small, 18 years ago

Ticket 226: Add support for building SYM files to the build process
and add a package of files/icons to the Warpin WPI file to support
debugging efforts.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1# makefile_pre.mk - common makefile prefix settings for all makefiles
2# $Id: makefile_pre.mk 976 2008-02-23 19:58:02Z jbs $
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# 23 Jan 08 JBS Add support for building SYM files (Ticket 226)
14
15CC = wcc386
16LINK = wlink
17
18!ifndef USE_RC # if not defined on command line
19!ifdef %USE_RC # if defined in environment
20USE_RC = $(%USE_RC)
21!else
22USE_RC = 0
23!endif
24!endif
25
26!if $(USE_RC)
27RC = rc
28!else
29RC = wrc
30!endif
31
32# Keep this code in sync with dll\makefile
33!ifdef DEBUG # if defined on wmake command line
34DEBUG_OPT = DEBUG=$(DEBUG) # set in case needed by sub-make
35!else
36!ifdef %DEBUG # if defined in environment
37DEBUG = $(%DEBUG) # use value from environment
38DEBUG_OPT = DEBUG=$(DEBUG) # set in case needed by sub-make
39!endif
40!endif
41
42!ifdef DEBUG #if DEBUG is defined
43! ifeq DEBUG 1 #if it is 1
44! ifdef %PERLLIB #if PRELLIB env. var is defined (i.e. Perl is installed?)
45SYMS = $(BASE).sym #set a target for building SYM files
46! endif
47! endif
48!endif
49
50# Some flags are order dependent - see OpenWatcom docs
51# -bc console app
52# -bd build target is a Dynamic Link Library (DLL) (see bd)
53# -bg gui app with WinMain entry point
54# -bm multithread libs
55# -bt=os2 target
56# -d2 full debug
57# -d3 full debug w/unref
58# -hd dwarf
59# -j signed char
60# -mf flat
61# -olinars optimze loops, inline, e(n)able fp recip, relax (a)lias, reordering, space
62# -s disable stack checks
63# -sg generate calls to grow the stack
64# -st touch stack through SS first
65# -wcd14 no reference to symbol
66# -wcd726 no reference to formal parameter
67# -we treat warnings as errors
68# -wx max warnings
69# -zfp disable fs use
70# -zgp disable gs use
71# -zp4 align 4
72# -zq quiet
73
74# We always compile with debug info to avoid needed a full rebuild just to debug
75CFLAGS = -bt=os2 -mf -bm -d2 -olirs -s -j -we -wx -zfp -zgp -zp4 -zq -hd
76
77LFLAGS = sys os2v2_pm op quiet op verbose op cache op caseexact op map
78!ifdef DEBUG
79LFLAGS += debug dwarf all
80!endif
81
82# rc Includes can be in current director or dll subdirectory
83!if $(USE_RC)
84RCFLAGS = -r -i dll
85RCFLAGS2 = -x2
86!else
87# Pass 1 flags
88RCFLAGS = -r -i=dll -ad
89# Pass 2 flags
90RCFLAGS2 =-ad
91!endif
92
93.SUFFIXES:
94.SUFFIXES: .obj .c .res .rc .ipf .sym .map
95
96!if $(USE_RC)
97.rc.res:
98 $(RC) $(RCFLAGS) $*.rc
99 ren $*.res $*.res
100!else
101.rc.res: .AUTODEPEND
102 $(RC) $(RCFLAGS) $*.rc
103!endif
104
105.c.obj: .AUTODEPEND
106 $(CC) $(CFLAGS) $*.c
107
108# The end
Note: See TracBrowser for help on using the repository browser.