1 | # makefile_pre.mk - common makefile prefix settings for all makefiles
|
---|
2 | # $Id: makefile_pre.mk 842 2007-09-23 19:27:41Z 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 | # 22 Sep 07 SHL Switch to 4 byte packing (-zp4)
|
---|
11 |
|
---|
12 | CC = wcc386
|
---|
13 | LINK = wlink
|
---|
14 |
|
---|
15 | # fixme use use wrc when wrc fixed (v1.7 maybe)
|
---|
16 | # wrc 1.6 is broken - does not copy resident name table
|
---|
17 |
|
---|
18 | !ifndef USE_WRC
|
---|
19 | USE_WRC = 0
|
---|
20 | !endif
|
---|
21 |
|
---|
22 | !if $(USE_WRC)
|
---|
23 | RC = wrc
|
---|
24 | !else
|
---|
25 | RC = rc
|
---|
26 | !endif
|
---|
27 |
|
---|
28 | # Keep this code in sync with dll\makefile
|
---|
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
|
---|
35 | !endif
|
---|
36 | !endif
|
---|
37 |
|
---|
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
|
---|
60 |
|
---|
61 | # We always compile with debug info to avoid needed a full rebuild just to debug
|
---|
62 | CFLAGS = -bt=os2 -mf -bm -d2 -olirs -s -j -wx -zfp -zgp -zp4 -zq -hd
|
---|
63 |
|
---|
64 | LFLAGS = sys os2v2_pm op quiet op verbose op cache op caseexact op map
|
---|
65 | !ifdef DEBUG
|
---|
66 | LFLAGS += debug dwarf all
|
---|
67 | !endif
|
---|
68 |
|
---|
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 |
|
---|
80 | .SUFFIXES:
|
---|
81 | .SUFFIXES: .obj .c .res .rc .ipf
|
---|
82 |
|
---|
83 | !if $(USE_WRC)
|
---|
84 | .rc.res: .AUTODEPEND
|
---|
85 | $(RC) $(RCFLAGS) $*.rc
|
---|
86 | !else
|
---|
87 | .rc.res:
|
---|
88 | $(RC) $(RCFLAGS) $*.rc
|
---|
89 | ren $*.res $*.res
|
---|
90 | !endif
|
---|
91 |
|
---|
92 | .c.obj: .AUTODEPEND
|
---|
93 | $(CC) $(CFLAGS) $*.c
|
---|
94 |
|
---|
95 | # The end
|
---|