Chris's changes, plus some minor fixes
[unix-history] / usr / src / lib / Makefile
CommitLineData
051b1e55 1#
a096d51a 2# Copyright (c) 1987 Regents of the University of California.
051b1e55
DF
3# All rights reserved. The Berkeley software License Agreement
4# specifies the terms and conditions for redistribution.
5#
37b8e2b1 6# @(#)Makefile 5.12 (Berkeley) %G%
069fab95
KM
7#
8DESTDIR=
9CFLAGS= -O
37b8e2b1 10LIBC= /lib/libc.a
74d5a2b2
SL
11TAGSFILE=tags
12
13# Subdirectories whose routines are included in the making of the
14# master tags file (/usr/lib/tags); the Fortran libraries should
15# be on this list, but we don't control them....
16#
17TAGSDIR=libcurses libdbm libln libm libmp libpc libtermlib
069fab95
KM
18
19# Programs that live in subdirectories, and have makefiles of their own.
20#
97f841da 21SUBDIR= learn lib2648 libF77 libI77 libU77 libcurses libdbm libg libln \
1a84272e 22 libom libm libmp libpc libplot libtermlib liby lpr me sendmail
069fab95 23
a096d51a
KB
24# C source that lives in the current directory
25#
26SRCS= getNAME.c makekey.c
27
069fab95
KM
28# C programs that live in the current directory and do not need
29# explicit make lines.
30#
dcb9aa88 31STD= getNAME makekey
069fab95
KM
32
33# C programs that live in the current directory and need explicit make lines.
34#
a096d51a 35NSTD=
069fab95 36
37b8e2b1 37all: ${SUBDIR} ${STD} ${NSTD}
069fab95 38
f0f83cf4 39${SUBDIR}: FRC
069fab95
KM
40 cd $@; make ${MFLAGS}
41
37b8e2b1 42${STD}: ${LIBC}
a096d51a 43 ${CC} ${CFLAGS} -o $@ $@.c
069fab95 44
37b8e2b1 45install: FRC
3ceb07a7 46 -for i in ${SUBDIR}; do \
a096d51a
KB
47 (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); \
48 done
a096d51a
KB
49 -for i in ${STD} ${NSTD}; do \
50 (install -s -o bin -g bin -m 755 $$i ${DESTDIR}/usr/lib/$$i); \
51 done
52 install -c -o bin -g bin -m 755 lib.b ${DESTDIR}/usr/lib/lib.b
069fab95 53
37b8e2b1 54tags: FRC
3ceb07a7 55 -for i in ${TAGSDIR}; do \
74d5a2b2
SL
56 (cd $$i; make ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \
57 done
58
37b8e2b1 59clean: FRC
a096d51a 60 rm -f a.out core *.s *.o tags ${STD} ${NSTD}
37b8e2b1
KB
61 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done
62
63depend: ldepend
64 for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} depend); done
069fab95 65
37b8e2b1 66ldepend: FRC
a096d51a 67 mkdep -p ${CFLAGS} ${SRCS}
37b8e2b1
KB
68
69FRC:
069fab95
KM
70
71# Files listed in ${NSTD} have explicit make lines given below.
72
a096d51a
KB
73# DO NOT DELETE THIS LINE -- mkdep uses it.
74# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY.
069fab95 75
e34dfa89 76getNAME: getNAME.c /usr/include/strings.h /usr/include/stdio.h
069fab95 77makekey: makekey.c
a096d51a
KB
78
79# IF YOU PUT ANYTHING HERE IT WILL GO AWAY