merge common code from dmf and dmz drivers
[unix-history] / usr / src / usr.sbin / config / mkmakefile.c
CommitLineData
cd68466f
DF
1/*
2 * Copyright (c) 1980 Regents of the University of California.
3 * All rights reserved. The Berkeley software License Agreement
4 * specifies the terms and conditions for redistribution.
5 */
6
524aa063 7#ifndef lint
a0105456 8static char sccsid[] = "@(#)mkmakefile.c 5.10 (Berkeley) %G%";
cd68466f 9#endif not lint
28061b3f 10
01d17851 11/*
28061b3f
BJ
12 * Build the makefile for the system, from
13 * the information in the files files and the
14 * additional files for the machine being compiled to.
01d17851
MT
15 */
16
17#include <stdio.h>
d5429061 18#include <ctype.h>
01d17851
MT
19#include "y.tab.h"
20#include "config.h"
21
28061b3f
BJ
22#define next_word(fp, wd) \
23 { register char *word = get_word(fp); \
22d68ad0
BJ
24 if (word == (char *)EOF) \
25 return; \
28061b3f
BJ
26 else \
27 wd = word; \
28 }
01d17851 29
28061b3f 30static struct file_list *fcur;
15eb15d7 31char *tail();
01d17851
MT
32
33/*
e3dad45e 34 * Lookup a file, by name.
01d17851 35 */
28061b3f
BJ
36struct file_list *
37fl_lookup(file)
38 register char *file;
01d17851 39{
28061b3f
BJ
40 register struct file_list *fp;
41
22d68ad0 42 for (fp = ftab ; fp != 0; fp = fp->f_next) {
28061b3f
BJ
43 if (eq(fp->f_fn, file))
44 return (fp);
45 }
46 return (0);
01d17851
MT
47}
48
15eb15d7
KM
49/*
50 * Lookup a file, by final component name.
51 */
52struct file_list *
53fltail_lookup(file)
54 register char *file;
55{
56 register struct file_list *fp;
57
58 for (fp = ftab ; fp != 0; fp = fp->f_next) {
59 if (eq(tail(fp->f_fn), tail(file)))
60 return (fp);
61 }
62 return (0);
63}
64
01d17851 65/*
28061b3f 66 * Make a new file list entry
01d17851 67 */
28061b3f
BJ
68struct file_list *
69new_fent()
01d17851 70{
28061b3f
BJ
71 register struct file_list *fp;
72
73 fp = (struct file_list *) malloc(sizeof *fp);
22d68ad0
BJ
74 fp->f_needs = 0;
75 fp->f_next = 0;
3c812eeb
SL
76 fp->f_flags = 0;
77 fp->f_type = 0;
22d68ad0 78 if (fcur == 0)
28061b3f
BJ
79 fcur = ftab = fp;
80 else
81 fcur->f_next = fp;
82 fcur = fp;
83 return (fp);
01d17851
MT
84}
85
28061b3f 86char *COPTS;
18d7531d
SL
87static struct users {
88 int u_default;
89 int u_min;
90 int u_max;
91} users[] = {
92 { 24, 8, 1024 }, /* MACHINE_VAX */
a0105456 93 { 4, 2, 128 }, /* MACHINE_TAHOE */
18d7531d
SL
94};
95#define NUSERS (sizeof (users) / sizeof (users[0]))
28061b3f 96
01d17851 97/*
28061b3f 98 * Build the makefile from the skeleton
01d17851 99 */
01d17851
MT
100makefile()
101{
28061b3f
BJ
102 FILE *ifp, *ofp;
103 char line[BUFSIZ];
104 struct opt *op;
18d7531d 105 struct users *up;
28061b3f
BJ
106
107 read_files();
05b83a6c 108 strcpy(line, "../conf/Makefile.");
22d68ad0 109 (void) strcat(line, machinename);
28061b3f 110 ifp = fopen(line, "r");
22d68ad0 111 if (ifp == 0) {
28061b3f
BJ
112 perror(line);
113 exit(1);
114 }
05b83a6c 115 ofp = fopen(path("Makefile"), "w");
22d68ad0 116 if (ofp == 0) {
05b83a6c 117 perror(path("Makefile"));
28061b3f
BJ
118 exit(1);
119 }
120 fprintf(ofp, "IDENT=-D%s", raise(ident));
121 if (profiling)
122 fprintf(ofp, " -DGPROF");
123 if (cputype == 0) {
124 printf("cpu type must be specified\n");
125 exit(1);
126 }
127 { struct cputype *cp;
128 for (cp = cputype; cp; cp = cp->cpu_next)
129 fprintf(ofp, " -D%s", cp->cpu_name);
130 }
131 for (op = opt; op; op = op->op_next)
132 if (op->op_value)
133 fprintf(ofp, " -D%s=\"%s\"", op->op_name, op->op_value);
134 else
135 fprintf(ofp, " -D%s", op->op_name);
136 fprintf(ofp, "\n");
137 if (hadtz == 0)
138 printf("timezone not specified; gmt assumed\n");
18d7531d
SL
139 if ((unsigned)machine > NUSERS) {
140 printf("maxusers config info isn't present, using vax\n");
141 up = &users[MACHINE_VAX-1];
142 } else
143 up = &users[machine-1];
28061b3f 144 if (maxusers == 0) {
18d7531d
SL
145 printf("maxusers not specified; %d assumed\n", up->u_default);
146 maxusers = up->u_default;
147 } else if (maxusers < up->u_min) {
148 printf("minimum of %d maxusers assumed\n", up->u_min);
149 maxusers = up->u_min;
150 } else if (maxusers > up->u_max)
151 printf("warning: maxusers > %d (%d)\n", up->u_max, maxusers);
28061b3f
BJ
152 fprintf(ofp, "PARAM=-DTIMEZONE=%d -DDST=%d -DMAXUSERS=%d\n",
153 timezone, dst, maxusers);
7c1d4665
MK
154 for (op = mkopt; op; op = op->op_next)
155 fprintf(ofp, "%s=%s\n", op->op_name, op->op_value);
22d68ad0 156 while (fgets(line, BUFSIZ, ifp) != 0) {
28061b3f
BJ
157 if (*line == '%')
158 goto percent;
159 if (profiling && strncmp(line, "COPTS=", 6) == 0) {
160 register char *cp;
161
0356b29c
SL
162 fprintf(ofp,
163 "GPROF.EX=/usr/src/lib/libc/%s/csu/gmon.ex\n",
164 machinename);
28061b3f
BJ
165 cp = index(line, '\n');
166 if (cp)
167 *cp = 0;
168 cp = line + 6;
169 while (*cp && (*cp == ' ' || *cp == '\t'))
170 cp++;
22d68ad0 171 COPTS = malloc((unsigned)(strlen(cp) + 1));
28061b3f 172 if (COPTS == 0) {
f2db9eb7 173 printf("config: out of memory\n");
28061b3f
BJ
174 exit(1);
175 }
176 strcpy(COPTS, cp);
177 fprintf(ofp, "%s -pg\n", line);
178 continue;
8486638c 179 }
28061b3f 180 fprintf(ofp, "%s", line);
8486638c 181 continue;
28061b3f
BJ
182 percent:
183 if (eq(line, "%OBJS\n"))
184 do_objs(ofp);
185 else if (eq(line, "%CFILES\n"))
186 do_cfiles(ofp);
187 else if (eq(line, "%RULES\n"))
188 do_rules(ofp);
189 else if (eq(line, "%LOAD\n"))
190 do_load(ofp);
191 else
192 fprintf(stderr,
193 "Unknown %% construct in generic makefile: %s",
194 line);
01d17851 195 }
73845e07
SL
196 (void) fclose(ifp);
197 (void) fclose(ofp);
01d17851
MT
198}
199
200/*
28061b3f
BJ
201 * Read in the information about files used in making the system.
202 * Store it in the ftab linked list.
01d17851 203 */
01d17851
MT
204read_files()
205{
28061b3f 206 FILE *fp;
e3dad45e 207 register struct file_list *tp, *pf;
28061b3f 208 register struct device *dp;
05b83a6c 209 register struct opt *op;
28061b3f
BJ
210 char *wd, *this, *needs, *devorprof;
211 char fname[32];
05b83a6c 212 int nreqs, first = 1, configdep, isdup;
28061b3f 213
22d68ad0
BJ
214 ftab = 0;
215 (void) strcpy(fname, "files");
28061b3f
BJ
216openit:
217 fp = fopen(fname, "r");
22d68ad0 218 if (fp == 0) {
73845e07 219 perror(fname);
28061b3f
BJ
220 exit(1);
221 }
222next:
3c812eeb
SL
223 /*
224 * filename [ standard | optional ] [ config-dependent ]
225 * [ dev* | profiling-routine ] [ device-driver]
226 */
28061b3f 227 wd = get_word(fp);
22d68ad0
BJ
228 if (wd == (char *)EOF) {
229 (void) fclose(fp);
15eb15d7 230 if (first == 1) {
22d68ad0 231 (void) sprintf(fname, "files.%s", machinename);
15eb15d7 232 first++;
28061b3f
BJ
233 goto openit;
234 }
15eb15d7
KM
235 if (first == 2) {
236 (void) sprintf(fname, "files.%s", raise(ident));
237 first++;
238 fp = fopen(fname, "r");
239 if (fp != 0)
240 goto next;
241 }
28061b3f
BJ
242 return;
243 }
22d68ad0 244 if (wd == 0)
28061b3f 245 goto next;
01d17851 246 this = ns(wd);
01d17851 247 next_word(fp, wd);
22d68ad0 248 if (wd == 0) {
f2db9eb7 249 printf("%s: No type for %s.\n",
28061b3f
BJ
250 fname, this);
251 exit(1);
01d17851 252 }
e3dad45e 253 if ((pf = fl_lookup(this)) && (pf->f_type != INVISIBLE || pf->f_flags))
05b83a6c
MK
254 isdup = 1;
255 else
256 isdup = 0;
15eb15d7
KM
257 tp = 0;
258 if (first == 3 && (tp = fltail_lookup(this)) != 0)
259 printf("%s: Local file %s overrides %s.\n",
260 fname, this, tp->f_fn);
28061b3f
BJ
261 nreqs = 0;
262 devorprof = "";
3c812eeb 263 configdep = 0;
28061b3f
BJ
264 needs = 0;
265 if (eq(wd, "standard"))
266 goto checkdev;
267 if (!eq(wd, "optional")) {
3c812eeb 268 printf("%s: %s must be optional or standard\n", fname, this);
28061b3f
BJ
269 exit(1);
270 }
271nextopt:
272 next_word(fp, wd);
22d68ad0 273 if (wd == 0)
28061b3f 274 goto doneopt;
3c812eeb
SL
275 if (eq(wd, "config-dependent")) {
276 configdep++;
277 goto nextopt;
278 }
28061b3f 279 devorprof = wd;
73845e07
SL
280 if (eq(wd, "device-driver") || eq(wd, "profiling-routine")) {
281 next_word(fp, wd);
28061b3f 282 goto save;
73845e07 283 }
28061b3f 284 nreqs++;
05b83a6c 285 if (needs == 0 && nreqs == 1)
28061b3f 286 needs = ns(wd);
05b83a6c
MK
287 if (isdup)
288 goto invis;
22d68ad0 289 for (dp = dtab; dp != 0; dp = dp->d_next)
28061b3f
BJ
290 if (eq(dp->d_name, wd))
291 goto nextopt;
05b83a6c
MK
292 for (op = opt; op != 0; op = op->op_next)
293 if (op->op_value == 0 && opteq(op->op_name, wd)) {
294 if (nreqs == 1) {
295 free(needs);
296 needs = 0;
297 }
298 goto nextopt;
299 }
300invis:
22d68ad0 301 while ((wd = get_word(fp)) != 0)
28061b3f 302 ;
92a477cd
MK
303 if (tp == 0)
304 tp = new_fent();
01d17851 305 tp->f_fn = this;
28061b3f
BJ
306 tp->f_type = INVISIBLE;
307 tp->f_needs = needs;
05b83a6c 308 tp->f_flags = isdup;
28061b3f 309 goto next;
3c812eeb 310
28061b3f
BJ
311doneopt:
312 if (nreqs == 0) {
f2db9eb7 313 printf("%s: what is %s optional on?\n",
28061b3f
BJ
314 fname, this);
315 exit(1);
316 }
3c812eeb 317
28061b3f
BJ
318checkdev:
319 if (wd) {
2fcca161 320 next_word(fp, wd);
3c812eeb
SL
321 if (wd) {
322 if (eq(wd, "config-dependent")) {
323 configdep++;
324 goto checkdev;
325 }
28061b3f
BJ
326 devorprof = wd;
327 next_word(fp, wd);
2fcca161 328 }
01d17851 329 }
3c812eeb 330
28061b3f 331save:
3c812eeb 332 if (wd) {
f2db9eb7 333 printf("%s: syntax error describing %s\n",
28061b3f
BJ
334 fname, this);
335 exit(1);
2fcca161 336 }
73845e07
SL
337 if (eq(devorprof, "profiling-routine") && profiling == 0)
338 goto next;
92a477cd
MK
339 if (tp == 0)
340 tp = new_fent();
28061b3f
BJ
341 tp->f_fn = this;
342 if (eq(devorprof, "device-driver"))
3c812eeb 343 tp->f_type = DRIVER;
28061b3f
BJ
344 else if (eq(devorprof, "profiling-routine"))
345 tp->f_type = PROFILING;
346 else
347 tp->f_type = NORMAL;
3c812eeb
SL
348 tp->f_flags = 0;
349 if (configdep)
350 tp->f_flags |= CONFIGDEP;
28061b3f 351 tp->f_needs = needs;
e3dad45e
MK
352 if (pf && pf->f_type == INVISIBLE)
353 pf->f_flags = 1; /* mark as duplicate */
28061b3f 354 goto next;
01d17851
MT
355}
356
05b83a6c
MK
357opteq(cp, dp)
358 char *cp, *dp;
359{
360 char c, d;
361
362 for (; ; cp++, dp++) {
363 if (*cp != *dp) {
364 c = isupper(*cp) ? tolower(*cp) : *cp;
365 d = isupper(*dp) ? tolower(*dp) : *dp;
366 if (c != d)
367 return (0);
368 }
369 if (*cp == 0)
370 return (1);
371 }
372}
373
01d17851 374do_objs(fp)
28061b3f 375 FILE *fp;
01d17851 376{
15eb15d7 377 register struct file_list *tp, *fl;
28061b3f
BJ
378 register int lpos, len;
379 register char *cp, och, *sp;
15eb15d7 380 char swapname[32];
28061b3f
BJ
381
382 fprintf(fp, "OBJS=");
383 lpos = 6;
22d68ad0 384 for (tp = ftab; tp != 0; tp = tp->f_next) {
28061b3f
BJ
385 if (tp->f_type == INVISIBLE)
386 continue;
387 sp = tail(tp->f_fn);
36edb824
SL
388 for (fl = conf_list; fl; fl = fl->f_next) {
389 if (fl->f_type != SWAPSPEC)
390 continue;
391 sprintf(swapname, "swap%s.c", fl->f_fn);
15eb15d7
KM
392 if (eq(sp, swapname))
393 goto cont;
394 }
28061b3f
BJ
395 cp = sp + (len = strlen(sp)) - 1;
396 och = *cp;
397 *cp = 'o';
398 if (len + lpos > 72) {
399 lpos = 8;
400 fprintf(fp, "\\\n\t");
401 }
402 fprintf(fp, "%s ", sp);
403 lpos += len + 1;
404 *cp = och;
36edb824
SL
405cont:
406 ;
01d17851 407 }
28061b3f
BJ
408 if (lpos != 8)
409 putc('\n', fp);
01d17851
MT
410}
411
01d17851 412do_cfiles(fp)
28061b3f 413 FILE *fp;
01d17851 414{
28061b3f
BJ
415 register struct file_list *tp;
416 register int lpos, len;
417
418 fprintf(fp, "CFILES=");
419 lpos = 8;
22d68ad0 420 for (tp = ftab; tp != 0; tp = tp->f_next) {
28061b3f
BJ
421 if (tp->f_type == INVISIBLE)
422 continue;
423 if (tp->f_fn[strlen(tp->f_fn)-1] != 'c')
424 continue;
425 if ((len = 3 + strlen(tp->f_fn)) + lpos > 72) {
426 lpos = 8;
427 fprintf(fp, "\\\n\t");
428 }
429 fprintf(fp, "../%s ", tp->f_fn);
430 lpos += len + 1;
01d17851 431 }
28061b3f
BJ
432 if (lpos != 8)
433 putc('\n', fp);
01d17851
MT
434}
435
28061b3f
BJ
436char *
437tail(fn)
438 char *fn;
01d17851 439{
28061b3f 440 register char *cp;
01d17851 441
28061b3f 442 cp = rindex(fn, '/');
15eb15d7
KM
443 if (cp == 0)
444 return (fn);
28061b3f 445 return (cp+1);
01d17851
MT
446}
447
448/*
28061b3f
BJ
449 * Create the makerules for each file
450 * which is part of the system.
451 * Devices are processed with the special c2 option -i
452 * which avoids any problem areas with i/o addressing
453 * (e.g. for the VAX); assembler files are processed by as.
01d17851 454 */
01d17851 455do_rules(f)
28061b3f 456 FILE *f;
01d17851 457{
28061b3f
BJ
458 register char *cp, *np, och, *tp;
459 register struct file_list *ftp;
3c812eeb 460 char *extras;
01d17851 461
22d68ad0 462for (ftp = ftab; ftp != 0; ftp = ftp->f_next) {
01d17851 463 if (ftp->f_type == INVISIBLE)
28061b3f 464 continue;
01d17851
MT
465 cp = (np = ftp->f_fn) + strlen(ftp->f_fn) - 1;
466 och = *cp;
467 *cp = '\0';
fb547c4b
MK
468 if (och == 'o') {
469 fprintf(f, "%so:\n\t-cp ../%so .\n", tail(np), np);
470 continue;
471 }
01d17851
MT
472 fprintf(f, "%so: ../%s%c\n", tail(np), np, och);
473 tp = tail(np);
28061b3f 474 if (och == 's') {
cd42919c 475 fprintf(f, "\t-ln -s ../%ss %sc\n", np, tp);
46e3cd06 476 fprintf(f, "\t${CC} -E ${COPTS} %sc | ${AS} -o %so\n",
cd42919c
KM
477 tp, tp);
478 fprintf(f, "\trm -f %sc\n\n", tp);
28061b3f 479 continue;
01d17851 480 }
3c812eeb
SL
481 if (ftp->f_flags & CONFIGDEP)
482 extras = "${PARAM} ";
483 else
484 extras = "";
28061b3f
BJ
485 switch (ftp->f_type) {
486
487 case NORMAL:
488 switch (machine) {
489
490 case MACHINE_VAX:
a0105456 491 case MACHINE_TAHOE:
46e3cd06 492 fprintf(f, "\t${CC} -c -S ${COPTS} %s../%sc\n",
3c812eeb 493 extras, np);
18d7531d
SL
494 fprintf(f, "\t${C2} %ss | ${INLINE} | ${AS} -o %so\n",
495 tp, tp);
28061b3f
BJ
496 fprintf(f, "\trm -f %ss\n\n", tp);
497 break;
28061b3f
BJ
498 }
499 break;
500
3c812eeb 501 case DRIVER:
28061b3f
BJ
502 switch (machine) {
503
504 case MACHINE_VAX:
a0105456 505 case MACHINE_TAHOE:
46e3cd06 506 fprintf(f, "\t${CC} -c -S ${COPTS} %s../%sc\n",
3c812eeb 507 extras, np);
18d7531d
SL
508 fprintf(f,"\t${C2} -i %ss | ${INLINE} | ${AS} -o %so\n",
509 tp, tp);
28061b3f
BJ
510 fprintf(f, "\trm -f %ss\n\n", tp);
511 break;
28061b3f
BJ
512 }
513 break;
514
515 case PROFILING:
8486638c
SL
516 if (!profiling)
517 continue;
518 if (COPTS == 0) {
519 fprintf(stderr,
28061b3f 520 "config: COPTS undefined in generic makefile");
8486638c
SL
521 COPTS = "";
522 }
28061b3f
BJ
523 switch (machine) {
524
a0105456
SL
525 case MACHINE_TAHOE:
526 fprintf(f, "\t${CC} -c -S %s %s../%sc\n",
527 COPTS, extras, np);
528 fprintf(f, "\tex - %ss < ${GPROF.EX}\n", tp);
529 fprintf(f,"\t${C2} %ss | ${INLINE} | ${AS} -o %so\n",
530 tp, tp);
531 fprintf(f, "\trm -f %ss\n\n", tp);
532 break;
533
28061b3f 534 case MACHINE_VAX:
46e3cd06 535 fprintf(f, "\t${CC} -c -S %s %s../%sc\n",
3c812eeb 536 COPTS, extras, np);
c7456392 537 fprintf(f, "\tex - %ss < ${GPROF.EX}\n", tp);
18d7531d 538 fprintf(f, "\t${INLINE} %ss | ${AS} -o %so\n", tp, tp);
28061b3f
BJ
539 fprintf(f, "\trm -f %ss\n\n", tp);
540 break;
28061b3f 541 }
73845e07 542 break;
28061b3f
BJ
543
544 default:
3c812eeb 545 printf("Don't know rules for %s\n", np);
28061b3f
BJ
546 break;
547 }
01d17851 548 *cp = och;
28061b3f 549}
01d17851
MT
550}
551
552/*
553 * Create the load strings
554 */
01d17851 555do_load(f)
28061b3f 556 register FILE *f;
01d17851 557{
28061b3f 558 register struct file_list *fl;
821eeaae 559 int first = 1;
36edb824 560 struct file_list *do_systemspec();
28061b3f 561
36edb824
SL
562 fl = conf_list;
563 while (fl) {
564 if (fl->f_type != SYSTEMSPEC) {
565 fl = fl->f_next;
566 continue;
28061b3f 567 }
36edb824
SL
568 fl = do_systemspec(f, fl, first);
569 if (first)
570 first = 0;
571 }
572 fprintf(f, "all:");
573 for (fl = conf_list; fl != 0; fl = fl->f_next)
574 if (fl->f_type == SYSTEMSPEC)
575 fprintf(f, " %s", fl->f_needs);
576 fprintf(f, "\n");
577}
28061b3f 578
36edb824
SL
579struct file_list *
580do_systemspec(f, fl, first)
581 FILE *f;
582 register struct file_list *fl;
583 int first;
584{
28061b3f 585
05b83a6c 586 fprintf(f, "%s: Makefile", fl->f_needs);
a0105456
SL
587 if (machine == MACHINE_VAX || machine == MACHINE_TAHOE)
588 fprintf(f, " ${INLINE}", machinename);
589 fprintf(f, " locore.o ${OBJS} param.o ioconf.o swap%s.o\n", fl->f_fn);
36edb824
SL
590 fprintf(f, "\t@echo loading %s\n\t@rm -f %s\n",
591 fl->f_needs, fl->f_needs);
592 if (first) {
593 fprintf(f, "\t@sh ../conf/newvers.sh\n");
594 fprintf(f, "\t@${CC} $(CFLAGS) -c vers.c\n");
190b5698 595 }
36edb824 596 switch (machine) {
28061b3f 597
36edb824
SL
598 case MACHINE_VAX:
599 fprintf(f, "\t@${LD} -n -o %s -e start -x -T 80000000 ",
600 fl->f_needs);
a0105456
SL
601 fprintf(f,
602 "locore.o emulate.o ${OBJS} vers.o ioconf.o param.o ");
603 break;
604
605 case MACHINE_TAHOE:
606 fprintf(f, "\t@${LD} -n -o %s -e start -x -T C0000800 ",
607 fl->f_needs);
608 fprintf(f, "locore.o ${OBJS} vers.o ioconf.o param.o ");
36edb824 609 break;
36edb824 610 }
36edb824
SL
611 fprintf(f, "swap%s.o\n", fl->f_fn);
612 fprintf(f, "\t@echo rearranging symbols\n");
613 fprintf(f, "\t@-symorder ../%s/symbols.sort %s\n",
614 machinename, fl->f_needs);
615 fprintf(f, "\t@size %s\n", fl->f_needs);
616 fprintf(f, "\t@chmod 755 %s\n\n", fl->f_needs);
617 do_swapspec(f, fl->f_fn);
618 for (fl = fl->f_next; fl->f_type == SWAPSPEC; fl = fl->f_next)
619 ;
620 return (fl);
621}
622
623do_swapspec(f, name)
624 FILE *f;
625 register char *name;
626{
627
628 if (!eq(name, "generic")) {
629 fprintf(f, "swap%s.o: swap%s.c\n", name, name);
46e3cd06 630 fprintf(f, "\t${CC} -c -O ${COPTS} swap%s.c\n\n", name);
36edb824
SL
631 return;
632 }
633 fprintf(f, "swapgeneric.o: ../%s/swapgeneric.c\n", machinename);
634 switch (machine) {
635
636 case MACHINE_VAX:
a0105456 637 case MACHINE_TAHOE:
46e3cd06 638 fprintf(f, "\t${CC} -c -S ${COPTS} ");
36edb824 639 fprintf(f, "../%s/swapgeneric.c\n", machinename);
18d7531d 640 fprintf(f, "\t${C2} swapgeneric.s | ${INLINE}");
36edb824
SL
641 fprintf(f, " | ${AS} -o swapgeneric.o\n");
642 fprintf(f, "\trm -f swapgeneric.s\n\n");
643 break;
28061b3f 644 }
01d17851 645}
d5429061 646
22d68ad0 647char *
d5429061 648raise(str)
28061b3f 649 register char *str;
d5429061 650{
28061b3f
BJ
651 register char *cp = str;
652
653 while (*str) {
654 if (islower(*str))
655 *str = toupper(*str);
656 str++;
657 }
658 return (cp);
d5429061 659}