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