source: trunk/makefile_pre.mk@ 796

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

Pass DEBUG to sub-makes

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