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# @(#)Makefile 5.2 (Berkeley) 05/30/85 7# 8# Doing a make install builds /usr/include 9# 10# Define SHARED to indicate whether you want 11# symbolic links to the system source (``symlinks''), 12# or a separate copy (``copies''). 13# (latter useful in environments where it's 14# not possible to keep /sys publicly readable) 15# 16# The ``rm -rf''s used below are safe because rm doesn't 17# follow symbolic links. 18# 19DESTDIR= 20SUBDIRS=arpa pascal 21STD= a.out.h ar.h assert.h ctype.h curses.h dbm.h ndbm.h \ 22 disktab.h dumprestor.h fcntl.h fstab.h grp.h lastlog.h \ 23 math.h mp.h mtab.h nameser.h netdb.h nlist.h pcc.h ptrace.h pwd.h \ 24 ranlib.h resolv.h setjmp.h sgtty.h stab.h stdio.h strings.h \ 25 struct.h syscall.h sysexits.h ttyent.h utmp.h varargs.h vfont.h 26LINKS= errno.h signal.h syslog.h 27MACHINE=vax 28MACHDEP=${MACHINE} vaxif vaxmba vaxuba 29NETDIRS=net netimp netinet netpup 30SYSDIRS=${NETDIRS} stand ${MACHDEP} 31SHARED= symlinks 32TAGSFILE=tags 33 34all: 35 36install: ${SHARED} 37 -for i in ${STD}; do \ 38 install -c -m 444 $$i ${DESTDIR}/usr/include/$$i; \ 39 done 40 -for i in ${SUBDIRS}; do \ 41 if [ ! -d ${DESTDIR}/usr/include/$$i ]; \ 42 then \ 43 mkdir ${DESTDIR}/usr/include/$$i; \ 44 fi; \ 45 (cd $$i; for j in *.[ih]; do \ 46 install -c -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \ 47 done); \ 48 done 49 -for i in ${LINKS}; do \ 50 rm -f ${DESTDIR}/usr/include/$$i; \ 51 ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \ 52 done 53 rm -f ${DESTDIR}/usr/include/machine 54 ln -s ./${MACHINE} ${DESTDIR}/usr/include/machine 55 rm -f ${DESTDIR}/usr/include/frame.h 56 ln -s machine/frame.h ${DESTDIR}/usr/include/frame.h 57 58symlinks: 59 for i in ${SYSDIRS}; do \ 60 rm -rf ${DESTDIR}/usr/include/$$i; \ 61 ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \ 62 done 63 rm -rf ${DESTDIR}/usr/include/sys 64 ln -s /sys/h ${DESTDIR}/usr/include/sys 65 66copies: 67 for i in ${SYSDIRS}; do \ 68 rm -rf ${DESTDIR}/usr/include/$$i; \ 69 cd /sys; \ 70 tar cf - $$i/*.h | (cd /usr/include; tar xpf -); \ 71 done 72 rm -rf ${DESTDIR}/usr/include/sys; 73 mkdir ${DESTDIR}/usr/include/sys; 74 chmod 775 ${DESTDIR}/usr/include/sys; 75 (cd /sys/h; tar cf - *.h | (cd ${DESTDIR}/usr/include/sys; tar xpf -)) 76 77tags: 78 cwd=/usr/include; \ 79 for i in ${STD} ${LINKS}; do \ 80 ctags -a -f ${TAGSFILE} $$cwd/$$i; \ 81 done 82 83clean: 84 rm -f tags 85