1#------------------------------------------------------------------------------
2# Makefile for UnZip 5.53 and later                      Mark Wright and others
3# Version:  Watcom C                                                  31 Mar 07
4#------------------------------------------------------------------------------
5
6
7# WARNING:  this is a hacked-up version of an ancient (1993) makefile.  It will
8#   not work without modifications to the UnZip 5.3 sources.  This makefile is
9#   (for now) included only for completeness and as a starting point for a real
10#   Novell Netware NLM port.  (This makefile was intended for Netware 3.11.)
11
12
13# Commands to execute before making any target
14# Set environment variables for compiler
15.BEFORE
16    @set inc386=\watcom\novh
17    @set wcg386=\watcom\binp\wcl386.exe
18
19# Macro definitions
20NLMNAME = unzip
21DESCRIPTION = unzip utility
22VERSION = 5.5.3
23COPYRIGHT = Copyright 1990-2007 Info-ZIP (www.info-zip.org).
24SCREENNAME = Info-ZIP's UnZip Utility
25CLIBIMP = \watcom\novi\clib.imp
26OBJFILE = $NLMNAME.obj
27PRELUDE = \watcom\novi\prelude.obj
28
29# Compile switches
30# d2    include full symbolic debugging information
31# 5s    generate 586 instructions, use stack-based argument-passing conventions
32# zdp   allows DS register to "peg" it to DGROUP
33# zq    "quiet" mode
34# NLM   produce Netware Loadable Module
35# DEBUG include debug info
36
37CC = wcc386
38# COMPILE = wcc386 -zq -d2 -3s -zdp -w4 -DNLM
39# COMPILE = wcc386 -zq -d2 -5s -zdp -w4 -DNLM $(LOCAL_UNZIP)
40COMPILE = $(CC) -zq -olax -5s -zp1 -ei -ez -ri -w4 -DNLM -DN_PLAT_NLM -U_WIN32 $(LOCAL_UNZIP)
41LINK = wlink
42DESTDIR = target
43
44# All .obj files implicitly depend on .c files
45.c.obj :
46   @echo Compiling $[*.c
47   @$COMPILE $[*.c
48
49
50UNZIP_H = unzip.h unzpriv.h globals.h netware/nlmcfg.h
51
52crc32.obj:      crc32.c $(UNZIP_H) zip.h crc32.h
53crypt.obj:      crypt.c $(UNZIP_H) crc32.h crypt.h ttyio.h zip.h
54envargs.obj:    envargs.c $(UNZIP_H)
55explode.obj:    explode.c $(UNZIP_H)
56extract.obj:    extract.c $(UNZIP_H) crc32.h crypt.h
57fileio.obj:     fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
58globals.obj:    globals.c $(UNZIP_H)
59inflate.obj:    inflate.c inflate.h $(UNZIP_H)
60list.obj:       list.c $(UNZIP_H)
61match.obj:      match.c $(UNZIP_H)
62process.obj:    process.c $(UNZIP_H) crc32.h
63ttyio.obj:      ttyio.c $(UNZIP_H) crypt.h ttyio.h zip.h
64unreduce.obj:   unreduce.c $(UNZIP_H)
65unshrink.obj:   unshrink.c $(UNZIP_H)
66unzip.obj:      unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
67zipinfo.obj:    zipinfo.c $(UNZIP_H)
68
69# individual dependencies and action rules:
70#crc_i86.obj:    msdos\crc_i86.asm
71#	$(AS) $(ASFLAGS) -D$(ASUNMODEL) msdos\crc_i86.asm, $@;
72
73netware.obj:     netware/netware.c $(UNZIP_H)
74	$(CC) -c -A$(UNMODEL) $(CFLAGS) netware/netware.c
75
76
77OBJ01 = unzip.obj
78OBJ02 = crc32.obj
79OBJ03 = crypt.obj
80OBJ04 = envargs.obj
81OBJ05 = explode.obj
82OBJ06 = extract.obj
83OBJ07 = fileio.obj
84OBJ08 = globals.obj
85OBJ09 = inflate.obj
86OBJ10 = list.obj
87OBJ11 = match.obj
88OBJ12 = process.obj
89OBJ13 = ttyio.obj
90OBJ14 = unreduce.obj
91OBJ15 = unshrink.obj
92OBJ16 = zipinfo.obj
93OBJ17 = netware.obj
94#OBJ18 = $(ASMOBJS)
95OBJS = $OBJFILE $OBJ01 $OBJ02 $OBJ03 $OBJ04 $OBJ05 $OBJ06 $OBJ07 $OBJ08 \
96	$OBJ09 $OBJ10 $OBJ11 $OBJ12 $OBJ13 $OBJ14 $OBJ15 $OBJ16 $OBJ17
97
98
99# if .obj or .lnk files are modified, link new .nlm and maybe copy to DESTDIR
100$NLMNAME.nlm : $OBJS
101   @echo Linking...
102   @$LINK @$NLMNAME
103#   @echo Copying $[*.nlm to $DESTDIR
104#   @copy $NLMNAME.nlm $DESTDIR
105
106
107# if makefile is modified, create new linker option file
108$NLMNAME.lnk : $NLMNAME.mak
109   @echo FORMAT   NOVELL NLM	'$DESCRIPTION'	 >$NLMNAME.lnk
110   @echo OPTION   THREADNAME    '$NLMNAME'	>>$NLMNAME.lnk
111   @echo OPTION   SCREENNAME '$SCREENNAME'	>>$NLMNAME.lnk
112   @echo NAME $NLMNAME				>>$NLMNAME.lnk
113   @echo OPTION   VERSION=$VERSION		>>$NLMNAME.lnk
114   @echo OPTION   COPYRIGHT '$COPYRIGHT'	>>$NLMNAME.lnk
115   @echo DEBUG    NOVELL                        >>$NLMNAME.lnk
116   @echo DEBUG    ALL                           >>$NLMNAME.lnk
117   @echo OPTION   NODEFAULTLIBS			>>$NLMNAME.lnk
118   @echo OPTION   DOSSEG			>>$NLMNAME.lnk
119   @echo OPTION   STACK=40000			>>$NLMNAME.lnk
120   @echo OPTION   CASEEXACT			>>$NLMNAME.lnk
121   @echo OPTION   PSEUDOPREEMPTION		>>$NLMNAME.lnk
122   @echo OPTION   MAP				>>$NLMNAME.lnk
123   @echo FILE $PRELUDE				>>$NLMNAME.lnk
124   @echo FILE $OBJFILE				>>$NLMNAME.lnk
125   @echo FILE $OBJ01				>>$NLMNAME.lnk
126   @echo FILE $OBJ02				>>$NLMNAME.lnk
127   @echo FILE $OBJ03				>>$NLMNAME.lnk
128   @echo FILE $OBJ04				>>$NLMNAME.lnk
129   @echo FILE $OBJ05				>>$NLMNAME.lnk
130   @echo FILE $OBJ06				>>$NLMNAME.lnk
131   @echo FILE $OBJ07				>>$NLMNAME.lnk
132   @echo FILE $OBJ08				>>$NLMNAME.lnk
133   @echo FILE $OBJ09				>>$NLMNAME.lnk
134   @echo FILE $OBJ10				>>$NLMNAME.lnk
135   @echo FILE $OBJ11				>>$NLMNAME.lnk
136   @echo FILE $OBJ12				>>$NLMNAME.lnk
137   @echo FILE $OBJ13				>>$NLMNAME.lnk
138   @echo FILE $OBJ14				>>$NLMNAME.lnk
139   @echo FILE $OBJ15				>>$NLMNAME.lnk
140   @echo FILE $OBJ16				>>$NLMNAME.lnk
141   @echo FILE $OBJ17				>>$NLMNAME.lnk
142   @echo MODULE   clib				>>$NLMNAME.lnk
143   @echo IMPORT   @$CLIBIMP			>>$NLMNAME.lnk
144