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