1# 2# Copyright (c) 1987 The Regents of the University of California. 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms are permitted 6# provided that the above copyright notice and this paragraph are 7# duplicated in all such forms and that any documentation, 8# advertising materials, and other materials related to such 9# distribution and use acknowledge that the software was developed 10# by the University of California, Berkeley. The name of the 11# University may not be used to endorse or promote products derived 12# from this software without specific prior written permission. 13# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 14# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 15# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16# 17# @(#)Makefile 5.15 (Berkeley) 05/09/89 18# 19# C Shell with process control; VM/UNIX VAX Makefile 20# Bill Joy UC Berkeley; Jim Kulp IIASA, Austria 21# 22# To profile, put -DPROF in DEFS and -pg in CFLAGS, and recompile. 23 24DEFS= -DTELL -DVFORK -DFILEC 25CFLAGS= ${DEFS} -I. -O 26MAN= csh.0 27 28SRCS= alloc.c doprnt.c sh.c sh.char.c sh.dir.c sh.dol.c sh.err.c \ 29 sh.exec.c sh.exp.c sh.file.c sh.func.c sh.glob.c sh.hist.c \ 30 sh.init.c sh.lex.c sh.misc.c sh.parse.c sh.print.c sh.proc.c \ 31 sh.sem.c sh.set.c sh.time.c 32OBJS= alloc.o doprnt.o sh.o sh.char.o sh.dir.o sh.dol.o sh.err.o \ 33 sh.exec.o sh.exp.o sh.file.o sh.func.o sh.glob.o sh.hist.o \ 34 sh.init.o sh.lex.o sh.misc.o sh.parse.o sh.print.o sh.proc.o \ 35 sh.sem.o sh.set.o sh.time.o 36 37# Special massaging of C files for sharing of strings 38.c.o: 39 ${CC} -E ${CFLAGS} $*.c | xstr -c - 40 @${CC} -c ${CFLAGS} x.c 41 @mv -f x.o $*.o 42 @rm -f x.c 43 44all: csh 45 46# strings.o must be last since it can change when previous files compile 47csh: ${OBJS} strings.o 48 ${CC} ${CFLAGS} ${OBJS} strings.o -o $@ 49 50# strings.o, sh.init.o, and sh.char.o are specially processed to be shared 51strings.o: strings 52 xstr 53 ${CC} -c -R xs.c 54 mv -f xs.o strings.o 55 rm -f xs.c 56 57sh.char.o sh.init.o: 58 ${CC} -E ${CFLAGS} $*.c | xstr -c - 59 ${CC} ${CFLAGS} -c -R x.c 60 mv -f x.o $*.o 61 rm -f x.c 62 63clean: 64 rm -f ${OBJS} core csh strings strings.o x.c x.o xs.c xs.o 65 66cleandir: clean 67 rm -f ${MAN} tags .depend 68 69depend: ${SRCS} 70 mkdep ${CFLAGS} ${SRCS} 71 72install: ${MAN} 73 install -s -o bin -g bin -m 755 csh ${DESTDIR}/bin/csh 74 install -c -o bin -g bin -m 444 ${MAN} ${DESTDIR}/usr/man/cat1 75 rm -f ${DESTDIR}/usr/man/cat1/limit.0 76 ln ${DESTDIR}/usr/man/cat1/csh.0 ${DESTDIR}/usr/man/cat1/limit.0 77 78lint: ${SRCS} 79 lint ${CFLAGS} ${SRCS} 80 81tags: 82 ctags ${SRCS} 83