| 1 | # makefile_pre.mk - common makefile prefix settings for all makefiles
 | 
|---|
| 2 | # $Id: makefile_pre.mk 720 2007-07-04 22:01:34Z 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 | 
 | 
|---|
| 11 | CC = wcc386
 | 
|---|
| 12 | LINK = wlink
 | 
|---|
| 13 | 
 | 
|---|
| 14 | # fixme use use wrc when wrc fixed (v1.7 maybe)
 | 
|---|
| 15 | # wrc 1.6 is broken - does not copy resident name table
 | 
|---|
| 16 | 
 | 
|---|
| 17 | !ifndef USE_WRC
 | 
|---|
| 18 | USE_WRC = 0
 | 
|---|
| 19 | !endif
 | 
|---|
| 20 | 
 | 
|---|
| 21 | !if $(USE_WRC)
 | 
|---|
| 22 | RC = wrc
 | 
|---|
| 23 | !else
 | 
|---|
| 24 | RC = rc
 | 
|---|
| 25 | !endif
 | 
|---|
| 26 | 
 | 
|---|
| 27 | # Keep this code in sync with dll\makefile
 | 
|---|
| 28 | !ifdef DEBUG                    # if defined on wmake command line
 | 
|---|
| 29 | DEBUG_OPT = DEBUG=$(DEBUG)      # set in case needed by sub-make
 | 
|---|
| 30 | !else
 | 
|---|
| 31 | !ifdef %DEBUG                   # if defined in environment
 | 
|---|
| 32 | DEBUG = $(%DEBUG)               # use value from environment
 | 
|---|
| 33 | DEBUG_OPT = DEBUG=$(DEBUG)      # set in case needed by sub-make
 | 
|---|
| 34 | !endif
 | 
|---|
| 35 | !endif
 | 
|---|
| 36 | 
 | 
|---|
| 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
 | 
|---|
| 59 | 
 | 
|---|
| 60 | # We always compile with debug info to avoid needed a full rebuild just to debug
 | 
|---|
| 61 | CFLAGS = -bt=os2 -mf -bm -d2 -olirs   -s -j -wx -zfp -zgp -zq -hd
 | 
|---|
| 62 | 
 | 
|---|
| 63 | LFLAGS = sys os2v2_pm op quiet op verbose op cache op caseexact op map
 | 
|---|
| 64 | !ifdef DEBUG
 | 
|---|
| 65 | LFLAGS += debug dwarf all
 | 
|---|
| 66 | !endif
 | 
|---|
| 67 | 
 | 
|---|
| 68 | # rc Includes can be in current director or dll subdirectory
 | 
|---|
| 69 | !if $(USE_WRC)
 | 
|---|
| 70 | # Pass 1 flags
 | 
|---|
| 71 | RCFLAGS = -r -i=dll -ad
 | 
|---|
| 72 | # Pass 2 flags
 | 
|---|
| 73 | RCFLAGS2 =-ad
 | 
|---|
| 74 | !else
 | 
|---|
| 75 | RCFLAGS = -r -i dll
 | 
|---|
| 76 | RCFLAGS2 = -x2
 | 
|---|
| 77 | !endif
 | 
|---|
| 78 | 
 | 
|---|
| 79 | .SUFFIXES:
 | 
|---|
| 80 | .SUFFIXES: .obj .c .res .rc .ipf
 | 
|---|
| 81 | 
 | 
|---|
| 82 | !if $(USE_WRC)
 | 
|---|
| 83 | .rc.res: .AUTODEPEND
 | 
|---|
| 84 |   $(RC) $(RCFLAGS) $*.rc
 | 
|---|
| 85 | !else
 | 
|---|
| 86 | .rc.res:
 | 
|---|
| 87 |    $(RC) $(RCFLAGS) $*.rc
 | 
|---|
| 88 |    ren $*.res $*.res
 | 
|---|
| 89 | !endif
 | 
|---|
| 90 | 
 | 
|---|
| 91 | .c.obj: .AUTODEPEND
 | 
|---|
| 92 |   $(CC) $(CFLAGS) $*.c
 | 
|---|
| 93 | 
 | 
|---|
| 94 | # The end
 | 
|---|