xref: /illumos-gate/usr/src/cmd/ttymon/Makefile (revision d1c1c8ce74e7df9e7e01def7fd379b5bfaa8789f)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*d1c1c8ceScf46844# Common Development and Distribution License (the "License").
6*d1c1c8ceScf46844# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
217c478bd9Sstevel@tonic-gate#
22*d1c1c8ceScf46844# Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
237c478bd9Sstevel@tonic-gate# Use is subject to license terms.
247c478bd9Sstevel@tonic-gate#
257c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
267c478bd9Sstevel@tonic-gate#
277c478bd9Sstevel@tonic-gate
287c478bd9Sstevel@tonic-gatePROG= stty ttymon ttyadm sttydefs
297c478bd9Sstevel@tonic-gateXPG4PROG= stty
307c478bd9Sstevel@tonic-gate
317c478bd9Sstevel@tonic-gate# the 'stty' objects have to be made in a separate directory
327c478bd9Sstevel@tonic-gate# since only they are built with the -DEUC flag (see below).
337c478bd9Sstevel@tonic-gateSTTYOBJ=	sttyobjs/stty.o sttyobjs/sttytable.o sttyobjs/sttyparse.o
347c478bd9Sstevel@tonic-gate
357c478bd9Sstevel@tonic-gateXPG4STTYOBJ=	sttyobjs.xpg4/stty.o sttyobjs.xpg4/sttytable.o \
367c478bd9Sstevel@tonic-gate		sttyobjs.xpg4/sttyparse.o
377c478bd9Sstevel@tonic-gate
387c478bd9Sstevel@tonic-gateTTYMONOBJ=	ttymon.o tmglobal.o tmhandler.o tmpmtab.o tmttydefs.o \
397c478bd9Sstevel@tonic-gate		tmparse.o tmsig.o tmsac.o tmchild.o tmautobaud.o tmterm.o \
407c478bd9Sstevel@tonic-gate		tmutmp.o tmpeek.o tmlog.o tmlock.o tmutil.o tmexpress.o \
417c478bd9Sstevel@tonic-gate		sttytable.o sttyparse.o ulockf.o
427c478bd9Sstevel@tonic-gate
437c478bd9Sstevel@tonic-gateTTYADMOBJ=	ttyadm.o tmutil.o admutil.o
447c478bd9Sstevel@tonic-gate
457c478bd9Sstevel@tonic-gateSTTYDEFSOBJ=	sttydefs.o admutil.o tmttydefs.o tmparse.o sttytable.o \
467c478bd9Sstevel@tonic-gate		sttyparse.o
477c478bd9Sstevel@tonic-gate
487c478bd9Sstevel@tonic-gateOBJS= $(STTYOBJ) $(XPG4STTYOBJ) $(TTYMONOBJ) $(TTYADMOBJ) $(STTYDEFSOBJ)
497c478bd9Sstevel@tonic-gateSTTYSRC= stty.c sttytable.c sttyparse.c
507c478bd9Sstevel@tonic-gateTTYMONSRC= $(TTYMONOBJ:%.o=%.c)
517c478bd9Sstevel@tonic-gateTTYADMSRC= $(TTYADMOBJ:%.o=%.c)
527c478bd9Sstevel@tonic-gateSTTYDEFSSRC= $(STTYDEFSOBJ:%.o=%.c)
537c478bd9Sstevel@tonic-gateSRCS= $(STTYSRC) $(TTYMONSRC) $(TTYADMSRC) $(STTYDEFSSRC)
547c478bd9Sstevel@tonic-gate
557c478bd9Sstevel@tonic-gate.PARALLEL:	$(OBJS) $(PROG)
567c478bd9Sstevel@tonic-gate
577c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
587c478bd9Sstevel@tonic-gate
597c478bd9Sstevel@tonic-gate# If machine name and /etc/issue file need to be printed
607c478bd9Sstevel@tonic-gate# before the service prompt is printed, then:  CPPFLAGS += -DSYS_NAME
617c478bd9Sstevel@tonic-gate# If debug is needed, then:  CPPFLAGS += -DDEBUG
627c478bd9Sstevel@tonic-gate# fix for 1111333 - turn on SYS_NAME so /etc/issue will be read if it exists
637c478bd9Sstevel@tonic-gateCPPFLAGS += -DSYS_NAME
647c478bd9Sstevel@tonic-gate$(XPG4):= CPPFLAGS += -DXPG4
657c478bd9Sstevel@tonic-gatesttydefs := LDLIBS += -lnsl
66fa9e4066Sahrensttymon := LDLIBS += -lnsl -lsec -ldevinfo
677c478bd9Sstevel@tonic-gate
687c478bd9Sstevel@tonic-gate# Only stty can be built with -DEUC.  ttymon will dump core unless further
697c478bd9Sstevel@tonic-gate# changes are made to it.
707c478bd9Sstevel@tonic-gate$(STTYOBJ) := CPPFLAGS += -DEUC
717c478bd9Sstevel@tonic-gate$(XPG4STTYOBJ) := CPPFLAGS += -DEUC
727c478bd9Sstevel@tonic-gate
737c478bd9Sstevel@tonic-gateLINTFLAGS = -b -x
747c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE)
757c478bd9Sstevel@tonic-gate
767c478bd9Sstevel@tonic-gate#
777c478bd9Sstevel@tonic-gate# Message catalog
787c478bd9Sstevel@tonic-gate#
797c478bd9Sstevel@tonic-gatePOFILES= $(STTYOBJ:sttyobjs/%.o=%.po)
807c478bd9Sstevel@tonic-gatePOFILE= ttymon.po
817c478bd9Sstevel@tonic-gate
827c478bd9Sstevel@tonic-gate
837c478bd9Sstevel@tonic-gateLIBSAFD= $(ROOTLIB)/saf
847c478bd9Sstevel@tonic-gateDIRS= $(LIBSAFD)
857c478bd9Sstevel@tonic-gateLIBSAF= ttymon
867c478bd9Sstevel@tonic-gateUSRSBINF= sttydefs ttyadm
877c478bd9Sstevel@tonic-gateBINF= stty
887c478bd9Sstevel@tonic-gateROOTLIBF= $(LIBSAF:%=$(LIBSAFD)/%)
897c478bd9Sstevel@tonic-gateROOTUSRSBINF= $(USRSBINF:%=$(ROOTUSRSBIN)/%)
907c478bd9Sstevel@tonic-gateROOTBINF= $(BINF:%=$(ROOTBIN)/%)
917c478bd9Sstevel@tonic-gate$(ROOTLIBF) :=			FILEMODE =	0555
927c478bd9Sstevel@tonic-gate$(ROOTUSRSBINF) :=		FILEMODE =	0755
937c478bd9Sstevel@tonic-gate$(ROOTUSRSBINF) $(ROOTLIBF) :=	OWNER =		root
947c478bd9Sstevel@tonic-gate$(ROOTUSRSBINF) $(ROOTLIBF) :=	GROUP =		sys
957c478bd9Sstevel@tonic-gate
967c478bd9Sstevel@tonic-gate$(LIBSAFD)/% : %
977c478bd9Sstevel@tonic-gate	$(INS.file)
987c478bd9Sstevel@tonic-gate
99*d1c1c8ceScf46844# /usr/xpg6/bin/stty is a symlink to /usr/bin/stty
100*d1c1c8ceScf46844ROOTXPG6SYMLINK= $(ROOTXPG6BIN)/stty
1017c478bd9Sstevel@tonic-gate.KEEP_STATE:
1027c478bd9Sstevel@tonic-gate
1037c478bd9Sstevel@tonic-gateall: $(PROG) $(XPG4)
1047c478bd9Sstevel@tonic-gate
1057c478bd9Sstevel@tonic-gatestty:	sttyobjs $(STTYOBJ)
1067c478bd9Sstevel@tonic-gate	$(LINK.c) $(STTYOBJ) -o $@ $(LDLIBS)
1077c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1087c478bd9Sstevel@tonic-gate
1097c478bd9Sstevel@tonic-gatestty.xpg4: $(XPG4STTYOBJ)
1107c478bd9Sstevel@tonic-gate	$(LINK.c) $(XPG4STTYOBJ) -o $@ $(LDLIBS)
1117c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1127c478bd9Sstevel@tonic-gate
1137c478bd9Sstevel@tonic-gate$(XPG4STTYOBJ): sttyobjs.xpg4
1147c478bd9Sstevel@tonic-gate
1157c478bd9Sstevel@tonic-gatesttyobjs/%.o:	%.c
1167c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1177c478bd9Sstevel@tonic-gate
1187c478bd9Sstevel@tonic-gatesttyobjs.xpg4/%.o:	%.c
1197c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1207c478bd9Sstevel@tonic-gate
1217c478bd9Sstevel@tonic-gatesttyobjs:
1227c478bd9Sstevel@tonic-gate	-@mkdir -p $@
1237c478bd9Sstevel@tonic-gate
1247c478bd9Sstevel@tonic-gatesttyobjs.xpg4:
1257c478bd9Sstevel@tonic-gate	-@mkdir -p $@
1267c478bd9Sstevel@tonic-gate
1277c478bd9Sstevel@tonic-gatettymon:	$(TTYMONOBJ)
1287c478bd9Sstevel@tonic-gate	$(LINK.c) $(TTYMONOBJ) -o $@ $(LDLIBS) -lpam
1297c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1307c478bd9Sstevel@tonic-gate
1317c478bd9Sstevel@tonic-gatettyadm:	$(TTYADMOBJ)
1327c478bd9Sstevel@tonic-gate	$(LINK.c) $(TTYADMOBJ) -o $@ $(LDLIBS)
1337c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1347c478bd9Sstevel@tonic-gate
1357c478bd9Sstevel@tonic-gatesttydefs: $(STTYDEFSOBJ)
1367c478bd9Sstevel@tonic-gate	$(LINK.c) $(STTYDEFSOBJ) -o $@ $(LDLIBS)
1377c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
1387c478bd9Sstevel@tonic-gate
1397c478bd9Sstevel@tonic-gateinstall: all $(DIRS) $(ROOTLIBF) $(ROOTUSRSBINF) $(ROOTBINF) \
140*d1c1c8ceScf46844	$(ROOTXPG4PROG) $(ROOTXPG6SYMLINK)
1417c478bd9Sstevel@tonic-gate	-$(RM) $(ROOTETC)/getty
1427c478bd9Sstevel@tonic-gate	-$(SYMLINK) ../usr/lib/saf/ttymon $(ROOTETC)/getty
1437c478bd9Sstevel@tonic-gate
144*d1c1c8ceScf46844$(ROOTXPG6SYMLINK): $(ROOTBINF)
1457c478bd9Sstevel@tonic-gate	-$(RM) $@
146*d1c1c8ceScf46844	-$(SYMLINK) ../../bin/$(BINF) $@
1477c478bd9Sstevel@tonic-gate
1487c478bd9Sstevel@tonic-gate$(POFILE):      $(POFILES)
1497c478bd9Sstevel@tonic-gate	$(RM) $@
1507c478bd9Sstevel@tonic-gate	cat $(POFILES)  > $@
1517c478bd9Sstevel@tonic-gate
1527c478bd9Sstevel@tonic-gate$(DIRS):
1537c478bd9Sstevel@tonic-gate	$(INS.dir)
1547c478bd9Sstevel@tonic-gate
1557c478bd9Sstevel@tonic-gateclean:
1567c478bd9Sstevel@tonic-gate	$(RM) $(OBJS)
1577c478bd9Sstevel@tonic-gate
1587c478bd9Sstevel@tonic-gatelint:
1597c478bd9Sstevel@tonic-gate	$(LINT.c) $(STTYSRC)
1607c478bd9Sstevel@tonic-gate	$(LINT.c) $(TTYMONSRC)
1617c478bd9Sstevel@tonic-gate	$(LINT.c) $(TTYADMSRC)
1627c478bd9Sstevel@tonic-gate	$(LINT.c) $(STTYDEFSSRC)
1637c478bd9Sstevel@tonic-gate
1647c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
165