📄 makefile.wat
字号:
# WMAKE makefile for 16 bit MSDOS or 32 bit DOS extender (PMODE/W or DOS/4GW)# using Watcom C/C++ v11.0+, by Paul Kienitz, last revised 29 Sep 97. Makes# UnZip.exe, fUnZip.exe, and UnZipSFX.exe.## Invoke from UnZip source dir with "WMAKE -F MSDOS\MAKEFILE.WAT [targets]".# To make the PMODE/W version use "WMAKE PM=1 ..."# To make the DOS/4GW version use "WMAKE GW=1 ..." (overrides PM=1)# Note: specifying PM or GW without NOASM requires that the win32 source# directory be present, so it can access the 32 bit assembly source.# PMODE/W is recommended over DOS/4GW for best performance.# To build with debug info use "WMAKE DEBUG=1 ..."# To build with no assembly modules use "WMAKE NOASM=1 ..."# To support unshrinking and unreducing use "WMAKE LAWSUIT=1 ..."## Other options to be fed to the compiler can be specified in an environment# variable called LOCAL_UNZIP.variation = $(%LOCAL_UNZIP)# Stifle annoying "Delete this file?" questions when errors occur:.ERASE.EXTENSIONS:.EXTENSIONS: .exe .obj .obx .c .h .asm# We maintain multiple sets of object files in different directories so that# we can compile msdos, dos/4gw, and win32 versions of UnZip without their# object files interacting. The following var must be a directory name# ending with a backslash. All object file names must include this macro# at the beginning, for example "$(O)foo.obj".!ifdef GWPM = 1 # both protected mode formats use the same object files!endif!ifdef DEBUG! ifdef PMO = od32d\ # comment here so backslash won't continue the line! elseO = od16d\ # ditto! endif!else! ifdef PMO = ob32d\ # ditto! elseO = ob16d\ # ditto! endif!endif!ifdef LAWSUITcvars = $+$(cvars)$- -DUSE_SMITH_CODE -DUSE_UNSHRINKavars = $+$(avars)$- -DUSE_SMITH_CODE -DUSE_UNSHRINK# "$+$(foo)$-" means expand foo as it has been defined up to now; normally,# this Make defers inner expansion until the outer macro is expanded.!endif# The assembly hot-spot code in crc_i[3]86.asm is optional. This section# controls its usage.!ifdef NOASMcrcob = $(O)crc32.objcrcox = $(O)crc32.obx!else # !NOASMcvars = $+$(cvars)$- -DASM_CRC! ifdef PMcrcob = $(O)crc_i386.objcrcox = $(O)crc_i386.obxcrc_s = win32\crc_i386.asm # requires that the win32 directory be present! elsecrcob = $(O)crc_i86.objcrcox = $(O)crc_i86.obxcrc_s = msdos\crc_i86.asm! endif!endif# Our object files: OBJA/OBJB is for UnZip, OBJX for UnZipSFX, OBJF for fUnZip:OBJA1 = $(O)unzip.obj $(crcob) $(O)crctab.obj $(O)crypt.obj $(O)envargs.objOBJA = $(OBJA1) $(O)explode.obj $(O)extract.obj $(O)fileio.obj $(O)globals.objOBJB2 = $(O)inflate.obj $(O)list.obj $(O)match.obj $(O)process.obj $(O)ttyio.objOBJB = $(OBJB2) $(O)unreduce.obj $(O)unshrink.obj $(O)zipinfo.obj $(O)msdos.objOBJX2 = $(O)unzip.obx $(crcox) $(O)crctab.obx $(O)crypt.obx $(O)extract.obxOBJX1 = $(OBJX2) $(O)fileio.obx $(O)globals.obx $(O)inflate.obx $(O)match.obxOBJX = $(OBJX1) $(O)process.obx $(O)ttyio.obx $(O)msdos.obxOBJF1 = $(O)funzip.obj $(crcox) $(O)cryptf.obj $(O)globalsf.objOBJF = $(OBJF1) $(O)inflatef.obj $(O)ttyio.obx# fUnZip uses $(crcox) and $(O)ttyio.obx because they're small-model.# Common header files included by all C sources:UNZIP_H = unzip.h unzpriv.h globals.h msdos\doscfg.h# Now we have to pick out the proper compiler and options for it. This gets# pretty complicated with the PM, GW, DEBUG, and NOASM options...link = wlinkasm = wasm!ifdef PMcc = wcc386# Use Pentium Pro timings, flat memory, static strings in code, max strictness:cflags = -bt=DOS -mf -6r -zt -zq -wxaflags = -bt=DOS -mf -3 -zqcflagx = $(cflags)aflagx = $(aflags)! ifdef GWlflags = sys DOS4G! else# THIS REQUIRES THAT PMODEW.EXE BE FINDABLE IN THE COMMAND PATH.# It does NOT require you to add a pmodew entry to wlink.lnk or wlsystem.lnk.defaultlibs = libpath %WATCOM%\lib386 libpath %WATCOM%\lib386\doslflags = format os2 le op osname='PMODE/W' op stub=pmodew.exe $(defaultlibs)! endif!else # plain 16-bit DOS:cc = wcc# Use plain 8086 code, medium memory, static strings in code, max strictness:cflags = -bt=DOS -mm -0 -zt -zq -wxaflags = -bt=DOS -mm -0 -zq# for UnZipSFX and fUnZip, use the small memory model:cflagx = -bt=DOS -ms -0 -zt -zq -wxaflagx = -bt=DOS -ms -0 -zqlflags = sys DOS!endif # !PMcvars = $+$(cvars)$- -DMSDOS $(variation)avars = $+$(avars)$- $(variation)# Specify optimizations, or a nonoptimized debugging version:!ifdef DEBUGcdebug = -od -d2cdebux = -od -d2ldebug = d w all op symf!else! ifdef PMcdebug = -s -obhikl+rt -oe=100 -zp8# -oa helps slightly but might be dangerous.! elsecdebug = -s -oehiklrt! endifcdebux = -s -obhiklrsldebug = op el!endif# How to compile sources:.c.obx: $(cc) $(cdebux) $(cflagx) $(cvars) -DSFX $[@ -fo=$@.c.obj: $(cc) $(cdebug) $(cflags) $(cvars) $[@ -fo=$@# Here we go! By default, make all targets, except no UnZipSFX for PMODE:!ifdef PMall: UnZip.exe fUnZip.exe!elseall: UnZip.exe fUnZip.exe UnZipSFX.exe!endif# Convenient shorthand options for single targets:u: UnZip.exe .SYMBOLICf: fUnZip.exe .SYMBOLICx: UnZipSFX.exe .SYMBOLICUnZip.exe: $(OBJA) $(OBJB) set WLK_VA=file {$(OBJA)} set WLK_VB=file {$(OBJB)} $(link) $(lflags) $(ldebug) name $@ @WLK_VA @WLK_VB set WLK_VA= set WLK_VB=# We use WLK_VA/WLK_VB to keep the size of each command under 256 chars.UnZipSFX.exe: $(OBJX) set WLK_VX=file {$(OBJX)} $(link) $(lflags) $(ldebug) name $@ @WLK_VX set WLK_VX=fUnZip.exe: $(OBJF) set WLK_VF=file {$(OBJF)} $(link) $(lflags) $(ldebug) name $@ @WLK_VF set WLK_VF=# Source dependencies:# for UnZip ...$(O)crc32.obj: crc32.c $(UNZIP_H) zip.h$(O)crctab.obj: crctab.c $(UNZIP_H) zip.h$(O)crypt.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h$(O)envargs.obj: envargs.c $(UNZIP_H)$(O)explode.obj: explode.c $(UNZIP_H)$(O)extract.obj: extract.c $(UNZIP_H) crypt.h$(O)fileio.obj: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h$(O)globals.obj: globals.c $(UNZIP_H)$(O)inflate.obj: inflate.c inflate.h $(UNZIP_H)$(O)list.obj: list.c $(UNZIP_H)$(O)match.obj: match.c $(UNZIP_H)$(O)process.obj: process.c $(UNZIP_H)$(O)ttyio.obj: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h$(O)unreduce.obj: unreduce.c $(UNZIP_H)$(O)unshrink.obj: unshrink.c $(UNZIP_H)$(O)unzip.obj: unzip.c $(UNZIP_H) crypt.h version.h consts.h$(O)zipinfo.obj: zipinfo.c $(UNZIP_H)# for UnZipSFX ...$(O)crc32.obx: crc32.c $(UNZIP_H) zip.h$(O)crctab.obx: crctab.c $(UNZIP_H) zip.h$(O)crypt.obx: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h$(O)extract.obx: extract.c $(UNZIP_H) crypt.h$(O)fileio.obx: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h$(O)globals.obx: globals.c $(UNZIP_H)$(O)inflate.obx: inflate.c inflate.h $(UNZIP_H)$(O)match.obx: match.c $(UNZIP_H)$(O)process.obx: process.c $(UNZIP_H)$(O)ttyio.obx: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h$(O)unzip.obx: unzip.c $(UNZIP_H) crypt.h version.h consts.h# Special case object files:$(O)msdos.obj: msdos\msdos.c $(UNZIP_H) $(cc) $(cdebug) $(cflags) $(cvars) msdos\msdos.c -fo=$@$(O)msdos.obx: msdos\msdos.c $(UNZIP_H) $(cc) $(cdebux) $(cflagx) $(cvars) -DSFX msdos\msdos.c -fo=$@!ifndef NOASM$(crcob): $(crc_s) $(asm) $(aflags) $(avars) $(crc_s) -fo=$@$(crcox): $(crc_s) $(asm) $(aflagx) $(avars) $(crc_s) -fo=$@!endif# Variant object files for fUnZip, using $(cflagx):$(O)funzip.obj: funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h $(cc) $(cdebux) $(cflagx) $(cvars) funzip.c -fo=$@$(O)cryptf.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h $(cc) $(cdebux) $(cflagx) $(cvars) -DFUNZIP crypt.c -fo=$@$(O)globalsf.obj: globals.c $(UNZIP_H) $(cc) $(cdebux) $(cflagx) $(cvars) -DFUNZIP globals.c -fo=$@$(O)inflatef.obj: inflate.c inflate.h $(UNZIP_H) crypt.h $(cc) $(cdebux) $(cflagx) $(cvars) -DFUNZIP inflate.c -fo=$@$(O)ttyiof.obj: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h $(cc) $(cdebux) $(cflagx) $(cvars) -DFUNZIP ttyio.c -fo=$@# Unwanted file removal:clean: .SYMBOLIC!ifdef PM del ob32d\*.ob?!else del ob16d\*.ob?!endifcleaner: clean .SYMBOLIC del UnZip.exe del fUnZip.exe del UnZipSFX.exe
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -