source: trunk/makefile_pre.mk@ 1908

Last change on this file since 1908 was 1897, checked in by Gregg Young, 3 years ago

Add FM4_NOWARN_DSPACE this is to quiet FM/4 by skipping disk space check; used for AN main frame backup solution

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.8 KB
RevLine 
[237]1# makefile_pre.mk - common makefile prefix settings for all makefiles
2# $Id: makefile_pre.mk 1897 2022-08-14 19:14:53Z gyoung $
[9]3
[1514]4# Copyright (c) 1993-98 M. Kimes
[1890]5# Copyright (c) 2002-2020 Steven H. Levine
[1514]6
[903]7# 03 Jan 08 SHL Switch to wrc.exe default; support USE_RC from environment
[976]8# 23 Jan 08 JBS Add support for building SYM files (Ticket 226)
[1023]9# 27 May 08 SHL Add WARNALL and FORTIFY support
[1133]10# 22 Jul 08 SHL Pass FORTIFY to subordinate makefiles
[1259]11# 06 Oct 08 SHL Pass DEBUG in CFLAGS; clean up USE_RC usage
[1281]12# 18 Nov 08 JBS Ticket 297: Various build improvements/corrections
[1514]13# 13 Apr 10 SHL Drop HIMEM support
[1576]14# 21 Jun 11 GKY Add exceptq .xqs support
[1661]15# 07 Jan 11 SHL sort map
16# 25 Jan 12 SHL Comments
[1890]17# 14 Aug 15 SHL Test hll debug - FIXME to be gone
18# 25 Jan 20 SHL Add PMPRINTF support - PMPRINTF_OPT CFLAGS
[1897]19# 06 Aug 22 GKY Add FM4_NOWARN_DSPACE
[481]20
[1259]21# Environment: see dll\makefile
22
23# DEBUG - not defined = release build, defined = debug build
24# WARNALL - add more warnings if defined
25# FORTIFY - build with FORTIFYed memory
26# USE_RC - build with rc.exe if defined, other build with wrc.exe
27
[691]28CC = wcc386
29LINK = wlink
[9]30
[903]31!ifndef USE_RC # if not defined on command line
32!ifdef %USE_RC # if defined in environment
33USE_RC = $(%USE_RC)
[714]34!endif
[874]35!endif
[691]36
[1259]37!ifdef USE_RC
[1281]38RC = rc -n
[903]39!else
[1281]40RC = wrc -q
[237]41!endif
[9]42
[719]43# Keep this code in sync with dll\makefile
[1661]44!ifdef DEBUG # if defined on wmake command line
[720]45DEBUG_OPT = DEBUG=$(DEBUG) # set in case needed by sub-make
46!else
[1661]47!ifdef %DEBUG # if defined in environment
48DEBUG = $(%DEBUG) # use value from environment
[720]49DEBUG_OPT = DEBUG=$(DEBUG) # set in case needed by sub-make
[719]50!endif
51!endif
52
[1023]53!ifdef %WARNALL # if defined in environment
54WARNALL = $(%WARNALL) # use value from environment
55!endif
56
[1133]57!ifdef FORTIFY # if defined on wmake command line
58FORTIFY_OPT = FORTIFY=$(FORTIFY) # set in case needed by sub-make
59!else
[1661]60!ifdef %FORTIFY # if defined in environment
61FORTIFY = $(%FORTIFY) # use value from environment
[1133]62FORTIFY_OPT = FORTIFY=$(FORTIFY) # set in case needed by sub-make
[1023]63!endif
[1133]64!endif
[1023]65
[1890]66!ifdef PMPRINTF # if defined on wmake command line
67PMPRINTF_OPT = PMPRINTF=$(PMPRINTF) # set in case needed by sub-make
68!else
69!ifdef %PMPRINTF # if defined in environment
70PMPRINTF = $(%PMPRINTF) # use value from environment
71PMPRINTF_OPT = PMPRINTF=$(PMPRINTF) # set in case needed by sub-make
72!endif
73!endif
74
[1897]75!ifdef FM4_NOWARN_DSPACE # if defined on wmake command line
76FM4_NOWARN_DSPACE_OPT = FM4_NOWARN_DSPACE=$(FM4_NOWARN_DSPACE) # set in case needed by sub-make
77!else
78!ifdef %FM4_NOWARN_DSPACE
79FM4_NOWARN_DSPACE = $(%FM4_NOWARN_DSPACE) # use value from environment
80FM4_NOWARN_DSPACE_OPT = FM4_NOWARN_DSPACE=$(FM4_NOWARN_DSPACE) # set in case needed by sub-make
81!endif
82!endif
83
[1661]84SYMS = $(BASE).sym # target for building SYM files
[976]85
[691]86# Some flags are order dependent - see OpenWatcom docs
87# -bc console app
88# -bd build target is a Dynamic Link Library (DLL) (see bd)
89# -bg gui app with WinMain entry point
90# -bm multithread libs
91# -bt=os2 target
92# -d2 full debug
93# -d3 full debug w/unref
94# -hd dwarf
95# -j signed char
96# -mf flat
97# -olinars optimze loops, inline, e(n)able fp recip, relax (a)lias, reordering, space
98# -s disable stack checks
99# -sg generate calls to grow the stack
100# -st touch stack through SS first
[907]101# -we treat warnings as errors
[691]102# -wx max warnings
103# -zfp disable fs use
104# -zgp disable gs use
105# -zp4 align 4
106# -zq quiet
[9]107
[1023]108# -wx excludes these
109# See GenCOptions() in openwatcom\bld\cc\c\coptions.c
110# -wce130 possible loss of precision
111# -wcd=303 no reference to formal parameter
112# -wcd=307 obsolete non-prototype declarator
113# -wcd=308 unprototyped function called
114# -wcd=309 unprototyped function called indirectly
115
[1133]116# We always compile with debug info to avoid needing a full rebuild just to debug
[1890]117# 2015-08-14 SHL HLL debug testing
118# CFLAGS = -bt=os2 -mf -bm -d2 -olirs -s -j -wx -zfp -zgp -zp4 -zq -hc
[1661]119CFLAGS = -bt=os2 -mf -bm -d2 -olirs -s -j -wx -zfp -zgp -zp4 -zq -hd
[9]120
[1023]121!ifdef WARNALL
122CFLAGS += -wce=118 -wce=130 -wce=303 -wce=307 -wce=308 -wce=309
123!else
124CFLAGS += -we
125!endif
126
127!ifdef FORTIFY
128CFLAGS += -dFORTIFY
129!endif
130
[1890]131!ifdef PMPRINTF
132CFLAGS += -dPMPRINTF
133!endif
134
[1613]135LFLAGS = sys os2v2_pm op quiet op verbose op cache op caseexact op map sort global
[719]136!ifdef DEBUG
[1259]137CFLAGS += -d$DEBUG_OPT
[1890]138# 2015-08-14 SHL HLL debug testing
139# LFLAGS += debug hll all
[719]140LFLAGS += debug dwarf all
[691]141!endif
[9]142
[691]143# rc Includes can be in current director or dll subdirectory
[1259]144!ifdef USE_RC
[903]145RCFLAGS = -r -i dll
146RCFLAGS2 = -x2
147!else
[691]148# Pass 1 flags
149RCFLAGS = -r -i=dll -ad
150# Pass 2 flags
151RCFLAGS2 =-ad
152!endif
153
[9]154.SUFFIXES:
[1576]155.SUFFIXES: .obj .c .res .rc .ipf .sym .map .xqs
[9]156
[1259]157!ifdef USE_RC
[9]158.rc.res:
[1282]159 @echo.
160 @echo Compiling resource: $*.rc
161 @echo.
[691]162 $(RC) $(RCFLAGS) $*.rc
[481]163 ren $*.res $*.res
[903]164!else
165.rc.res: .AUTODEPEND
[1282]166 @echo.
167 @echo Compiling resource: $*.rc
168 @echo.
[903]169 $(RC) $(RCFLAGS) $*.rc
[691]170!endif
[9]171
[691]172.c.obj: .AUTODEPEND
173 $(CC) $(CFLAGS) $*.c
[9]174
[1890]175# eof
Note: See TracBrowser for help on using the repository browser.