~ubuntu-branches/ubuntu/breezy/xzip/breezy

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
PROGRAM = xzip

# You MUST define either BIG_END_MODE or LITTLE_END_MODE, by
#   uncommenting one of the lines below. If you don't know
#   which is right, try one and see if the program runs right.
#   The error messages are nice and obvious. Some Unixes
#   have a BYTE_ORDER definition; if you define AUTO_END_MODE,
#   the source code will check for that and work "automatically".
#   If Murphy's Law strikes, go back to BIG_END_MODE or 
#   LITTLE_END_MODE.

# If you get errors in xio.c about fd_set or FD_SET being 
#   undefined, put "-DNEEDS_SELECT_H" in the SYSTEMFLAGS line,
#   as has been done for the RS6000.

# If you get errors about bcopy being undefined, put
#   "-DNO_BCOPY" in the SYSTEMFLAGS line.

# If you get errors about random or srandom being undefined,
#   put "-DLOUSY_RANDOM" in the SYSTEMFLAGS line.

# --------------------

# definitions for RS6000 / AIX
#   If AUTO doesn't work, use BIG
#SYSTEMFLAGS = -DNEEDS_SELECT_H -DAUTO_END_MODE

# definitions for HP / HPUX
#SYSTEMFLAGS = -Ae -DBIG_END_MODE

# definitions for HP / HPUX 9.0 
#    (Dunno; this was contributed to me)
#SYSTEMFLAGS = -Aa -D_HPUX_SOURCE -DBIG_END_MODE

# definitions for SparcStation / SunOS
#SYSTEMFLAGS = -DBIG_END_MODE

# definitions for SparcStation / Solaris 
#    (Solaris 2.5, don't know about other versions)
#SYSTEMFLAGS = -DBIG_END_MODE
#SYSTEMLIBS = -R$(XLIB)  -lsocket

# definitions for DECstation / Ultrix
#SYSTEMFLAGS = -DLITTLE_END_MODE

# definitions for SGI / Irix
#SYSTEMFLAGS = -DBIG_END_MODE

# definitions for Linux
# Note! Old versions of Linux (pre 2.0?) may not have the magic
#   BYTE_ORDER definitions installed. If AUTO_END_MODE doesn't
#   work, use LITTLE_END_MODE on an x86, BIG_END_MODE on a
#   680x0 or PPC machine.
#SYSTEMFLAGS = -DAUTO_END_MODE

# definitions for BSDI 4
#SYSTEMFLAGS = -DAUTO_END_MODE

# definitions for some arbitrary big-endian system
#SYSTEMFLAGS = -DBIG_END_MODE

# definitions for some arbitrary little-endian system
#SYSTEMFLAGS = -DLITTLE_END_MODE

# --------------------

# definitions for where the X lib and include directories are.
# The following are defaults that might work.

XINCLUDE = /usr/include/X11
XLIB = /usr/lib/X11

# If your compiler can't find these things, try commenting out the
# above, and uncommenting various versions below. Also look around
# your hard drive for the appropriate files. (The XINCLUDE directory
# should contain the file "Xlib.h", and the XLIB dir should contain 
# "libX11.so" or "libX11.a".)
# The problem is, depending on how things are installed, the
# directories could be just about anywhere. Sigh.

# for Debian or SuSE Linux
#XINCLUDE = /usr/X11R6/include/X11
#XLIB = /usr/X11R6/lib

# for Red Hat Linux
#XINCLUDE = /usr/include/X11
#XLIB = /usr/X11/lib

# for SparcStation / Solaris 
#XINCLUDE = /usr/openwin/include
#XLIB = /usr/openwin/lib

# for BSDI 4
#XINCLUDE = /usr/X11R6/include
#XLIB = /usr/X11/lib

# --------------------

# definition for where to install xzip executable and man page
DESTDIR = /usr/local

# --------------------

CFLAGS = -O $(SYSTEMFLAGS) -I$(XINCLUDE)
LDFLAGS =
LIBS = -L$(XLIB) -lX11 $(SYSTEMLIBS)

# definitions for the default fonts. Users can override these with X resources.
FONTDEF_PLAIN=\
"-adobe-times-medium-r-normal--14-*-*-*-*-*-iso8859-1"
FONTDEF_BOLD=\
"-adobe-times-bold-r-normal--14-*-*-*-*-*-iso8859-1"
FONTDEF_ITALIC=\
"-adobe-times-medium-i-normal--14-*-*-*-*-*-iso8859-1"
FONTDEF_BOLDITALIC=\
"-adobe-times-bold-i-normal--14-*-*-*-*-*-iso8859-1"
FONTDEF_FIXED=\
"-adobe-courier-medium-r-normal--12-*-*-*-*-*-iso8859-1"
FONTDEF_BOLDFIXED=\
"-adobe-courier-bold-r-normal--12-*-*-*-*-*-iso8859-1"
FONTDEF_ITALICFIXED=\
"-adobe-courier-medium-o-normal--12-*-*-*-*-*-iso8859-1"
FONTDEF_BOLDITALICFIXED=\
"-adobe-courier-bold-o-normal--12-*-*-*-*-*-iso8859-1"

FONTDEFAULTLIST = \
-DFND0='$(FONTDEF_PLAIN)' \
-DFND1='$(FONTDEF_BOLD)' \
-DFND2='$(FONTDEF_ITALIC)' \
-DFND3='$(FONTDEF_BOLDITALIC)' \
-DFND4='$(FONTDEF_FIXED)' \
-DFND5='$(FONTDEF_BOLDFIXED)' \
-DFND6='$(FONTDEF_ITALICFIXED)' \
-DFND7='$(FONTDEF_BOLDITALICFIXED)'

INC = ztypes.h
OBJS = zip.o control.o extern.o fileio.o input.o interpre.o math.o memory.o \
	object.o operand.o osdepend.o property.o screen.o text.o variable.o \
	pickle.o quetzal.o

XOBJS = xio.o xinit.o xtext.o xkey.o xmess.o xstat.o

$(PROGRAM) : $(OBJS) $(XOBJS)
	$(CC) -o $@ $(LDFLAGS) $(OBJS) $(XOBJS) $(LIBS)

test: $(XOBJS)
	$(CC) -o $@ $(LDFLAGS) $(XOBJS) $(LIBS)

$(OBJS) : $(INC) extern.c version.h

pickle.o : pickle.h

$(XOBJS) : $(INC) xio.h version.h

xio.o: xio.c xio.h greypm.bm
	$(CC) $(CFLAGS) -c xio.c

xinit.o: xinit.c xio.h
	$(CC) $(CFLAGS) $(FONTDEFAULTLIST) -c xinit.c

install: $(PROGRAM)
	install -s $(PROGRAM) $(DESTDIR)/bin
	install $(PROGRAM).1 $(DESTDIR)/man/man1

clean :
	-rm -f *~ *.o $(PROGRAM) test