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