|
|
1.1 root 1: MAKE=make
2: #
3: # If your system doesn't have hardware floating point make sure you include
4: # the -f option in the definition of CFLAGS. It may already be there, but
5: # I would suggest checking anyway - if you need it.
6: #
7: # Either of the following commands should take care of building and
8: # installing everything you'll need from this package,
9: #
10: # make clobber install
11: # make INS=mv clobber install
12: #
13: # The only real difference between these two is how the raster files are
14: # handled. The first one will just install a copy of the files from directory
15: # $(TABLEDIR)/rast*, while the second command will actually mv the raster
16: # files from $(TABLEDIR)/rast*. By default the raster files are copied but
17: # they take up about 8000 blocks and if you're short on disk space you
18: # may not want to keep two identical copies around.
19: #
20: # If you just want to build everything you'll need to type,
21: #
22: # make all
23: #
24: # That will compile everything you need (dimpress and makedev) and will also
25: # build all the binary font files. Nothing will be installed, but the stuff
26: # should be easy to test because troff and dimpress both accept the -F option
27: # to set a new font directory. You'll also need to use the -B option to
28: # tell dimpress that the new raster file directory is ./TABLES.
29: #
30: # I've also included a few other programs that aren't compiled when you
31: # just ask for the default stuff. The target name 'allprogs' will compile
32: # everything I've given you. Most of these programs are really only useful
33: # if you're going to do some work on the raster files I've supplied.
34: #
35: # Target names tables, rastbuild, PDQ, and rastmaps should only be used
36: # if you've got to rebuild some of the files I've supplied. Most will
37: # only work properly under certain conditions. For example rastbuild
38: # needs to have a set of raster files that available that can be used
39: # with the RASTi300 file in this directory. Many of the source raster
40: # files come from the standard Imagen software tape for the 8/300, but
41: # not all of them. I strongly suggest you don't try and rebuild any of
42: # the tables I've supplied using these targets. It's unlikely things
43: # will work out properly.
44: #
45: # With that in mind I'll just mention that I built all the tables using
46: # a command line that looked something like,
47: #
48: # make DEVICES=i300 RASTSRC=/tmp/raster FONTSRC=/usr/src/cmd/text/troff.d tables
49: #
50: #
51: # Some important directories. They really need to agree with the definitions
52: # used by dimpress (file init.h). If you don't want to keep things in the
53: # places that I've picked change the definitions here and in init.h.
54: #
55:
56:
57: FONTDIR=/usr/lib/font
58: BITDIR=/usr/lib/raster
59:
60:
61: #
62: # A few other definitions we'll need later on. These guys really don't have
63: # anything to do with the code, but you may want to change them anyway. If
64: # you've got PDQs on your system make sure PDQDIR is correct, otherwise none
65: # of the PDQ file I've given you will be installed. BINDIR is where we'll
66: # put dimpress if we install it.
67: #
68:
69: THISDIR=/usr/src/cmd/dimpress
70: BINDIR=/usr/bin
71: PDQDIR=$(FONTDIR)/PDQ
72: PUBDIR=/usr/pub
73:
74: TABLEDIR=TABLES
75:
76: OWNER=bin
77: GROUP=bin
78:
79:
80: #
81: # The next few definitions are only used if we need to build a new set of
82: # PDQ binary files.
83: #
84:
85:
86: PDQFRONT=/usr/m/bin/front
87: PDQMAKEDEV=/usr/M/bin/makedev
88:
89:
90: #
91: # The value assigned to INS controls whether we install stuff or just build
92: # it. As long as INS is : nothing will ever be installed, but assigning it
93: # any other value will force us to try and do the installation. ARGS controls
94: # what target names are built and installed. By default it's set to 'all'
95: # but that can be changed on the command line.
96: #
97:
98:
99: INS=:
100: ARGS=all
101:
102:
103: CFLAGS=-g -DV9
104:
105: CFILES=glob.c misc.c rast.c readrast.c printrast.c buildrast.c editrast.c \
106: dimpress.c impdraw.c oldrast.c draw.c res.c rotate.c bimp.c
107: OFILES=glob.o misc.o rast.o readrast.o printrast.o buildrast.o editrast.o \
108: dimpress.o impdraw.o oldrast.o res.o rotate.o bimp.o
109: HFILES=ext.h gen.h init.h rast.h impcodes.h buildrast.h editrast.h \
110: dimpress.h glyph.h dev.h spectab.h rotate.h imPRESS.h
111: XFILES=makefile RASTi300 README dimpress.1
112: ALLFILES=$(CFILES) $(HFILES) $(XFILES)
113:
114:
115: #
116: # Programs you'll find in this directory. In most cases you'll only need
117: # dimpress and makedev.
118: #
119:
120:
121: PROGS=readrast printrast buildrast dimpress makedev makemap
122:
123: READRAST=glob.o misc.o readrast.o rast.o rotate.o
124: PRINTRAST=glob.o misc.o printrast.o rast.o rotate.o
125: BUILDRAST=glob.o misc.o buildrast.o rast.o editrast.o rotate.o
126: DIMPRESS=dimpress.o impdraw.o glob.o misc.o rast.o oldrast.o res.o rotate.o bimp.o
127: MAKEDEV=makedev.c
128: MAKEMAP=makemap.c
129:
130:
131: help :
132: @echo
133: @echo "Using this file make understands the following target names:"
134: @echo
135: @echo " help : just prints this stuff out again"
136: @echo " all : does most everything you'll need"
137: @echo " allprogs : compiles all the programs in this directory"
138: @echo " fonts : builds all the binary font files in this package"
139: @echo " raster : installs all the raster files if INS isn't set to :"
140: @echo " if INS is mv the files will be moved rather than copied"
141: @echo " pub : installs special eqn character building files"
142: @echo " clean : removes all the .o files from this directory"
143: @echo " clobber : gets rid of everything but source"
144: @echo " backup : copies all the important files into directory BACKUP"
145: @echo
146: @echo
147:
148:
149: all : dimpress makedev fonts raster pub
150: #
151: #
152: # It's really not everything but it's most of the stuff you'll need. If
153: # you want to do some work on the raster files you'll probably also need
154: # to compile buildrast, printrast, and readrast.
155: #
156:
157: install :
158: @if [ "$(INS)" = ":" ]; \
159: then $(MAKE) INS=cp $(ARGS); \
160: else $(MAKE) INS=$(INS) $(ARGS); \
161: fi
162:
163: allprogs : $(PROGS)
164:
165: readrast : $(READRAST)
166: cc $(CFLAGS) -o readrast $(READRAST)
167:
168: printrast : $(PRINTRAST)
169: cc $(CFLAGS) -o printrast $(PRINTRAST)
170:
171: buildrast : $(BUILDRAST)
172: cc $(CFLAGS) -o buildrast $(BUILDRAST)
173:
174: dimpress : $(DIMPRESS)
175: cc $(CFLAGS) -o dimpress $(DIMPRESS) -lm
176: if [ "$(INS)" != ":" ]; then \
177: cp dimpress $(BINDIR); \
178: chmod 755 $(BINDIR)/dimpress; \
179: chgrp $(GROUP) $(BINDIR)/dimpress; \
180: chown $(OWNER) $(BINDIR)/dimpress; \
181: fi
182:
183: makedev : $(MAKEDEV)
184: cc $(CFLAGS) -o makedev $(MAKEDEV)
185:
186: makemap : $(MAKEMAP)
187: cc $(CFLAGS) -o makemap $(MAKEMAP)
188:
189:
190: glob.o : gen.h init.h
191: misc.o : ext.h gen.h
192: rast.o : ext.h gen.h rast.h
193: readrast.o : ext.h gen.h rast.h
194: printrast.o : ext.h gen.h rast.h impcodes.h
195: buildrast.o : ext.h gen.h init.h rast.h buildrast.h
196: editrast.o : gen.h rast.h buildrast.h editrast.h
197: dimpress.o : ext.h gen.h init.h rast.h dev.h impcodes.h dimpress.h spectab.h
198: oldrast.o : ext.h gen.h glyph.h impcodes.h dimpress.h
199: res.o : ext.h gen.h init.h rast.h impcodes.h
200: rotate.o : gen.h rast.h rotate.h
201:
202:
203: fonts : makedev
204: #
205: #
206: # Builds all the binary font files and installs them if INS isn't set to :.
207: # If you've got PDQs on your system make sure PDQDIR is properly defined.
208: # I've set it to /usr/lib/font/PDQ, which is the place that PDQ troff
209: # normally looks. If PDQDIR exists then the all the PDQ binary files that
210: # I've supplied will be installed.
211: #
212: # There's a lot of stuff to do here and I'm sure I could have written things
213: # better, but it all seems to work so I'm not going to change anything.
214: #
215: #
216: @if [ "$(INS)" != ":" -a ! -d $(FONTDIR) ]; then \
217: echo "Directory $(FONTDIR) doesn't exist"; \
218: exit 1; \
219: fi
220: @cd $(TABLEDIR); \
221: for i in dev*; do \
222: if [ ! -d "$$i" ]; then \
223: continue; \
224: fi; \
225: cd $$i; \
226: echo " Building binary files in directory $$i"; \
227: $(THISDIR)/makedev DESC ? ??; \
228: if [ -r LINKFILE ]; then \
229: sh LINKFILE; \
230: fi; \
231: if [ "$(INS)" != ":" ]; then \
232: if [ ! -d $(FONTDIR)/$$i ]; then \
233: rm -f $(FONTDIR)/$$i; \
234: mkdir $(FONTDIR)/$$i; \
235: fi; \
236: echo " Installing binary files in directory $(FONTDIR)/$$i"; \
237: mv *.out $(FONTDIR)/$$i; \
238: chmod 644 $(FONTDIR)/$$i/*; \
239: chgrp $(GROUP) $(FONTDIR)/$$i/*; \
240: chown $(OWNER) $(FONTDIR)/$$i/*; \
241: fi; \
242: cd ..; \
243: done
244: @if [ "$(INS)" != ":" -a ! -d $(BITDIR) ]; then \
245: echo "Raster file directory $(BITDIR) doesn't exist"; \
246: exit 1; \
247: fi
248: @cd $(TABLEDIR); \
249: for j in rast*; do \
250: if [ ! -d "$$j" ]; then \
251: continue; \
252: fi; \
253: cd $$j; \
254: for i in dev*; do \
255: if [ ! -d "$$i" ]; then \
256: continue; \
257: fi; \
258: cd $$i; \
259: echo " Building binary files in directory $$j/$$i"; \
260: $(THISDIR)/makedev DESC ? ??; \
261: if [ -r LINKFILE ]; then \
262: sh LINKFILE; \
263: fi; \
264: if [ "$(INS)" != ":" ]; then \
265: if [ ! -d $(BITDIR)/$$j ]; then \
266: rm -f $(BITDIR)/$$j; \
267: mkdir $(BITDIR)/$$j; \
268: fi; \
269: if [ ! -d $(BITDIR)/$$j/$$i ]; then \
270: rm -f $(BITDIR)/$$j/$$i; \
271: mkdir $(BITDIR)/$$j/$$i; \
272: fi; \
273: echo " Installing binary files in $(BITDIR)/$$j/$$i"; \
274: mv *.out $(BITDIR)/$$j/$$i; \
275: chmod 644 $(BITDIR)/$$j/$$i/*; \
276: chgrp $(GROUP) $(BITDIR)/$$j/$$i/*; \
277: chown $(OWNER) $(BITDIR)/$$j/$$i/*; \
278: fi; \
279: cd ..; \
280: done; \
281: cd ..; \
282: done
283: @if [ "$(INS)" != ":" -a -d $(PDQDIR) ]; then \
284: cd $(TABLEDIR)/PDQ; \
285: for i in dev*; do \
286: if [ ! -d "$$i" ]; then \
287: continue; \
288: fi; \
289: cd $$i; \
290: if [ -r LINKFILE ]; then \
291: sh LINKFILE; \
292: fi; \
293: if [ ! -d $(PDQDIR)/$$i ]; then \
294: rm -f $(PDQDIR)/$$i; \
295: mkdir $(PDQDIR)/$$i; \
296: fi; \
297: echo " Installing PDQ files in directory $(PDQDIR)/$$i"; \
298: cp *.out $(PDQDIR)/$$i; \
299: chmod 644 $(PDQDIR)/$$i/*; \
300: chgrp $(GROUP) $(PDQDIR)/$$i/*; \
301: chown $(OWNER) $(PDQDIR)/$$i/*; \
302: cd ..; \
303: done; \
304: fi
305:
306:
307: raster :
308: #
309: #
310: # Handles the installation of all the raster files. The source directories
311: # are in $(TABLEDIR)/rast* and they files are copied from there to the
312: # appropriate directory in $(BITDIR).
313: #
314: # The raster files take up quite a bit of disk space and you probably don't
315: # want to keep two copies of them around. Normally they're copied from the
316: # source directories $(TABLEDIR)/rast* to $(BITDIR)/rast*, but if you set
317: # INS to mv they'll be moved instead.
318: #
319: #
320: @if [ "$(INS)" != ":" -a ! -d $(BITDIR) ]; then \
321: echo "Raster file directory $(BITDIR) doesn't exist"; \
322: exit 1; \
323: fi
324: @if [ "$(INS)" != ":" ]; then \
325: cd $(TABLEDIR); \
326: HERE=`pwd`; \
327: for i in rast*; do \
328: if [ ! -d "$$i" ]; then \
329: continue; \
330: fi; \
331: cd $$i; \
332: if [ ! -d $(BITDIR)/$$i ]; then \
333: rm -f $(BITDIR)/$$i; \
334: mkdir $(BITDIR)/$$i; \
335: fi; \
336: echo " Installing raster files in $(BITDIR)/$$i"; \
337: if [ "$(INS)" = "cp" -o "$(INS)" = "mv" ]; \
338: then $(INS) *.* RAST* $(BITDIR)/$$i; \
339: else cp *.* RAST* $(BITDIR)/$$i; \
340: fi; \
341: cd $(BITDIR)/$$i; \
342: chmod 644 *.* RAST*; \
343: chgrp $(GROUP) *.* RAST*; \
344: chown $(OWNER) *.* RAST*; \
345: cd $$HERE; \
346: done; \
347: if [ -d RESIDENT ]; then \
348: if [ ! -d $(BITDIR)/RESIDENT ]; then \
349: rm -f $(BITDIR)/RESIDENT; \
350: mkdir $(BITDIR)/RESIDENT; \
351: fi; \
352: echo " Installing resident font files in $(BITDIR)/RESIDENT"; \
353: cp RESIDENT/* $(BITDIR)/RESIDENT; \
354: cd $(BITDIR)/RESIDENT; \
355: chmod 644 *; \
356: chgrp $(GROUP) *; \
357: chown $(OWNER) *; \
358: fi; \
359: fi
360:
361:
362: pub :
363: #
364: #
365: # Character building files for eqn are included in $(TABLEDIR)/pub. If
366: # INS isn't ":" and $(PUBDIR) exists all the files in this directory will
367: # be copied to $(PUBDIR). Some locations may already have their own versions
368: # of these files, so if any one of them already exists in directory
369: # $(PUBDIR) it won't be installed.
370: #
371: #
372: @if [ "$(INS)" != ":" -a -d $(TABLEDIR)/pub ]; then \
373: cd $(TABLEDIR)/pub; \
374: if [ ! -d $(PUBDIR) ]; then \
375: echo "Missing directory $(PUBDIR)"; \
376: exit 1; \
377: fi; \
378: for i in *; do \
379: if [ -f $(PUBDIR)/$$i ]; then \
380: echo " $(PUBDIR)/$$i already exists - $$i not installed"; \
381: continue; \
382: fi; \
383: echo " Installing $$i in $(PUBDIR)"; \
384: cp $$i $(PUBDIR)/$$i; \
385: chmod 644 $(PUBDIR)/$$i; \
386: chgrp $(GROUP) $(PUBDIR)/$$i; \
387: chown $(OWNER) $(PUBDIR)/$$i; \
388: done; \
389: fi
390:
391:
392: tables : rastbuild PDQ rastmaps
393: #
394: # You probably will never need this target, but it's how I built most of
395: # the tables I've supplied. You'll need to define DEVICES, RASTSRC, and
396: # FONTSRC on the command line before things work. DEVICES probably should
397: # just be i300, RASTSRC is the directory where the source raster files
398: # for $(DEVICES) can be found (omitting the device name), and FONTSRC
399: # is where you've got the ASCII font files for the aps and i10.
400: #
401:
402:
403: rastbuild : buildrast
404: #
405: #
406: # Builds the raster files and associated fonts for $(DEVICES) using
407: # source raster files found in $(RASTSRC) and appropriately named control
408: # files found in this directory. You'll need to define both of these guys
409: # on the command line before things work right. In particular that means
410: # you'll need the source raster files that I used with RASTi300 to build
411: # the the rasti300 tables. I doubt you have the complete set so don't
412: # try using this target unless you sure you know what's happening.
413: #
414: #
415: @if [ ! "$(DEVICES)" ]; then \
416: echo "No device names given"; \
417: exit 1; \
418: fi
419: @if [ ! -d "$(RASTSRC)" ]; then \
420: echo "Bad raster file source directory"; \
421: exit 1; \
422: fi
423: @echo "Building new font and raster files for devices $(DEVICES)"
424: @SRCDIR=`pwd`; \
425: cd $(TABLEDIR); \
426: for i in $(DEVICES); do \
427: if [ ! -r $$SRCDIR/RAST$$i ]; then \
428: echo " Can't read $$SRCDIR/RAST$$i - device skipped"; \
429: continue; \
430: fi; \
431: if [ ! -d $(RASTSRC)/$$i ]; then \
432: echo " Missing source raster files for device $$i"; \
433: exit 1; \
434: fi; \
435: if [ ! -d rast$$i ]; then \
436: rm -f rast$$i; \
437: mkdir rast$$i; \
438: fi; \
439: if [ ! -d dev$$i ]; then \
440: rm -f dev$$i; \
441: mkdir dev$$i; \
442: fi; \
443: echo " Device $$i"; \
444: $$SRCDIR/buildrast -S $(RASTSRC)/$$i $$SRCDIR/RAST$$i; \
445: echo " Fixing CW spacewidth command in dev$$i"; \
446: WIDTH="spacewidth `grep '^Z' dev$$i/CW | awk '{ print $$2 }'`"; \
447: echo $$WIDTH | cat - dev$$i/CW >CW.tmp; \
448: mv CW.tmp dev$$i/CW; \
449: done
450:
451:
452: PDQ :
453: #
454: #
455: # Builds all the binary PDQ files for devices that have directories in
456: # $(TABLEDIR) and moves the binary files to an appropriately named
457: # directory in $(TABLEDIR)/PDQ. Obviously you'll need $(PDQFRONT) and
458: # $(PDQMAKEDEV) if you expect to use this target.
459: #
460: #
461: @echo "Building PDQ binary files"
462: @cd $(TABLEDIR); \
463: for i in dev*; do \
464: if [ ! -d "$$i" ]; then \
465: echo " $$i not a device directory"; \
466: continue; \
467: fi; \
468: if [ ! -d PDQ/$$i ]; then \
469: rm -f PDQ/$$i; \
470: mkdir PDQ/$$i; \
471: fi; \
472: cd $$i; \
473: echo " Device $$i"; \
474: $(PDQFRONT) $(PDQMAKEDEV) DESC ? ?? 2>/dev/null; \
475: if [ -r LINKFILE ]; then \
476: sh LINKFILE; \
477: fi; \
478: echo " Moving binary PDQ files to $(TABLEDIR)/PDQ/$$i"; \
479: mv *.out ../PDQ/$$i; \
480: cd ..; \
481: done
482:
483:
484: rastmaps : makedev makemap
485: #
486: #
487: # Builds the special font mapping files for devices that we expect will
488: # be using some of the supplied raster files. For example you'll find
489: # a devaps directory in $(TABLEDIR)/rasti300. The ASCII files are built
490: # by makemap using the binary i300 files, the ASCII aps files, and the
491: # FONTMAP file found in that directory. If there's no FONTMAP file in
492: # that directory we won't do anything. You'll need to define FONTSRC
493: # on the command line, otherwise nothing will be done.
494: #
495: #
496: @if [ ! "$(FONTSRC)" ]; then \
497: echo "No font source directory given"; \
498: exit 1; \
499: fi
500: @echo "Building special font mapping files"
501: @SRCDIR=`pwd`; \
502: cd $(TABLEDIR); \
503: for i in rast*; do \
504: if [ ! -d "$$i" ]; then \
505: echo " Skipping $$i - not a directory"; \
506: continue; \
507: fi; \
508: MASTER=`echo $$i | sed 's/rast//'`; \
509: if [ ! -d dev$$MASTER ]; then \
510: echo " Can't find master font directory $(TABLEDIR)/dev$$MASTER"; \
511: continue; \
512: fi; \
513: echo " Building binary font files for device $$MASTER"; \
514: cd dev$$MASTER; \
515: $$SRCDIR/makedev DESC ? ?? 2>/dev/null; \
516: if [ -r LINKFILE ]; then \
517: sh LINKFILE; \
518: fi; \
519: cd ../$$i; \
520: for j in dev*; do \
521: if [ ! -d "$$j" ]; then \
522: echo " No device directories in $(TABLEDIR)/$$i"; \
523: break; \
524: fi; \
525: if [ ! -r $$j/FONTMAP ]; then \
526: echo " No FONTMAP file in $(TABLEDIR)/$$i/$$j"; \
527: continue; \
528: fi; \
529: echo " Building ASCII font mapping files in $(TABLEDIR)/$$i/$$j"; \
530: TARGET=`echo $$j | sed 's/dev//'`; \
531: $$SRCDIR/makemap -m$$MASTER -S$(FONTSRC) -F.. $$TARGET; \
532: done; \
533: cd ..; \
534: rm -f dev$$MASTER/*.out; \
535: done
536:
537:
538: clean :
539: rm -f *.o
540:
541: clobber :
542: rm -f *.o $(PROGS)
543:
544: backup :
545: @if [ ! -d BACKUP ]; then \
546: mkdir BACKUP; \
547: fi
548: cp $(ALLFILES) BACKUP
549:
550: list :
551: pr $(ALLFILES) | i10send -lpr -pland -von -o5
552:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.