[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] | 11 | CC = wcc386
|
---|
| 12 | LINK = 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] | 18 | USE_WRC = 0
|
---|
[714] | 19 | !endif
|
---|
[691] | 20 |
|
---|
| 21 | !if $(USE_WRC)
|
---|
| 22 | RC = wrc
|
---|
| 23 | !else
|
---|
| 24 | RC = 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
|
---|
| 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
|
---|
[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] | 61 | CFLAGS = -bt=os2 -mf -bm -d2 -olirs -s -j -wx -zfp -zgp -zq -hd
|
---|
[9] | 62 |
|
---|
[691] | 63 | LFLAGS = sys os2v2_pm op quiet op verbose op cache op caseexact op map
|
---|
[719] | 64 | !ifdef DEBUG
|
---|
| 65 | LFLAGS += 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
|
---|
| 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 |
|
---|
[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
|
---|