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