Makefile revision 7014882c6a3672fd0e5d60200af8643ae53c5928
851N/A#
851N/A# CDDL HEADER START
851N/A#
851N/A# The contents of this file are subject to the terms of the
1088N/A# Common Development and Distribution License (the "License").
851N/A# You may not use this file except in compliance with the License.
851N/A#
919N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
919N/A# or http://www.opensolaris.org/os/licensing.
919N/A# See the License for the specific language governing permissions
919N/A# and limitations under the License.
919N/A#
919N/A# When distributing Covered Code, include this CDDL HEADER in each
919N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
919N/A# If applicable, add the following below this CDDL HEADER, with the
919N/A# fields enclosed by brackets "[]" replaced with your own identifying
919N/A# information: Portions Copyright [yyyy] [name of copyright owner]
919N/A#
919N/A# CDDL HEADER END
919N/A#
919N/A
919N/A#
919N/A# Copyright 2009 Sun Microsystems, Inc. All rights reserved.
919N/A# Use is subject to license terms.
851N/A#
851N/A
851N/APROG= stty ttymon ttyadm sttydefs
851N/AXPG4PROG= stty
851N/A
851N/A# the 'stty' objects have to be made in a separate directory
851N/A# since only they are built with the -DEUC flag (see below).
1054N/ASTTYOBJ= sttyobjs/stty.o sttyobjs/sttytable.o sttyobjs/sttyparse.o
851N/A
911N/AXPG4STTYOBJ= sttyobjs.xpg4/stty.o sttyobjs.xpg4/sttytable.o \
1054N/A sttyobjs.xpg4/sttyparse.o
1054N/A
911N/ATTYMONOBJ= ttymon.o tmglobal.o tmhandler.o tmpmtab.o tmttydefs.o \
851N/A tmparse.o tmsig.o tmsac.o tmchild.o tmautobaud.o tmterm.o \
851N/A tmutmp.o tmpeek.o tmlog.o tmlock.o tmutil.o tmexpress.o \
851N/A sttytable.o sttyparse.o ulockf.o
851N/A
851N/ATTYADMOBJ= ttyadm.o tmutil.o admutil.o
851N/A
1097N/ASTTYDEFSOBJ= sttydefs.o admutil.o tmttydefs.o tmparse.o sttytable.o \
851N/A sttyparse.o
851N/A
851N/AOBJS= $(STTYOBJ) $(XPG4STTYOBJ) $(TTYMONOBJ) $(TTYADMOBJ) $(STTYDEFSOBJ)
851N/ASTTYSRC= stty.c sttytable.c sttyparse.c
1088N/ATTYMONSRC= $(TTYMONOBJ:%.o=%.c)
1088N/ATTYADMSRC= $(TTYADMOBJ:%.o=%.c)
1088N/ASTTYDEFSSRC= $(STTYDEFSOBJ:%.o=%.c)
1088N/ASRCS= $(STTYSRC) $(TTYMONSRC) $(TTYADMSRC) $(STTYDEFSSRC)
1088N/A
851N/A.PARALLEL: $(OBJS) $(PROG)
1097N/A
1097N/Ainclude ../Makefile.cmd
1097N/A
1097N/A# If machine name and /etc/issue file need to be printed
1097N/A# before the service prompt is printed, then: CPPFLAGS += -DSYS_NAME
851N/A# If debug is needed, then: CPPFLAGS += -DDEBUG
851N/A# fix for 1111333 - turn on SYS_NAME so /etc/issue will be read if it exists
1088N/ACPPFLAGS += -DSYS_NAME
1088N/A$(XPG4):= CPPFLAGS += -DXPG4
1088N/Asttydefs := LDLIBS += -lnsl
1088N/Attymon := LDLIBS += -lnsl -lsec -ldevinfo
1088N/A
1088N/A# Only stty can be built with -DEUC. ttymon will dump core unless further
1088N/A# changes are made to it.
1088N/A$(STTYOBJ) := CPPFLAGS += -DEUC
$(XPG4STTYOBJ) := CPPFLAGS += -DEUC
LINTFLAGS = -b -x
CFLAGS += $(CCVERBOSE)
LDFLAGS += $(MAPFILE.NGB:%=-M%)
CERRWARN += -_gcc=-Wno-parentheses
CERRWARN += -_gcc=-Wno-unused-variable
CERRWARN += -_gcc=-Wno-uninitialized
CERRWARN += -_gcc=-Wno-extra
#
# Message catalog
#
POFILES= $(STTYOBJ:sttyobjs/%.o=%.po)
POFILE= ttymon.po
LIBSAFD= $(ROOTLIB)/saf
DIRS= $(LIBSAFD)
LIBSAF= ttymon
USRSBINF= sttydefs ttyadm
BINF= stty
ROOTLIBF= $(LIBSAF:%=$(LIBSAFD)/%)
ROOTUSRSBINF= $(USRSBINF:%=$(ROOTUSRSBIN)/%)
ROOTBINF= $(BINF:%=$(ROOTBIN)/%)
$(ROOTLIBF) := FILEMODE = 0555
$(ROOTUSRSBINF) := FILEMODE = 0755
$(LIBSAFD)/% : %
$(INS.file)
# /usr/xpg6/bin/stty is a symlink to /usr/bin/stty
ROOTXPG6SYMLINK= $(ROOTXPG6BIN)/stty
.KEEP_STATE:
all: $(PROG) $(XPG4)
stty: sttyobjs $(STTYOBJ) $(MAPFILE.NGB)
$(LINK.c) $(STTYOBJ) -o $@ $(LDLIBS)
$(POST_PROCESS)
stty.xpg4: $(XPG4STTYOBJ) $(MAPFILE.NGB)
$(LINK.c) $(XPG4STTYOBJ) -o $@ $(LDLIBS)
$(POST_PROCESS)
$(XPG4STTYOBJ): sttyobjs.xpg4
sttyobjs/%.o: %.c
$(COMPILE.c) -o $@ $<
sttyobjs.xpg4/%.o: %.c
$(COMPILE.c) -o $@ $<
sttyobjs:
-@mkdir -p $@
sttyobjs.xpg4:
-@mkdir -p $@
ttymon: $(TTYMONOBJ) $(MAPFILE.NGB)
$(LINK.c) $(TTYMONOBJ) -o $@ $(LDLIBS) -lpam
$(POST_PROCESS)
ttyadm: $(TTYADMOBJ) $(MAPFILE.NGB)
$(LINK.c) $(TTYADMOBJ) -o $@ $(LDLIBS)
$(POST_PROCESS)
sttydefs: $(STTYDEFSOBJ) $(MAPFILE.NGB)
$(LINK.c) $(STTYDEFSOBJ) -o $@ $(LDLIBS)
$(POST_PROCESS)
install: all $(DIRS) $(ROOTLIBF) $(ROOTUSRSBINF) $(ROOTBINF) \
$(ROOTXPG4PROG) $(ROOTXPG6SYMLINK)
-$(RM) $(ROOTETC)/getty
-$(SYMLINK) ../usr/lib/saf/ttymon $(ROOTETC)/getty
$(ROOTXPG6SYMLINK): $(ROOTBINF)
-$(RM) $@
-$(SYMLINK) ../../bin/$(BINF) $@
$(POFILE): $(POFILES)
$(RM) $@
cat $(POFILES) > $@
$(DIRS):
$(INS.dir)
clean:
$(RM) $(OBJS)
lint:
$(LINT.c) $(STTYSRC)
$(LINT.c) $(TTYMONSRC)
$(LINT.c) $(TTYADMSRC)
$(LINT.c) $(STTYDEFSSRC)
include ../Makefile.targ