source: trunk/dll/makefile@ 1569

Last change on this file since 1569 was 1569, checked in by Steven Levine, 14 years ago

Add exceptq .xqs support

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 9.0 KB
RevLine 
[72]1# dll\makefile - build fm/2 dlls, help files, string tables and resource kit
[62]2# $Id: makefile 1569 2011-05-31 21:13:18Z stevenhl $
[21]3
[415]4# Copyright (c) 1993-98 M. Kimes
[1394]5# Copyright (c) 2002, 2009 Steven H. Levine
[415]6
[134]7# 22 May 03 SHL Correct icon dependencies
[673]8# 12 May 07 SHL Drop obsolete macros
[691]9# 02 Jun 07 SHL Convert to OpenWatcom
[719]10# 27 Jun 07 SHL Allow DEBUG set from command line or environment
11# 03 Jul 07 SHL Change DEBUG semantics to ifdef/ifndef
[720]12# 04 Jul 07 SHL Pass DEBUG settings to sub-make
[1569]13# 04 Jul 07 SHL Add missing .AUTODEPEND
[808]14# 06 Aug 07 SHL Tweak CFLAGS for DEBUG builds
15# 26 Aug 07 SHL Clean *.lrf
[833]16# 05 Sep 07 SHL Correct USE_WRC logic
[841]17# 22 Sep 07 SHL Switch to 4 byte packing (-zp4)
[899]18# 03 Jan 08 SHL Prepare for final, implending switch to wrc.exe
[903]19# 03 Jan 08 SHL Switch to wrc.exe default; support USE_RC from environment
[907]20# 05 Jan 08 SHL Sync with .c renames
[973]21# 22 Feb 08 JBS Suppress lxlite processing when DEBUG=1
[1003]22# 01 Mar 08 SHL Add missing dependencies. Add WARNALL support
[1005]23# 05 May 08 SHL Add FORTIFY support
[1022]24# 26 May 08 SHL Update WARNALL to warn about more
[1133]25# 22 Jul 08 SHL Change from dllsyms to syms target for consistency
[1242]26# 06 Oct 08 SHL Add missing -dDEBUG= to CFLAGS; rework lxlite suppress logic
[1335]27# 25 Oct 08 SHL Rework dependencies to avoid target dependent build failures
[1281]28# 18 Nov 08 JBS Ticket 297: Various build improvements/corrections
[1285]29# 19 Nov 08 JBS Ticket 297: Removed bldlevel calls
[1289]30# 21 Nov 08 JBS Ticket 297: Added support for copyright.c and copyright.h
[1322]31# 08 Dec 08 SHL Ticket 307: Add process dump support
[1331]32# 10 Dec 08 SHL Ticket 26: Add exception handler and exceptq support
[1394]33# 14 Dec 08 SHL Drop copyright.c support - it's gone
34# 18 Dec 08 SHL Avoid extra fm3res.str builds
35# 04 Feb 09 SHL Drop mkstr and fm3*.str now that we use STRINGTABLE
[1439]36# 12 Jul 09 GKY Allow FM/2 to load in high memory call exehdr /hi
[1468]37# 30 Jul 09 SHL Avoid attempting to attach resources to fm3res.map
[1514]38# 13 Apr 10 SHL Drop HIMEM support
[1569]39# 09 Feb 11 SHL Add exceptq .xqs support
[62]40
[1331]41# Environment: see makefile_pre.mk
[72]42
[1468]43# DEBUG - debug build if defined, release build if not defined
44# WARNALL - add more warnings if defined, standard warnings if not defined
45# FORTIFY - enable FORTIFY heap checking if defined, omit FORITY support if not defined
46# USE_RC - use rc.exe if defined, use wrc.exe if not defined
[72]47
[691]48BASE = fm3dll
49BASERES = fm3res
[2]50
[691]51.SUFFIXES:
52.SUFFIXES: .obj .c .res .rc .ipf
[2]53
[691]54CC = wcc386
55LINK = wlink
56
[903]57!ifndef USE_RC # if not defined on command line
58!ifdef %USE_RC # if defined in environment
59USE_RC = $(%USE_RC)
[719]60!endif
[833]61!endif
[691]62
[1335]63!ifdef USE_RC
[1281]64RC = rc -n
[903]65!else
[1281]66RC = wrc -q
[261]67!endif
[2]68
[719]69# Keep this code in sync with makefile_pre.mk
[808]70!ifdef DEBUG # if defined on wmake command line
[720]71DEBUG_OPT = DEBUG=$(DEBUG) # set in case needed by sub-make
72!else
[808]73!ifdef %DEBUG # if defined in environment
74DEBUG = $(%DEBUG) # use value from environment
[720]75DEBUG_OPT = DEBUG=$(DEBUG) # set in case needed by sub-make
[719]76!endif
77!endif
78
[1003]79!ifdef %WARNALL # if defined in environment
80WARNALL = $(%WARNALL) # use value from environment
81!endif
82
[1005]83!ifdef %FORTIFY # if defined in environment
84FORTIFY = $(%FORTIFY) # use value from environment
85!endif
86
[1394]87SYMS = $(BASE).sym $(BASERES).sym # targets for building SYM files
[976]88
[691]89# Some flags are order dependent - see OpenWatcom docs
90# -bc console app
91# -bd build target is a Dynamic Link Library (DLL)
92# -bg gui app with WinMain entry point
93# -bm multithread libs
94# -bt=os2 target
[808]95# -d1 line number debugging information
[734]96# -d2 full symbolic debugging information
[691]97# -d3 full debug w/unref
98# -hd dwarf
99# -j signed char
100# -mf flat
[808]101# -of generate traceable stack frames
[691]102# -olinars optimze loops, inline, e(n)able fp recip, relax (a)lias, reordering, space
103# -s disable stack checks
104# -sg generate calls to grow the stack
105# -st touch stack through SS first
[907]106# -we treat warnings as errors
[691]107# -wx max warnings
108# -zfp disable fs use
109# -zgp disable gs use
110# -zp4 align 4
111# -zq quiet
[261]112
[1022]113# -wx excludes these
114# See GenCOptions() in openwatcom\bld\cc\c\coptions.c
115# -wce130 possible loss of precision
116# -wcd=303 no reference to formal parameter
117# -wcd=307 obsolete non-prototype declarator
118# -wcd=308 unprototyped function called
119# -wcd=309 unprototyped function called indirectly
120
[719]121!ifdef DEBUG
[1242]122CFLAGS = -bt=os2 -mf -bd -bm -hd -d2 -olirs -s -sg -j -wx -zfp -zgp -zp4 -zq -d$DEBUG_OPT
123CFLAGS = -bt=os2 -mf -bd -bm -hd -d2 -s -sg -j -wx -zfp -zgp -zp4 -zq -d$DEBUG_OPT
[691]124!else
[1022]125CFLAGS = -bt=os2 -mf -bd -bm -hd -d1 -olirs -s -sg -j -wx -zfp -zgp -zp4 -zq
[261]126!endif
[220]127
[1022]128# 26 May 08 SHL Was reversed
[1003]129!ifdef WARNALL
[1022]130CFLAGS += -wce=118 -wce=130 -wce=303 -wce=307 -wce=308 -wce=309
131!else
132CFLAGS += -we
[1003]133!endif
134
[1005]135!ifdef FORTIFY
136CFLAGS += -dFORTIFY
137!endif
138
[106]139# for fm3res only
[907]140CFLAGSR = -bt=os2 -mf -bd -bm -olirs -s -j -we -wx -zfp -zgp -zp4 -zq
[21]141
[719]142!ifdef DEBUG
[691]143LFLAGS = sys os2v2_dll initinstance terminstance op quiet op verbose op cache &
144 op caseexact op implib op map debug dwarf all
145!else
146LFLAGS = sys os2v2_dll initinstance terminstance op quiet op verbose op cache &
147 op caseexact op implib op map
[261]148!endif
[2]149
[691]150# rc Includes can be in current director or dll subdirectory
[1335]151!ifdef USE_RC
[903]152RCFLAGS = -r -i dll
153RCFLAGS2 = -x2
154!else
[691]155# Pass 1 flags
156RCFLAGS = -r -i=dll -ad
157# Pass 2 flags
[899]158RCFLAGS2 =
[691]159!endif
160
[261]161!ifndef MAKERES
[1569]162.c.obj: .AUTODEPEND
[691]163 $(CC) $(CFLAGS) $*.c
[261]164!else
165 # !error "MAKERES mode"
166!endif
[21]167
[691]168OBJS = arccnrs.obj archive.obj assoc.obj attribs.obj autoview.obj &
169 avl.obj avv.obj chklist.obj cmdline.obj codepage.obj &
[1399]170 collect.obj colors.obj command.obj common.obj &
[1394]171 comp.obj copyf.obj &
[1335]172 datamin.obj defview.obj delims.obj dircnrs.obj &
[1322]173 dirs.obj dirsize.obj draglist.obj droplist.obj dumputil.obj &
[1331]174 eas.obj errutil.obj excputil.obj extract.obj &
175 filldir.obj filter.obj findrec.obj flesh.obj fm2cmd.obj &
[1403]176 fonts.obj fortify.obj &
[1399]177 getnames.obj grep.obj grep2.obj i18nutil.obj info.obj inis.obj &
[691]178 init.obj input.obj instant.obj key.obj killproc.obj literal.obj &
179 loadbmp.obj mainwnd.obj mainwnd2.obj makelist.obj menu.obj misc.obj &
180 mkdir.obj mle.obj newview.obj notebook.obj notify.obj objcnr.obj &
[907]181 objwin.obj &
182 pathutil.obj &
183 presparm.obj printer.obj remap.obj rename.obj saveclip.obj &
[691]184 seeall.obj select.obj seticon.obj shadow.obj sortcnr.obj srchpath.obj &
[907]185 strutil.obj strips.obj stristr.obj subj.obj sysinfo.obj systemf.obj &
186 timer.obj tmrsvcs.obj tools.obj treecnr.obj &
187 undel.obj update.obj uudecode.obj &
[691]188 valid.obj viewer.obj viewinf.obj walkem.obj winlist.obj worker.obj &
189 wrappers.obj
[2]190
[691]191ICONS = icons\*.ico ..\icons\*.ico icons\*.ptr
192
[261]193!ifndef MAKERES
194
[691]195all: &
196 $(BASE).dll &
197 $(BASERES).res &
198 $(BASERES).dll &
[1394]199 ipf\fm3.hlp
[1439]200
[1133]201syms: $(SYMS) .symbolic
[983]202
[1394]203$(BASE).dll $(BASE).lib $(BASE).map: $(OBJS) $(BASE).def $(BASE).lrf
[1415]204 @echo Linking $(BASE).dll
[691]205 $(LINK) @$(BASE).lrf @$(BASE).def
[261]206 @rem type $(BASE).lrf
[2]207
[691]208$(BASE).lrf: $(__MAKEFILES__)
209 @%write $^@ $(LFLAGS)
210 @%append $^@ name $(BASE)
211 @for %f in ($(OBJS)) do @%append $^@ file %f
212 @%append $^@ library os2386.lib
[2]213
[1335]214!else # MAKERES defined
[261]215
[454]216# MAKERES mode - build resources only
[261]217
[1335]218all: $(BASERES).res &
[691]219 $(BASERES).dll &
[1394]220 ipf\fm3.hlp
[261]221
[1335]222!endif # MAKERES
[261]223
224# Update resources only
225
226res:
227 @echo Updating resources only
[720]228 $(MAKE) $(__MAKEOPTS__) $(DEBUG_OPT) MAKERES=1
[261]229
[1569]230$(BASERES).obj: $(BASERES).c .AUTODEPEND
[691]231 $(CC) $(CFLAGSR) $(BASERES).c
[2]232
[1289]233$(BASERES).res: *.rc *.dlg fm3dll2.h fm3dlg.h copyright.h $(ICONS)
[1282]234 @echo.
235 @echo Compiling resource: $*
236 @echo.
[691]237 $(RC) $(RCFLAGS) $*
[1335]238!ifdef USE_RC
[691]239 ren $*.res $*.res
240!endif
[2]241
[261]242!ifndef MAKERES
243
[1335]244$(BASERES).dll $(BASERES).lib $(BASERES).map: $(BASERES).res $(BASERES).obj $(BASERES).def $(BASERES).lrf
[1415]245 @echo Linking $(BASERES).dll
[691]246 $(LINK) @$(BASERES).lrf @$(BASERES).def
[1282]247 @echo.
[1468]248 @echo Attaching resources to $(BASERES).dll
[1282]249 @echo.
[1468]250 $(RC) $(RCFLAGS2) $(BASERES).res $(BASERES).dll
[2]251
[691]252$(BASERES).lrf: $(__MAKEFILES__)
253 @%write $^@ $(LFLAGS)
254 @%append $^@ name $(BASERES)
255 @for %f in ($(BASERES).obj) do @%append $^@ file %f
256
[976]257$(BASE).sym: $(BASE).map
258 @echo Processing: $?
259 -perl ..\debugtools\mapsymw.pl $?
[1569]260 -mapxqs $?
[976]261
262$(BASERES).sym: $(BASERES).map
263 @echo Processing: $?
264 -perl ..\debugtools\mapsymw.pl $?
[1569]265 -mapxqs $?
[976]266
[1335]267!else # MAKERES defined
[261]268
[454]269# MAKERES mode - build resources only
270
[261]271$(BASERES).dll: $(BASERES).res
272 @if not exist $@ echo $@ missing
[970]273!ifndef DEBUG
[261]274 lxlite $@ /x+ /b-
275 lxlite $@ /c:minstub
[970]276!endif
[1282]277 @echo.
[1468]278 @echo Ataching resources to $@
[1282]279 @echo.
[691]280 $(RC) $(RCFLAGS2) $(BASERES).res $@
[970]281!ifndef DEBUG
[261]282 lxlite $@ /x- /b-
[970]283!endif
[261]284
[1335]285!endif # MAKERES
286
[903]287# For testing new code
288tmp.obj: tmp.c
289
[691]290ipf: ipf\fm3.hlp .symbolic
291
[1003]292ipf\fm3.hlp: ipf\*.ipf ipf\bitmaps\*.bmp ipf\makefile
[261]293 cd ipf
[720]294 $(MAKE) $(__MAKEOPTS__) $(DEBUG_OPT) fm3.hlp
[261]295 cd..
[2]296
[467]297# Run for each dependent
[698]298lxlite: $(BASE).dll $(BASERES).dll .symbolic
299# !lxlite /x- /b- $?
[970]300!ifndef DEBUG
[1335]301 @for %f in ($(BASE).dll $(BASERES).dll) do !lxlite /x- /b- %f
[970]302!endif
[310]303
[1439]304# Run for each dependent
305loadhigh: $(BASE).dll $(BASERES).dll .symbolic
306 @for %f in ($(BASE).dll $(BASERES).dll) do !exehdr /hi %f
307
[691]308cleanobj: .symbolic
[146]309 -del *.obj
310
[691]311clean: .symbolic
[1394]312 cd ipf
[720]313 $(MAKE) $(__MAKEOPTS__) $(DEBUG_OPT) clean
[261]314 cd..
[146]315 -del *.dll
316 -del *.lib
[808]317 -del *.lrf
[146]318 -del *.map
319 -del *.obj
320 -del *.res
[1054]321 -del *.sym
Note: See TracBrowser for help on using the repository browser.