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 5d1c1c8ceScf46844# Common Development and Distribution License (the "License"). 6d1c1c8ceScf46844# 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# 2124da5b34Srie 227c478bd9Sstevel@tonic-gate# 2324fe0b3bSjmcp# Copyright 2009 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate# Use is subject to license terms. 257c478bd9Sstevel@tonic-gate# 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gatePROG= stty ttymon ttyadm sttydefs 287c478bd9Sstevel@tonic-gateXPG4PROG= stty 297c478bd9Sstevel@tonic-gate 307c478bd9Sstevel@tonic-gate# the 'stty' objects have to be made in a separate directory 317c478bd9Sstevel@tonic-gate# since only they are built with the -DEUC flag (see below). 327c478bd9Sstevel@tonic-gateSTTYOBJ= sttyobjs/stty.o sttyobjs/sttytable.o sttyobjs/sttyparse.o 337c478bd9Sstevel@tonic-gate 347c478bd9Sstevel@tonic-gateXPG4STTYOBJ= sttyobjs.xpg4/stty.o sttyobjs.xpg4/sttytable.o \ 357c478bd9Sstevel@tonic-gate sttyobjs.xpg4/sttyparse.o 367c478bd9Sstevel@tonic-gate 377c478bd9Sstevel@tonic-gateTTYMONOBJ= ttymon.o tmglobal.o tmhandler.o tmpmtab.o tmttydefs.o \ 387c478bd9Sstevel@tonic-gate tmparse.o tmsig.o tmsac.o tmchild.o tmautobaud.o tmterm.o \ 397c478bd9Sstevel@tonic-gate tmutmp.o tmpeek.o tmlog.o tmlock.o tmutil.o tmexpress.o \ 407c478bd9Sstevel@tonic-gate sttytable.o sttyparse.o ulockf.o 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gateTTYADMOBJ= ttyadm.o tmutil.o admutil.o 437c478bd9Sstevel@tonic-gate 447c478bd9Sstevel@tonic-gateSTTYDEFSOBJ= sttydefs.o admutil.o tmttydefs.o tmparse.o sttytable.o \ 457c478bd9Sstevel@tonic-gate sttyparse.o 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gateOBJS= $(STTYOBJ) $(XPG4STTYOBJ) $(TTYMONOBJ) $(TTYADMOBJ) $(STTYDEFSOBJ) 487c478bd9Sstevel@tonic-gateSTTYSRC= stty.c sttytable.c sttyparse.c 497c478bd9Sstevel@tonic-gateTTYMONSRC= $(TTYMONOBJ:%.o=%.c) 507c478bd9Sstevel@tonic-gateTTYADMSRC= $(TTYADMOBJ:%.o=%.c) 517c478bd9Sstevel@tonic-gateSTTYDEFSSRC= $(STTYDEFSOBJ:%.o=%.c) 527c478bd9Sstevel@tonic-gateSRCS= $(STTYSRC) $(TTYMONSRC) $(TTYADMSRC) $(STTYDEFSSRC) 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate.PARALLEL: $(OBJS) $(PROG) 557c478bd9Sstevel@tonic-gate 567c478bd9Sstevel@tonic-gateinclude ../Makefile.cmd 577c478bd9Sstevel@tonic-gate 587c478bd9Sstevel@tonic-gate# If machine name and /etc/issue file need to be printed 597c478bd9Sstevel@tonic-gate# before the service prompt is printed, then: CPPFLAGS += -DSYS_NAME 607c478bd9Sstevel@tonic-gate# If debug is needed, then: CPPFLAGS += -DDEBUG 617c478bd9Sstevel@tonic-gate# fix for 1111333 - turn on SYS_NAME so /etc/issue will be read if it exists 627c478bd9Sstevel@tonic-gateCPPFLAGS += -DSYS_NAME 637c478bd9Sstevel@tonic-gate$(XPG4):= CPPFLAGS += -DXPG4 647c478bd9Sstevel@tonic-gatesttydefs := LDLIBS += -lnsl 65fa9e4066Sahrensttymon := LDLIBS += -lnsl -lsec -ldevinfo 667c478bd9Sstevel@tonic-gate 677c478bd9Sstevel@tonic-gate# Only stty can be built with -DEUC. ttymon will dump core unless further 687c478bd9Sstevel@tonic-gate# changes are made to it. 697c478bd9Sstevel@tonic-gate$(STTYOBJ) := CPPFLAGS += -DEUC 707c478bd9Sstevel@tonic-gate$(XPG4STTYOBJ) := CPPFLAGS += -DEUC 717c478bd9Sstevel@tonic-gate 727c478bd9Sstevel@tonic-gateLINTFLAGS = -b -x 737c478bd9Sstevel@tonic-gateCFLAGS += $(CCVERBOSE) 7424da5b34SrieLDFLAGS += $(MAPFILE.NGB:%=-M%) 757c478bd9Sstevel@tonic-gate 76*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-parentheses 77*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-unused-variable 78*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-uninitialized 79*7014882cSRichard LoweCERRWARN += -_gcc=-Wno-extra 80*7014882cSRichard Lowe 817c478bd9Sstevel@tonic-gate# 827c478bd9Sstevel@tonic-gate# Message catalog 837c478bd9Sstevel@tonic-gate# 847c478bd9Sstevel@tonic-gatePOFILES= $(STTYOBJ:sttyobjs/%.o=%.po) 857c478bd9Sstevel@tonic-gatePOFILE= ttymon.po 867c478bd9Sstevel@tonic-gate 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gateLIBSAFD= $(ROOTLIB)/saf 897c478bd9Sstevel@tonic-gateDIRS= $(LIBSAFD) 907c478bd9Sstevel@tonic-gateLIBSAF= ttymon 917c478bd9Sstevel@tonic-gateUSRSBINF= sttydefs ttyadm 927c478bd9Sstevel@tonic-gateBINF= stty 937c478bd9Sstevel@tonic-gateROOTLIBF= $(LIBSAF:%=$(LIBSAFD)/%) 947c478bd9Sstevel@tonic-gateROOTUSRSBINF= $(USRSBINF:%=$(ROOTUSRSBIN)/%) 957c478bd9Sstevel@tonic-gateROOTBINF= $(BINF:%=$(ROOTBIN)/%) 967c478bd9Sstevel@tonic-gate$(ROOTLIBF) := FILEMODE = 0555 977c478bd9Sstevel@tonic-gate$(ROOTUSRSBINF) := FILEMODE = 0755 987c478bd9Sstevel@tonic-gate 997c478bd9Sstevel@tonic-gate$(LIBSAFD)/% : % 1007c478bd9Sstevel@tonic-gate $(INS.file) 1017c478bd9Sstevel@tonic-gate 102d1c1c8ceScf46844# /usr/xpg6/bin/stty is a symlink to /usr/bin/stty 103d1c1c8ceScf46844ROOTXPG6SYMLINK= $(ROOTXPG6BIN)/stty 1047c478bd9Sstevel@tonic-gate.KEEP_STATE: 1057c478bd9Sstevel@tonic-gate 1067c478bd9Sstevel@tonic-gateall: $(PROG) $(XPG4) 1077c478bd9Sstevel@tonic-gate 10824da5b34Sriestty: sttyobjs $(STTYOBJ) $(MAPFILE.NGB) 1097c478bd9Sstevel@tonic-gate $(LINK.c) $(STTYOBJ) -o $@ $(LDLIBS) 1107c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1117c478bd9Sstevel@tonic-gate 11224da5b34Sriestty.xpg4: $(XPG4STTYOBJ) $(MAPFILE.NGB) 1137c478bd9Sstevel@tonic-gate $(LINK.c) $(XPG4STTYOBJ) -o $@ $(LDLIBS) 1147c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1157c478bd9Sstevel@tonic-gate 1167c478bd9Sstevel@tonic-gate$(XPG4STTYOBJ): sttyobjs.xpg4 1177c478bd9Sstevel@tonic-gate 1187c478bd9Sstevel@tonic-gatesttyobjs/%.o: %.c 1197c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 1207c478bd9Sstevel@tonic-gate 1217c478bd9Sstevel@tonic-gatesttyobjs.xpg4/%.o: %.c 1227c478bd9Sstevel@tonic-gate $(COMPILE.c) -o $@ $< 1237c478bd9Sstevel@tonic-gate 1247c478bd9Sstevel@tonic-gatesttyobjs: 1257c478bd9Sstevel@tonic-gate -@mkdir -p $@ 1267c478bd9Sstevel@tonic-gate 1277c478bd9Sstevel@tonic-gatesttyobjs.xpg4: 1287c478bd9Sstevel@tonic-gate -@mkdir -p $@ 1297c478bd9Sstevel@tonic-gate 13024da5b34Sriettymon: $(TTYMONOBJ) $(MAPFILE.NGB) 1317c478bd9Sstevel@tonic-gate $(LINK.c) $(TTYMONOBJ) -o $@ $(LDLIBS) -lpam 1327c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1337c478bd9Sstevel@tonic-gate 13424da5b34Sriettyadm: $(TTYADMOBJ) $(MAPFILE.NGB) 1357c478bd9Sstevel@tonic-gate $(LINK.c) $(TTYADMOBJ) -o $@ $(LDLIBS) 1367c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1377c478bd9Sstevel@tonic-gate 13824da5b34Sriesttydefs: $(STTYDEFSOBJ) $(MAPFILE.NGB) 1397c478bd9Sstevel@tonic-gate $(LINK.c) $(STTYDEFSOBJ) -o $@ $(LDLIBS) 1407c478bd9Sstevel@tonic-gate $(POST_PROCESS) 1417c478bd9Sstevel@tonic-gate 1427c478bd9Sstevel@tonic-gateinstall: all $(DIRS) $(ROOTLIBF) $(ROOTUSRSBINF) $(ROOTBINF) \ 143d1c1c8ceScf46844 $(ROOTXPG4PROG) $(ROOTXPG6SYMLINK) 1447c478bd9Sstevel@tonic-gate -$(RM) $(ROOTETC)/getty 1457c478bd9Sstevel@tonic-gate -$(SYMLINK) ../usr/lib/saf/ttymon $(ROOTETC)/getty 1467c478bd9Sstevel@tonic-gate 147d1c1c8ceScf46844$(ROOTXPG6SYMLINK): $(ROOTBINF) 1487c478bd9Sstevel@tonic-gate -$(RM) $@ 149d1c1c8ceScf46844 -$(SYMLINK) ../../bin/$(BINF) $@ 1507c478bd9Sstevel@tonic-gate 1517c478bd9Sstevel@tonic-gate$(POFILE): $(POFILES) 1527c478bd9Sstevel@tonic-gate $(RM) $@ 1537c478bd9Sstevel@tonic-gate cat $(POFILES) > $@ 1547c478bd9Sstevel@tonic-gate 1557c478bd9Sstevel@tonic-gate$(DIRS): 1567c478bd9Sstevel@tonic-gate $(INS.dir) 1577c478bd9Sstevel@tonic-gate 1587c478bd9Sstevel@tonic-gateclean: 1597c478bd9Sstevel@tonic-gate $(RM) $(OBJS) 1607c478bd9Sstevel@tonic-gate 1617c478bd9Sstevel@tonic-gatelint: 1627c478bd9Sstevel@tonic-gate $(LINT.c) $(STTYSRC) 1637c478bd9Sstevel@tonic-gate $(LINT.c) $(TTYMONSRC) 1647c478bd9Sstevel@tonic-gate $(LINT.c) $(TTYADMSRC) 1657c478bd9Sstevel@tonic-gate $(LINT.c) $(STTYDEFSSRC) 1667c478bd9Sstevel@tonic-gate 1677c478bd9Sstevel@tonic-gateinclude ../Makefile.targ 168