xref: /onnv-gate/usr/src/cmd/ttymon/Makefile (revision 10207:87c40ea3fc4b)
10Sstevel@tonic-gate#
20Sstevel@tonic-gate# CDDL HEADER START
30Sstevel@tonic-gate#
40Sstevel@tonic-gate# The contents of this file are subject to the terms of the
53261Scf46844# Common Development and Distribution License (the "License").
63261Scf46844# You may not use this file except in compliance with the License.
70Sstevel@tonic-gate#
80Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate# See the License for the specific language governing permissions
110Sstevel@tonic-gate# and limitations under the License.
120Sstevel@tonic-gate#
130Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate#
190Sstevel@tonic-gate# CDDL HEADER END
200Sstevel@tonic-gate#
214271Srie
220Sstevel@tonic-gate#
23*10207SJames.McPherson@Sun.COM# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate# Use is subject to license terms.
250Sstevel@tonic-gate#
260Sstevel@tonic-gate
270Sstevel@tonic-gatePROG= stty ttymon ttyadm sttydefs
280Sstevel@tonic-gateXPG4PROG= stty
290Sstevel@tonic-gate
300Sstevel@tonic-gate# the 'stty' objects have to be made in a separate directory
310Sstevel@tonic-gate# since only they are built with the -DEUC flag (see below).
320Sstevel@tonic-gateSTTYOBJ=	sttyobjs/stty.o sttyobjs/sttytable.o sttyobjs/sttyparse.o
330Sstevel@tonic-gate
340Sstevel@tonic-gateXPG4STTYOBJ=	sttyobjs.xpg4/stty.o sttyobjs.xpg4/sttytable.o \
350Sstevel@tonic-gate		sttyobjs.xpg4/sttyparse.o
360Sstevel@tonic-gate
370Sstevel@tonic-gateTTYMONOBJ=	ttymon.o tmglobal.o tmhandler.o tmpmtab.o tmttydefs.o \
380Sstevel@tonic-gate		tmparse.o tmsig.o tmsac.o tmchild.o tmautobaud.o tmterm.o \
390Sstevel@tonic-gate		tmutmp.o tmpeek.o tmlog.o tmlock.o tmutil.o tmexpress.o \
400Sstevel@tonic-gate		sttytable.o sttyparse.o ulockf.o
410Sstevel@tonic-gate
420Sstevel@tonic-gateTTYADMOBJ=	ttyadm.o tmutil.o admutil.o
430Sstevel@tonic-gate
440Sstevel@tonic-gateSTTYDEFSOBJ=	sttydefs.o admutil.o tmttydefs.o tmparse.o sttytable.o \
450Sstevel@tonic-gate		sttyparse.o
460Sstevel@tonic-gate
470Sstevel@tonic-gateOBJS= $(STTYOBJ) $(XPG4STTYOBJ) $(TTYMONOBJ) $(TTYADMOBJ) $(STTYDEFSOBJ)
480Sstevel@tonic-gateSTTYSRC= stty.c sttytable.c sttyparse.c
490Sstevel@tonic-gateTTYMONSRC= $(TTYMONOBJ:%.o=%.c)
500Sstevel@tonic-gateTTYADMSRC= $(TTYADMOBJ:%.o=%.c)
510Sstevel@tonic-gateSTTYDEFSSRC= $(STTYDEFSOBJ:%.o=%.c)
520Sstevel@tonic-gateSRCS= $(STTYSRC) $(TTYMONSRC) $(TTYADMSRC) $(STTYDEFSSRC)
530Sstevel@tonic-gate
540Sstevel@tonic-gate.PARALLEL:	$(OBJS) $(PROG)
550Sstevel@tonic-gate
560Sstevel@tonic-gateinclude ../Makefile.cmd
570Sstevel@tonic-gate
580Sstevel@tonic-gate# If machine name and /etc/issue file need to be printed
590Sstevel@tonic-gate# before the service prompt is printed, then:  CPPFLAGS += -DSYS_NAME
600Sstevel@tonic-gate# If debug is needed, then:  CPPFLAGS += -DDEBUG
610Sstevel@tonic-gate# fix for 1111333 - turn on SYS_NAME so /etc/issue will be read if it exists
620Sstevel@tonic-gateCPPFLAGS += -DSYS_NAME
630Sstevel@tonic-gate$(XPG4):= CPPFLAGS += -DXPG4
640Sstevel@tonic-gatesttydefs := LDLIBS += -lnsl
65789Sahrensttymon := LDLIBS += -lnsl -lsec -ldevinfo
660Sstevel@tonic-gate
670Sstevel@tonic-gate# Only stty can be built with -DEUC.  ttymon will dump core unless further
680Sstevel@tonic-gate# changes are made to it.
690Sstevel@tonic-gate$(STTYOBJ) := CPPFLAGS += -DEUC
700Sstevel@tonic-gate$(XPG4STTYOBJ) := CPPFLAGS += -DEUC
710Sstevel@tonic-gate
720Sstevel@tonic-gateLINTFLAGS = -b -x
730Sstevel@tonic-gateCFLAGS += $(CCVERBOSE)
744271SrieLDFLAGS += $(MAPFILE.NGB:%=-M%)
750Sstevel@tonic-gate
760Sstevel@tonic-gate#
770Sstevel@tonic-gate# Message catalog
780Sstevel@tonic-gate#
790Sstevel@tonic-gatePOFILES= $(STTYOBJ:sttyobjs/%.o=%.po)
800Sstevel@tonic-gatePOFILE= ttymon.po
810Sstevel@tonic-gate
820Sstevel@tonic-gate
830Sstevel@tonic-gateLIBSAFD= $(ROOTLIB)/saf
840Sstevel@tonic-gateDIRS= $(LIBSAFD)
850Sstevel@tonic-gateLIBSAF= ttymon
860Sstevel@tonic-gateUSRSBINF= sttydefs ttyadm
870Sstevel@tonic-gateBINF= stty
880Sstevel@tonic-gateROOTLIBF= $(LIBSAF:%=$(LIBSAFD)/%)
890Sstevel@tonic-gateROOTUSRSBINF= $(USRSBINF:%=$(ROOTUSRSBIN)/%)
900Sstevel@tonic-gateROOTBINF= $(BINF:%=$(ROOTBIN)/%)
910Sstevel@tonic-gate$(ROOTLIBF) :=			FILEMODE =	0555
920Sstevel@tonic-gate$(ROOTUSRSBINF) :=		FILEMODE =	0755
930Sstevel@tonic-gate
940Sstevel@tonic-gate$(LIBSAFD)/% : %
950Sstevel@tonic-gate	$(INS.file)
960Sstevel@tonic-gate
973261Scf46844# /usr/xpg6/bin/stty is a symlink to /usr/bin/stty
983261Scf46844ROOTXPG6SYMLINK= $(ROOTXPG6BIN)/stty
990Sstevel@tonic-gate.KEEP_STATE:
1000Sstevel@tonic-gate
1010Sstevel@tonic-gateall: $(PROG) $(XPG4)
1020Sstevel@tonic-gate
1034271Sriestty:	sttyobjs $(STTYOBJ) $(MAPFILE.NGB)
1040Sstevel@tonic-gate	$(LINK.c) $(STTYOBJ) -o $@ $(LDLIBS)
1050Sstevel@tonic-gate	$(POST_PROCESS)
1060Sstevel@tonic-gate
1074271Sriestty.xpg4: $(XPG4STTYOBJ) $(MAPFILE.NGB)
1080Sstevel@tonic-gate	$(LINK.c) $(XPG4STTYOBJ) -o $@ $(LDLIBS)
1090Sstevel@tonic-gate	$(POST_PROCESS)
1100Sstevel@tonic-gate
1110Sstevel@tonic-gate$(XPG4STTYOBJ): sttyobjs.xpg4
1120Sstevel@tonic-gate
1130Sstevel@tonic-gatesttyobjs/%.o:	%.c
1140Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1150Sstevel@tonic-gate
1160Sstevel@tonic-gatesttyobjs.xpg4/%.o:	%.c
1170Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
1180Sstevel@tonic-gate
1190Sstevel@tonic-gatesttyobjs:
1200Sstevel@tonic-gate	-@mkdir -p $@
1210Sstevel@tonic-gate
1220Sstevel@tonic-gatesttyobjs.xpg4:
1230Sstevel@tonic-gate	-@mkdir -p $@
1240Sstevel@tonic-gate
1254271Sriettymon:	$(TTYMONOBJ) $(MAPFILE.NGB)
1260Sstevel@tonic-gate	$(LINK.c) $(TTYMONOBJ) -o $@ $(LDLIBS) -lpam
1270Sstevel@tonic-gate	$(POST_PROCESS)
1280Sstevel@tonic-gate
1294271Sriettyadm:	$(TTYADMOBJ) $(MAPFILE.NGB)
1300Sstevel@tonic-gate	$(LINK.c) $(TTYADMOBJ) -o $@ $(LDLIBS)
1310Sstevel@tonic-gate	$(POST_PROCESS)
1320Sstevel@tonic-gate
1334271Sriesttydefs: $(STTYDEFSOBJ) $(MAPFILE.NGB)
1340Sstevel@tonic-gate	$(LINK.c) $(STTYDEFSOBJ) -o $@ $(LDLIBS)
1350Sstevel@tonic-gate	$(POST_PROCESS)
1360Sstevel@tonic-gate
1370Sstevel@tonic-gateinstall: all $(DIRS) $(ROOTLIBF) $(ROOTUSRSBINF) $(ROOTBINF) \
1383261Scf46844	$(ROOTXPG4PROG) $(ROOTXPG6SYMLINK)
1390Sstevel@tonic-gate	-$(RM) $(ROOTETC)/getty
1400Sstevel@tonic-gate	-$(SYMLINK) ../usr/lib/saf/ttymon $(ROOTETC)/getty
1410Sstevel@tonic-gate
1423261Scf46844$(ROOTXPG6SYMLINK): $(ROOTBINF)
1430Sstevel@tonic-gate	-$(RM) $@
1443261Scf46844	-$(SYMLINK) ../../bin/$(BINF) $@
1450Sstevel@tonic-gate
1460Sstevel@tonic-gate$(POFILE):      $(POFILES)
1470Sstevel@tonic-gate	$(RM) $@
1480Sstevel@tonic-gate	cat $(POFILES)  > $@
1490Sstevel@tonic-gate
1500Sstevel@tonic-gate$(DIRS):
1510Sstevel@tonic-gate	$(INS.dir)
1520Sstevel@tonic-gate
1530Sstevel@tonic-gateclean:
1540Sstevel@tonic-gate	$(RM) $(OBJS)
1550Sstevel@tonic-gate
1560Sstevel@tonic-gatelint:
1570Sstevel@tonic-gate	$(LINT.c) $(STTYSRC)
1580Sstevel@tonic-gate	$(LINT.c) $(TTYMONSRC)
1590Sstevel@tonic-gate	$(LINT.c) $(TTYADMSRC)
1600Sstevel@tonic-gate	$(LINT.c) $(STTYDEFSSRC)
1610Sstevel@tonic-gate
1620Sstevel@tonic-gateinclude ../Makefile.targ
163