head     1.2;
branch   ;
access   ;
symbols  ;
locks    ;
comment  @# @;


1.2
date     91.01.08.22.09.05;  author bruce;  state Exp;
branches ;
next     1.1;

1.1
date     91.01.08.22.06.57;  author bruce;  state Exp;
branches ;
next     ;


desc
@Initial revision is as distributed with Dynix Source V3.0.17,
    file dated Sep 29 1989.
Initial revision had RCS ident:
    $Header: Makefile 2.23 89/09/29 $
@


1.2
log
@Changed setgid group for memory-reading programs from "daemon" to "kmem".
    Affects dmesg, pstat, showcfg.
Changed setgid group for disk-reading programs from "daemon" to "operator".
    Affects mirror.
@
text
@# $Copyright:	$
# Copyright (c) 1984, 1985, 1986, 1987, 1988, 1989 
# Sequent Computer Systems, Inc.   All rights reserved.
#  
# This software is furnished under a license and may be used
# only in accordance with the terms of that license and with the
# inclusion of the above copyright notice.   This software may not
# be provided or otherwise made available to, or used by, any
# other person.  No title to or ownership of the software is
# hereby transferred.

# $Header: /usr/src/dynix.3.0.17/src/etc/RCS/Makefile,v 1.1 91/01/08 22:06:57 bruce Exp $
#
CFLAGS=	-O $(INCLUDE)
#

# Programs that live in subdirectories, and have makefiles of their own.
#
SUBDIR=	dump fsck getty htable restore version 

# Shell scripts that need only be installed and are never removed.
#
SCRIPT=	fastboot fasthalt mklost+found

# C programs that live in the current directory and do not need
# explicit make lines.
#
STD=	addbad bad144 badsect bootflags bp chown \
	clri comsat cron diskpart fsirand gettable \
	halt ifconfig init newfs mkfs mknod \
	on online dmesg pmap portmap pstat reboot \
	renice rmt showcfg update vipw vmtune

# C programs that live in the current directory and need explicit make lines.
#
NSTD=	usclk_conf

# Kernel profiling support programs, not part of the binary product.
#
KPRO=	prfdc prfld prfpr prfsnap prfstat

# C programs that user the rpcsvc library
#
RPCSVC=	mount shutdown umount

# Mirroring layered product
#
# Mirroring programs that need explicit make lines
MIRROR_NSTD= mirror
# Mirroring programs  that don't
MIRROR_STD= mrinval unmirror
# Mirror programs all together
MIRROR= $(MIRROR_STD) $(MIRROR_NSTD)

all:&	$(SUBDIR) $(STD) $(NSTD) $(RPCSVC) mirroring

$(SUBDIR): FRC
	cd $@@ && make $(MFLAGS) $(MRULES)

FRC:

mirroring:&	$(MIRROR)

mirror_header_install	:
	if [ ! -f $(MIRROR_HDRS)/usr/include/sys/mirror.h ] ; then \
		cd ../sys/common/mirror ; \
		install -c -m 666 mirror.h $(MIRROR_HDRS)/usr/include/sys ; \
	fi

kpro:&	$(KPRO)

$(STD) $(KPRO) x:
	$(CC) $(CFLAGS) -o $@@ $@@.c

$(MIRROR_STD): mirror_header_install
	$(CC) $(MIRROR_INCLUDE) $(CFLAGS) -o $@@ $@@.c

$(RPCSVC):
	$(CC) $(CFLAGS) -o $@@ $@@.c -lrpcsvc

install:	mirror_install
	for i in $(SUBDIR); do \
		(cd $$i; make $(MFLAGS) $(MRULES) install); done
	for i in $(SCRIPT); do \
		(install -c $$i.sh $(DESTDIR)/etc/$$i); done
	install -s $(STD) $(NSTD) $(RPCSVC) $(DESTDIR)/etc
	chmod 700 $(DESTDIR)/etc/init
	chmod 700 $(DESTDIR)/etc/update
	chmod 700 $(DESTDIR)/etc/getty
	chmod 700 $(DESTDIR)/etc/cron
	rm -f $(DESTDIR)/etc/offline
	ln $(DESTDIR)/etc/online $(DESTDIR)/etc/offline
	for i in dmesg pstat showcfg; do \
		chgrp kmem $(DESTDIR)/etc/$$i; \
		chmod g+s $(DESTDIR)/etc/$$i; \
	done

mirror_install: $(MIRROR)
	install -s $(MIRROR) $(MIRROR_DESTDIR)/etc
	chgrp operator $(MIRROR_DESTDIR)/etc/mirror
	chmod g+s $(MIRROR_DESTDIR)/etc/mirror

clean:
	rm -f a.out core *.s *.o
	for i in $(SUBDIR); do \
		(cd $$i; make $(MFLAGS) $(MRULES) clean); done
	rm -f $(STD) $(NSTD) $(KPRO) $(RPCSVC) $(MIRROR)

depend:
	cat </dev/null >x.c
	for i in $(STD) $(NSTD) $(RPCSVC) $(MIRROR); do \
		(echo $$i: $$i.c >>makedep; \
		/bin/grep '^#[ 	]*include' x.c $$i.c | sed \
			-e '/\.\.\/h/d' \
			-e 's,<\(.*\)>,"/usr/include/\1",' \
			-e 's/:[^"]*"\([^"]*\)".*/: \1/' \
			-e 's/\.c//' >>makedep); done
	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
	echo '$$r makedep' >>eddep
	echo 'w' >>eddep
	cp Makefile Makefile.bak
	ed - Makefile < eddep
	rm eddep makedep x.c
	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
	echo '# see make depend above' >> Makefile

arp		: arp.c
addbad		: addbad.c
bad144		: bad144.c
badsect		: badsect.c
bootflags	: bootflags.c
chown		: chown.c
clri		: clri.c
comsat		: comsat.c
cron		: cron.c
diskpart	: diskpart.c
fsirand		: fsirand.c
gettable	: gettable.c
halt		: halt.c
ifconfig	: ifconfig.c
init		: init.c
newfs		: newfs.c
mkfs		: mkfs.c
mknod		: mknod.c
mount		: mount.c
mrinval		: mrinval.c
on		: on.c
online		: online.c
dmesg		: dmesg.c
pmap		: pmap.c
portmap		: portmap.c
pstat		: pstat.c
reboot		: reboot.c
renice		: renice.c
rmt		: rmt.c
showcfg		: showcfg.c
shutdown	: shutdown.c
umount		: umount.c
unmirror	: unmirror.c
update		: update.c
vipw		: vipw.c
vmtune		: vmtune.c

# Files listed in $(NSTD) have explicit make lines given below.
usclk_conf	: usclk_conf.c
	$(CC) -o usclk_conf  $(CFLAGS) usclk_conf.c -lseq

mirror		: mirror.c mirror_header_install
	$(CC) -o mirror $(MIRROR_INCLUDE) $(CFLAGS) mirror.c -Z98304 -lpps

# DO NOT DELETE THIS LINE -- make depend uses it

# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above
@


1.1
log
@Initial revision
@
text
@d12 1
a12 1
# $Header: Makefile 2.23 89/09/29 $
d94 1
a94 1
		chgrp daemon $(DESTDIR)/etc/$$i; \
d100 1
a100 1
	chgrp daemon $(MIRROR_DESTDIR)/etc/mirror
@
