strip on install
[unix-history] / usr / src / lib / Makefile
CommitLineData
051b1e55 1#
d0aeaf5a 2# Copyright (c) 1983 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#
b84e9ea4 6# @(#)Makefile 5.8 (Berkeley) %G%
069fab95
KM
7#
8DESTDIR=
9CFLAGS= -O
74d5a2b2
SL
10TAGSFILE=tags
11
12# Subdirectories whose routines are included in the making of the
13# master tags file (/usr/lib/tags); the Fortran libraries should
14# be on this list, but we don't control them....
15#
16TAGSDIR=libcurses libdbm libln libm libmp libpc libtermlib
069fab95
KM
17
18# Programs that live in subdirectories, and have makefiles of their own.
19#
8e792d0c 20SUBDIR= lib2648 libF77 libI77 libU77 libcurses libdbm libg libln \
1a84272e 21 libom libm libmp libpc libplot libtermlib liby lpr me sendmail
069fab95
KM
22
23# Shell scripts that need only be installed and are never removed.
24#
25SCRIPT= makewhatis
26
27# C programs that live in the current directory and do not need
28# explicit make lines.
29#
dcb9aa88 30STD= getNAME makekey
069fab95
KM
31
32# C programs that live in the current directory and need explicit make lines.
33#
34NSTD=
35
36all: ${SUBDIR} ${STD} ${NSTD}
37
38${SUBDIR}: /tmp
39 cd $@; make ${MFLAGS}
40
41${STD}:
42 cc ${CFLAGS} -o $@ $@.c
43
44install:
3ceb07a7 45 -for i in ${SUBDIR}; do \
069fab95 46 (cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done
3ceb07a7 47 -for i in ${SCRIPT}; do (install -c $$i.sh ${DESTDIR}/usr/lib/$$i); done
b84e9ea4 48 -for i in ${STD} ${NSTD}; do (install -s $$i ${DESTDIR}/usr/lib/$$i); done
5d73db6e 49 install -c lib.b ${DESTDIR}/usr/lib/lib.b
069fab95 50
74d5a2b2 51tags:
3ceb07a7 52 -for i in ${TAGSDIR}; do \
74d5a2b2
SL
53 (cd $$i; make ${MFLAGS} TAGSFILE=../${TAGSFILE} tags); \
54 done
55
069fab95 56clean:
74d5a2b2 57 rm -f a.out core *.s *.o tags
3ceb07a7 58 -for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done
069fab95
KM
59 rm -f ${STD} ${NSTD}
60
61depend:
e34dfa89
KM
62 for i in ${STD} ${NSTD}; do \
63 cc -M ${INCPATH} $$i.c | sed 's/\.o//' | \
64 awk ' { if ($$1 != prev) \
65 { if (rec != "") print rec; rec = $$0; prev = $$1; } \
66 else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
67 else rec = rec " " $$2 } } \
68 END { print rec } ' >> makedep; done
069fab95
KM
69 echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
70 echo '$$r makedep' >>eddep
71 echo 'w' >>eddep
72 cp Makefile Makefile.bak
73 ed - Makefile < eddep
e34dfa89 74 rm eddep makedep
069fab95
KM
75 echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
76 echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
77 echo '# see make depend above' >> Makefile
78
79# Files listed in ${NSTD} have explicit make lines given below.
80
81# DO NOT DELETE THIS LINE -- make depend uses it
82
e34dfa89 83getNAME: getNAME.c /usr/include/strings.h /usr/include/stdio.h
069fab95
KM
84makekey: makekey.c
85# DEPENDENCIES MUST END AT END OF FILE
86# IF YOU PUT STUFF HERE IT WILL GO AWAY
87# see make depend above