8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / cmd / ttymon / Makefile
blob854e5e8d958d3b0546157297ed90921aa33d41e2
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
23 # Copyright 2009 Sun Microsystems, Inc. All rights reserved.
24 # Use is subject to license terms.
27 PROG= stty ttymon ttyadm sttydefs
28 XPG4PROG= stty
30 # the 'stty' objects have to be made in a separate directory
31 # since only they are built with the -DEUC flag (see below).
32 STTYOBJ= sttyobjs/stty.o sttyobjs/sttytable.o sttyobjs/sttyparse.o
34 XPG4STTYOBJ= sttyobjs.xpg4/stty.o sttyobjs.xpg4/sttytable.o \
35 sttyobjs.xpg4/sttyparse.o
37 TTYMONOBJ= ttymon.o tmglobal.o tmhandler.o tmpmtab.o tmttydefs.o \
38 tmparse.o tmsig.o tmsac.o tmchild.o tmautobaud.o tmterm.o \
39 tmutmp.o tmpeek.o tmlog.o tmlock.o tmutil.o tmexpress.o \
40 sttytable.o sttyparse.o ulockf.o
42 TTYADMOBJ= ttyadm.o tmutil.o admutil.o
44 STTYDEFSOBJ= sttydefs.o admutil.o tmttydefs.o tmparse.o sttytable.o \
45 sttyparse.o
47 OBJS= $(STTYOBJ) $(XPG4STTYOBJ) $(TTYMONOBJ) $(TTYADMOBJ) $(STTYDEFSOBJ)
48 STTYSRC= stty.c sttytable.c sttyparse.c
49 TTYMONSRC= $(TTYMONOBJ:%.o=%.c)
50 TTYADMSRC= $(TTYADMOBJ:%.o=%.c)
51 STTYDEFSSRC= $(STTYDEFSOBJ:%.o=%.c)
52 SRCS= $(STTYSRC) $(TTYMONSRC) $(TTYADMSRC) $(STTYDEFSSRC)
54 .PARALLEL: $(OBJS) $(PROG)
56 include ../Makefile.cmd
58 # If machine name and /etc/issue file need to be printed
59 # before the service prompt is printed, then: CPPFLAGS += -DSYS_NAME
60 # If debug is needed, then: CPPFLAGS += -DDEBUG
61 # fix for 1111333 - turn on SYS_NAME so /etc/issue will be read if it exists
62 CPPFLAGS += -DSYS_NAME
63 $(XPG4):= CPPFLAGS += -DXPG4
64 sttydefs := LDLIBS += -lnsl
65 ttymon := LDLIBS += -lnsl -lsec -ldevinfo
67 # Only stty can be built with -DEUC. ttymon will dump core unless further
68 # changes are made to it.
69 $(STTYOBJ) := CPPFLAGS += -DEUC
70 $(XPG4STTYOBJ) := CPPFLAGS += -DEUC
72 LINTFLAGS = -b -x
73 CFLAGS += $(CCVERBOSE)
74 LDFLAGS += $(MAPFILE.NGB:%=-M%)
76 CERRWARN += -_gcc=-Wno-parentheses
77 CERRWARN += -_gcc=-Wno-unused-variable
78 CERRWARN += -_gcc=-Wno-uninitialized
79 CERRWARN += -_gcc=-Wno-extra
82 # Message catalog
84 POFILES= $(STTYOBJ:sttyobjs/%.o=%.po)
85 POFILE= ttymon.po
88 LIBSAFD= $(ROOTLIB)/saf
89 DIRS= $(LIBSAFD)
90 LIBSAF= ttymon
91 USRSBINF= sttydefs ttyadm
92 BINF= stty
93 ROOTLIBF= $(LIBSAF:%=$(LIBSAFD)/%)
94 ROOTUSRSBINF= $(USRSBINF:%=$(ROOTUSRSBIN)/%)
95 ROOTBINF= $(BINF:%=$(ROOTBIN)/%)
96 $(ROOTLIBF) := FILEMODE = 0555
97 $(ROOTUSRSBINF) := FILEMODE = 0755
99 $(LIBSAFD)/% : %
100 $(INS.file)
102 # /usr/xpg6/bin/stty is a symlink to /usr/bin/stty
103 ROOTXPG6SYMLINK= $(ROOTXPG6BIN)/stty
104 .KEEP_STATE:
106 all: $(PROG) $(XPG4)
108 stty: sttyobjs $(STTYOBJ) $(MAPFILE.NGB)
109 $(LINK.c) $(STTYOBJ) -o $@ $(LDLIBS)
110 $(POST_PROCESS)
112 stty.xpg4: $(XPG4STTYOBJ) $(MAPFILE.NGB)
113 $(LINK.c) $(XPG4STTYOBJ) -o $@ $(LDLIBS)
114 $(POST_PROCESS)
116 $(XPG4STTYOBJ): sttyobjs.xpg4
118 sttyobjs/%.o: %.c
119 $(COMPILE.c) -o $@ $<
121 sttyobjs.xpg4/%.o: %.c
122 $(COMPILE.c) -o $@ $<
124 sttyobjs:
125 -@mkdir -p $@
127 sttyobjs.xpg4:
128 -@mkdir -p $@
130 ttymon: $(TTYMONOBJ) $(MAPFILE.NGB)
131 $(LINK.c) $(TTYMONOBJ) -o $@ $(LDLIBS) -lpam
132 $(POST_PROCESS)
134 ttyadm: $(TTYADMOBJ) $(MAPFILE.NGB)
135 $(LINK.c) $(TTYADMOBJ) -o $@ $(LDLIBS)
136 $(POST_PROCESS)
138 sttydefs: $(STTYDEFSOBJ) $(MAPFILE.NGB)
139 $(LINK.c) $(STTYDEFSOBJ) -o $@ $(LDLIBS)
140 $(POST_PROCESS)
142 install: all $(DIRS) $(ROOTLIBF) $(ROOTUSRSBINF) $(ROOTBINF) \
143 $(ROOTXPG4PROG) $(ROOTXPG6SYMLINK)
144 -$(RM) $(ROOTETC)/getty
145 -$(SYMLINK) ../usr/lib/saf/ttymon $(ROOTETC)/getty
147 $(ROOTXPG6SYMLINK): $(ROOTBINF)
148 -$(RM) $@
149 -$(SYMLINK) ../../bin/$(BINF) $@
151 $(POFILE): $(POFILES)
152 $(RM) $@
153 cat $(POFILES) > $@
155 $(DIRS):
156 $(INS.dir)
158 clean:
159 $(RM) $(OBJS)
161 lint:
162 $(LINT.c) $(STTYSRC)
163 $(LINT.c) $(TTYMONSRC)
164 $(LINT.c) $(TTYADMSRC)
165 $(LINT.c) $(STTYDEFSSRC)
167 include ../Makefile.targ