xref: /illumos-gate/usr/src/cmd/ttymon/Makefile (revision 7c478bd9)
1*7c478bd9Sstevel@tonic-gate#
2*7c478bd9Sstevel@tonic-gate# CDDL HEADER START
3*7c478bd9Sstevel@tonic-gate#
4*7c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
5*7c478bd9Sstevel@tonic-gate# Common Development and Distribution License, Version 1.0 only
6*7c478bd9Sstevel@tonic-gate# (the "License").  You may not use this file except in compliance
7*7c478bd9Sstevel@tonic-gate# with the License.
8*7c478bd9Sstevel@tonic-gate#
9*7c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*7c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
11*7c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
12*7c478bd9Sstevel@tonic-gate# and limitations under the License.
13*7c478bd9Sstevel@tonic-gate#
14*7c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
15*7c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*7c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
17*7c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
18*7c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
19*7c478bd9Sstevel@tonic-gate#
20*7c478bd9Sstevel@tonic-gate# CDDL HEADER END
21*7c478bd9Sstevel@tonic-gate#
22*7c478bd9Sstevel@tonic-gate#
23*7c478bd9Sstevel@tonic-gate# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24*7c478bd9Sstevel@tonic-gate# Use is subject to license terms.
25*7c478bd9Sstevel@tonic-gate#
26*7c478bd9Sstevel@tonic-gate# ident	"%Z%%M%	%I%	%E% SMI"
27*7c478bd9Sstevel@tonic-gate#
28*7c478bd9Sstevel@tonic-gate
29*7c478bd9Sstevel@tonic-gatePROG= stty ttymon ttyadm sttydefs
30*7c478bd9Sstevel@tonic-gateXPG4PROG= stty
31*7c478bd9Sstevel@tonic-gate
32*7c478bd9Sstevel@tonic-gate# the 'stty' objects have to be made in a separate directory
33*7c478bd9Sstevel@tonic-gate# since only they are built with the -DEUC flag (see below).
34*7c478bd9Sstevel@tonic-gateSTTYOBJ=	sttyobjs/stty.o sttyobjs/sttytable.o sttyobjs/sttyparse.o
35*7c478bd9Sstevel@tonic-gate
36*7c478bd9Sstevel@tonic-gateXPG4STTYOBJ=	sttyobjs.xpg4/stty.o sttyobjs.xpg4/sttytable.o \
37*7c478bd9Sstevel@tonic-gate		sttyobjs.xpg4/sttyparse.o
38*7c478bd9Sstevel@tonic-gate
39*7c478bd9Sstevel@tonic-gateTTYMONOBJ=	ttymon.o tmglobal.o tmhandler.o tmpmtab.o tmttydefs.o \
40*7c478bd9Sstevel@tonic-gate		tmparse.o tmsig.o tmsac.o tmchild.o tmautobaud.o tmterm.o \
41*7c478bd9Sstevel@tonic-gate		tmutmp.o tmpeek.o tmlog.o tmlock.o tmutil.o tmexpress.o \
42*7c478bd9Sstevel@tonic-gate		sttytable.o sttyparse.o ulockf.o
43*7c478bd9Sstevel@tonic-gate
44*7c478bd9Sstevel@tonic-gateTTYADMOBJ=	ttyadm.o tmutil.o admutil.o
45*7c478bd9Sstevel@tonic-gate
46*7c478bd9Sstevel@tonic-gateSTTYDEFSOBJ=	sttydefs.o admutil.o tmttydefs.o tmparse.o sttytable.o \
47*7c478bd9Sstevel@tonic-gate		sttyparse.o
48*7c478bd9Sstevel@tonic-gate
49*7c478bd9Sstevel@tonic-gateOBJS= $(STTYOBJ) $(XPG4STTYOBJ) $(TTYMONOBJ) $(TTYADMOBJ) $(STTYDEFSOBJ)
50*7c478bd9Sstevel@tonic-gateSTTYSRC= stty.c sttytable.c sttyparse.c
51*7c478bd9Sstevel@tonic-gateTTYMONSRC= $(TTYMONOBJ:%.o=%.c)
52*7c478bd9Sstevel@tonic-gateTTYADMSRC= $(TTYADMOBJ:%.o=%.c)
53*7c478bd9Sstevel@tonic-gateSTTYDEFSSRC= $(STTYDEFSOBJ:%.o=%.c)
54*7c478bd9Sstevel@tonic-gateSRCS= $(STTYSRC) $(TTYMONSRC) $(TTYADMSRC) $(STTYDEFSSRC)
55*7c478bd9Sstevel@tonic-gate
56*7c478bd9Sstevel@tonic-gate.PARALLEL:	$(OBJS) $(PROG)
57*7c478bd9Sstevel@tonic-gate
58*7c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd
59*7c478bd9Sstevel@tonic-gate
60*7c478bd9Sstevel@tonic-gate# If machine name and /etc/issue file need to be printed
61*7c478bd9Sstevel@tonic-gate# before the service prompt is printed, then:  CPPFLAGS += -DSYS_NAME
62*7c478bd9Sstevel@tonic-gate# If debug is needed, then:  CPPFLAGS += -DDEBUG
63*7c478bd9Sstevel@tonic-gate# fix for 1111333 - turn on SYS_NAME so /etc/issue will be read if it exists
64*7c478bd9Sstevel@tonic-gateCPPFLAGS += -DSYS_NAME
65*7c478bd9Sstevel@tonic-gate$(XPG4):= CPPFLAGS += -DXPG4
66*7c478bd9Sstevel@tonic-gatesttydefs := LDLIBS += -lnsl
67*7c478bd9Sstevel@tonic-gatettymon := LDLIBS += -lnsl -ldevinfo
68*7c478bd9Sstevel@tonic-gate
69*7c478bd9Sstevel@tonic-gate# Only stty can be built with -DEUC.  ttymon will dump core unless further
70*7c478bd9Sstevel@tonic-gate# changes are made to it.
71*7c478bd9Sstevel@tonic-gate$(STTYOBJ) := CPPFLAGS += -DEUC
72*7c478bd9Sstevel@tonic-gate$(XPG4STTYOBJ) := CPPFLAGS += -DEUC
73*7c478bd9Sstevel@tonic-gate
74*7c478bd9Sstevel@tonic-gateLINTFLAGS = -b -x
75*7c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE)
76*7c478bd9Sstevel@tonic-gate
77*7c478bd9Sstevel@tonic-gate#
78*7c478bd9Sstevel@tonic-gate# Message catalog
79*7c478bd9Sstevel@tonic-gate#
80*7c478bd9Sstevel@tonic-gatePOFILES= $(STTYOBJ:sttyobjs/%.o=%.po)
81*7c478bd9Sstevel@tonic-gatePOFILE= ttymon.po
82*7c478bd9Sstevel@tonic-gate
83*7c478bd9Sstevel@tonic-gate
84*7c478bd9Sstevel@tonic-gateLIBSAFD= $(ROOTLIB)/saf
85*7c478bd9Sstevel@tonic-gateDIRS= $(LIBSAFD)
86*7c478bd9Sstevel@tonic-gateLIBSAF= ttymon
87*7c478bd9Sstevel@tonic-gateUSRSBINF= sttydefs ttyadm
88*7c478bd9Sstevel@tonic-gateBINF= stty
89*7c478bd9Sstevel@tonic-gateROOTLIBF= $(LIBSAF:%=$(LIBSAFD)/%)
90*7c478bd9Sstevel@tonic-gateROOTUSRSBINF= $(USRSBINF:%=$(ROOTUSRSBIN)/%)
91*7c478bd9Sstevel@tonic-gateROOTBINF= $(BINF:%=$(ROOTBIN)/%)
92*7c478bd9Sstevel@tonic-gate$(ROOTLIBF) :=			FILEMODE =	0555
93*7c478bd9Sstevel@tonic-gate$(ROOTUSRSBINF) :=		FILEMODE =	0755
94*7c478bd9Sstevel@tonic-gate$(ROOTUSRSBINF) $(ROOTLIBF) :=	OWNER =		root
95*7c478bd9Sstevel@tonic-gate$(ROOTUSRSBINF) $(ROOTLIBF) :=	GROUP =		sys
96*7c478bd9Sstevel@tonic-gate
97*7c478bd9Sstevel@tonic-gate$(LIBSAFD)/% : %
98*7c478bd9Sstevel@tonic-gate	$(INS.file)
99*7c478bd9Sstevel@tonic-gate
100*7c478bd9Sstevel@tonic-gate# /usr/xpg6/bin/stty is a hard link to /usr/bin/stty
101*7c478bd9Sstevel@tonic-gateROOTXPG6LINK= $(ROOTXPG6BIN)/stty
102*7c478bd9Sstevel@tonic-gate.KEEP_STATE:
103*7c478bd9Sstevel@tonic-gate
104*7c478bd9Sstevel@tonic-gateall: $(PROG) $(XPG4)
105*7c478bd9Sstevel@tonic-gate
106*7c478bd9Sstevel@tonic-gatestty:	sttyobjs $(STTYOBJ)
107*7c478bd9Sstevel@tonic-gate	$(LINK.c) $(STTYOBJ) -o $@ $(LDLIBS)
108*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
109*7c478bd9Sstevel@tonic-gate
110*7c478bd9Sstevel@tonic-gatestty.xpg4: $(XPG4STTYOBJ)
111*7c478bd9Sstevel@tonic-gate	$(LINK.c) $(XPG4STTYOBJ) -o $@ $(LDLIBS)
112*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
113*7c478bd9Sstevel@tonic-gate
114*7c478bd9Sstevel@tonic-gate$(XPG4STTYOBJ): sttyobjs.xpg4
115*7c478bd9Sstevel@tonic-gate
116*7c478bd9Sstevel@tonic-gatesttyobjs/%.o:	%.c
117*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
118*7c478bd9Sstevel@tonic-gate
119*7c478bd9Sstevel@tonic-gatesttyobjs.xpg4/%.o:	%.c
120*7c478bd9Sstevel@tonic-gate	$(COMPILE.c) -o $@ $<
121*7c478bd9Sstevel@tonic-gate
122*7c478bd9Sstevel@tonic-gatesttyobjs:
123*7c478bd9Sstevel@tonic-gate	-@mkdir -p $@
124*7c478bd9Sstevel@tonic-gate
125*7c478bd9Sstevel@tonic-gatesttyobjs.xpg4:
126*7c478bd9Sstevel@tonic-gate	-@mkdir -p $@
127*7c478bd9Sstevel@tonic-gate
128*7c478bd9Sstevel@tonic-gatettymon:	$(TTYMONOBJ)
129*7c478bd9Sstevel@tonic-gate	$(LINK.c) $(TTYMONOBJ) -o $@ $(LDLIBS) -lpam
130*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
131*7c478bd9Sstevel@tonic-gate
132*7c478bd9Sstevel@tonic-gatettyadm:	$(TTYADMOBJ)
133*7c478bd9Sstevel@tonic-gate	$(LINK.c) $(TTYADMOBJ) -o $@ $(LDLIBS)
134*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
135*7c478bd9Sstevel@tonic-gate
136*7c478bd9Sstevel@tonic-gatesttydefs: $(STTYDEFSOBJ)
137*7c478bd9Sstevel@tonic-gate	$(LINK.c) $(STTYDEFSOBJ) -o $@ $(LDLIBS)
138*7c478bd9Sstevel@tonic-gate	$(POST_PROCESS)
139*7c478bd9Sstevel@tonic-gate
140*7c478bd9Sstevel@tonic-gateinstall: all $(DIRS) $(ROOTLIBF) $(ROOTUSRSBINF) $(ROOTBINF) \
141*7c478bd9Sstevel@tonic-gate	$(ROOTXPG4PROG) $(ROOTXPG6LINK)
142*7c478bd9Sstevel@tonic-gate	-$(RM) $(ROOTETC)/getty
143*7c478bd9Sstevel@tonic-gate	-$(SYMLINK) ../usr/lib/saf/ttymon $(ROOTETC)/getty
144*7c478bd9Sstevel@tonic-gate
145*7c478bd9Sstevel@tonic-gate$(ROOTXPG6LINK): $(ROOTBINF)
146*7c478bd9Sstevel@tonic-gate	-$(RM) $@
147*7c478bd9Sstevel@tonic-gate	-$(LN) -f $(ROOTBINF) $@
148*7c478bd9Sstevel@tonic-gate
149*7c478bd9Sstevel@tonic-gate$(POFILE):      $(POFILES)
150*7c478bd9Sstevel@tonic-gate	$(RM) $@
151*7c478bd9Sstevel@tonic-gate	cat $(POFILES)  > $@
152*7c478bd9Sstevel@tonic-gate
153*7c478bd9Sstevel@tonic-gate$(DIRS):
154*7c478bd9Sstevel@tonic-gate	$(INS.dir)
155*7c478bd9Sstevel@tonic-gate
156*7c478bd9Sstevel@tonic-gateclean:
157*7c478bd9Sstevel@tonic-gate	$(RM) $(OBJS)
158*7c478bd9Sstevel@tonic-gate
159*7c478bd9Sstevel@tonic-gatelint:
160*7c478bd9Sstevel@tonic-gate	$(LINT.c) $(STTYSRC)
161*7c478bd9Sstevel@tonic-gate	$(LINT.c) $(TTYMONSRC)
162*7c478bd9Sstevel@tonic-gate	$(LINT.c) $(TTYADMSRC)
163*7c478bd9Sstevel@tonic-gate	$(LINT.c) $(STTYDEFSSRC)
164*7c478bd9Sstevel@tonic-gate
165*7c478bd9Sstevel@tonic-gateinclude ../Makefile.targ
166