1PROGRAM = xzip
2
3# You MUST define either BIG_END_MODE or LITTLE_END_MODE, by
4#   uncommenting one of the lines below. If you don't know
5#   which is right, try one and see if the program runs right.
6#   The error messages are nice and obvious. Some Unixes
7#   have a BYTE_ORDER definition; if you define AUTO_END_MODE,
8#   the source code will check for that and work "automatically".
9#   If Murphy's Law strikes, go back to BIG_END_MODE or
10#   LITTLE_END_MODE.
11
12# If you get errors in xio.c about fd_set or FD_SET being
13#   undefined, put "-DNEEDS_SELECT_H" in the SYSTEMFLAGS line,
14#   as has been done for the RS6000.
15
16# If you get errors about bcopy being undefined, put
17#   "-DNO_BCOPY" in the SYSTEMFLAGS line.
18
19# If you get errors about random or srandom being undefined,
20#   put "-DLOUSY_RANDOM" in the SYSTEMFLAGS line.
21
22# --------------------
23
24# definitions for RS6000 / AIX
25#   If AUTO doesn't work, use BIG
26#SYSTEMFLAGS = -DNEEDS_SELECT_H -DAUTO_END_MODE
27
28# definitions for HP / HPUX
29#SYSTEMFLAGS = -Ae -DBIG_END_MODE
30
31# definitions for HP / HPUX 9.0
32#    (Dunno; this was contributed to me)
33#SYSTEMFLAGS = -Aa -D_HPUX_SOURCE -DBIG_END_MODE
34
35# definitions for SparcStation / SunOS
36#SYSTEMFLAGS = -DBIG_END_MODE
37
38# definitions for SparcStation / Solaris
39#    (Solaris 2.5, don't know about other versions)
40#SYSTEMFLAGS = -DBIG_END_MODE
41#SYSTEMLIBS = -R$(XLIB)  -lsocket
42
43# definitions for DECstation / Ultrix
44#SYSTEMFLAGS = -DLITTLE_END_MODE
45
46# definitions for SGI / Irix
47#SYSTEMFLAGS = -DBIG_END_MODE
48
49# definitions for Linux
50# Note! Old versions of Linux (pre 2.0?) may not have the magic
51#   BYTE_ORDER definitions installed. If AUTO_END_MODE doesn't
52#   work, use LITTLE_END_MODE on an x86, BIG_END_MODE on a
53#   680x0 or PPC machine.
54#SYSTEMFLAGS = -DAUTO_END_MODE
55
56# definitions for BSDI 4
57#SYSTEMFLAGS = -DAUTO_END_MODE
58
59# definitions for some arbitrary big-endian system
60#SYSTEMFLAGS = -DBIG_END_MODE
61
62# definitions for some arbitrary little-endian system
63#SYSTEMFLAGS = -DLITTLE_END_MODE
64
65# --------------------
66
67# definitions for where the X lib and include directories are.
68# The following are defaults that might work.
69
70XINCLUDE = $(LOCALBASE)/include
71XLIB = $(LOCALBASE)/lib
72
73SYSTEMFLAGS = -DAUTO_END_MODE
74
75# If your compiler can't find these things, try commenting out the
76# above, and uncommenting various versions below. Also look around
77# your hard drive for the appropriate files. (The XINCLUDE directory
78# should contain the file "Xlib.h", and the XLIB dir should contain
79# "libX11.so" or "libX11.a".)
80# The problem is, depending on how things are installed, the
81# directories could be just about anywhere. Sigh.
82
83# for Debian or SuSE Linux
84#XINCLUDE = /usr/X11R6/include/X11
85#XLIB = /usr/X11R6/lib
86
87# for Red Hat Linux
88#XINCLUDE = /usr/include/X11
89#XLIB = /usr/X11/lib
90
91# for SparcStation / Solaris
92#XINCLUDE = /usr/openwin/include
93#XLIB = /usr/openwin/lib
94
95# for BSDI 4
96#XINCLUDE = /usr/X11R6/include
97#XLIB = /usr/X11/lib
98
99# --------------------
100
101# definition for where to install xzip executable and man page
102PREFIX?= /usr/local
103
104# --------------------
105
106CFLAGS += $(SYSTEMFLAGS) -I$(XINCLUDE)
107LDFLAGS =
108LIBS = -L$(XLIB) -lX11 $(SYSTEMLIBS)
109
110# definitions for the default fonts. Users can override these with X resources.
111FONTDEF_PLAIN=\
112"-adobe-times-medium-r-normal--14-*-*-*-*-*-iso8859-1"
113FONTDEF_BOLD=\
114"-adobe-times-bold-r-normal--14-*-*-*-*-*-iso8859-1"
115FONTDEF_ITALIC=\
116"-adobe-times-medium-i-normal--14-*-*-*-*-*-iso8859-1"
117FONTDEF_BOLDITALIC=\
118"-adobe-times-bold-i-normal--14-*-*-*-*-*-iso8859-1"
119FONTDEF_FIXED=\
120"-adobe-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1"
121FONTDEF_BOLDFIXED=\
122"-adobe-courier-bold-r-normal--12-*-*-*-*-*-iso8859-1"
123FONTDEF_ITALICFIXED=\
124"-adobe-courier-medium-o-normal--12-*-*-*-*-*-iso8859-1"
125FONTDEF_BOLDITALICFIXED=\
126"-adobe-courier-bold-o-normal--12-*-*-*-*-*-iso8859-1"
127
128FONTDEFAULTLIST = \
129-DFND0='$(FONTDEF_PLAIN)' \
130-DFND1='$(FONTDEF_BOLD)' \
131-DFND2='$(FONTDEF_ITALIC)' \
132-DFND3='$(FONTDEF_BOLDITALIC)' \
133-DFND4='$(FONTDEF_FIXED)' \
134-DFND5='$(FONTDEF_BOLDFIXED)' \
135-DFND6='$(FONTDEF_ITALICFIXED)' \
136-DFND7='$(FONTDEF_BOLDITALICFIXED)'
137
138INC = ztypes.h
139OBJS = zip.o control.o extern.o fileio.o input.o interpre.o math.o memory.o \
140	object.o operand.o osdepend.o property.o screen.o text.o variable.o \
141	pickle.o quetzal.o
142
143XOBJS = xio.o xinit.o xtext.o xkey.o xmess.o xstat.o
144
145$(PROGRAM) : $(OBJS) $(XOBJS)
146	$(CC) -o $@ $(LDFLAGS) $(OBJS) $(XOBJS) $(LIBS)
147
148test: $(XOBJS)
149	$(CC) -o $@ $(LDFLAGS) $(XOBJS) $(LIBS)
150
151$(OBJS) : $(INC) extern.c version.h
152
153pickle.o : pickle.h
154
155$(XOBJS) : $(INC) xio.h version.h
156
157xio.o: xio.c xio.h greypm.bm
158	$(CC) $(CFLAGS) -c xio.c
159
160xinit.o: xinit.c xio.h
161	$(CC) $(CFLAGS) $(FONTDEFAULTLIST) -c xinit.c
162
163install: $(PROGRAM)
164	${BSD_INSTALL_PROGRAM} $(PROGRAM) $(DESTDIR)$(PREFIX)/bin/
165	${BSD_INSTALL_DATA} $(PROGRAM).1 $(DESTDIR)$(PREFIX)/man/man1/
166
167clean :
168	-rm -f *~ *.o $(PROGRAM) test
169