Merge illumos-gate
[unleashed.git] / usr / src / cmd / ttymon / Makefile
blob26e58979939bc6be047c57c4dcece545f2a09a9f
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.
26 # Copyright (c) 2018, Joyent, Inc.
28 PROG= stty ttymon ttyadm sttydefs
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 TTYMONOBJ= ttymon.o tmglobal.o tmhandler.o tmpmtab.o tmttydefs.o \
35 tmparse.o tmsig.o tmsac.o tmchild.o tmautobaud.o tmterm.o \
36 tmutmp.o tmpeek.o tmlog.o tmlock.o tmutil.o tmexpress.o \
37 sttytable.o sttyparse.o ulockf.o
39 TTYADMOBJ= ttyadm.o tmutil.o admutil.o
41 STTYDEFSOBJ= sttydefs.o admutil.o tmttydefs.o tmparse.o sttytable.o \
42 sttyparse.o
44 OBJS= $(STTYOBJ) $(TTYMONOBJ) $(TTYADMOBJ) $(STTYDEFSOBJ)
45 STTYSRC= stty.c sttytable.c sttyparse.c
46 TTYMONSRC= $(TTYMONOBJ:%.o=%.c)
47 TTYADMSRC= $(TTYADMOBJ:%.o=%.c)
48 STTYDEFSSRC= $(STTYDEFSOBJ:%.o=%.c)
49 SRCS= $(STTYSRC) $(TTYMONSRC) $(TTYADMSRC) $(STTYDEFSSRC)
51 .PARALLEL: $(OBJS) $(PROG)
53 include ../Makefile.cmd
55 # If machine name and /etc/issue file need to be printed
56 # before the service prompt is printed, then: CPPFLAGS += -DSYS_NAME
57 # If debug is needed, then: CPPFLAGS += -DDEBUG
58 # fix for 1111333 - turn on SYS_NAME so /etc/issue will be read if it exists
59 CPPFLAGS += -DSYS_NAME
60 CPPFLAGS += -DXPG4
61 ttymon := LDLIBS += -lsec -ldevinfo
63 # Only stty can be built with -DEUC. ttymon will dump core unless further
64 # changes are made to it.
65 $(STTYOBJ) := CPPFLAGS += -DEUC
67 CERRWARN += -Wno-parentheses
68 CERRWARN += -Wno-unused-variable
69 CERRWARN += -Wno-uninitialized
70 CERRWARN += -Wno-extra
72 # not linted
73 SMATCH=off
76 # Message catalog
78 POFILES= $(STTYOBJ:sttyobjs/%.o=%.po)
79 POFILE= ttymon.po
82 LIBSAFD= $(ROOTLIB)/saf
83 DIRS= $(LIBSAFD)
84 LIBSAF= ttymon
85 USRSBINF= sttydefs ttyadm
86 BINF= stty
87 ROOTLIBF= $(LIBSAF:%=$(LIBSAFD)/%)
88 ROOTUSRSBINF= $(USRSBINF:%=$(ROOTUSRSBIN)/%)
89 ROOTBINF= $(BINF:%=$(ROOTBIN)/%)
90 $(ROOTLIBF) := FILEMODE = 0555
91 $(ROOTUSRSBINF) := FILEMODE = 0755
93 $(LIBSAFD)/% : %
94 $(INS.file)
96 .KEEP_STATE:
98 all: $(PROG)
100 stty: sttyobjs $(STTYOBJ)
101 $(LINK.c) $(STTYOBJ) -o $@ $(LDLIBS)
102 $(POST_PROCESS)
104 sttyobjs/%.o: %.c
105 $(COMPILE.c) -o $@ $<
107 sttyobjs:
108 -@mkdir -p $@
110 ttymon: $(TTYMONOBJ)
111 $(LINK.c) $(TTYMONOBJ) -o $@ $(LDLIBS) -lpam
112 $(POST_PROCESS)
114 ttyadm: $(TTYADMOBJ)
115 $(LINK.c) $(TTYADMOBJ) -o $@ $(LDLIBS)
116 $(POST_PROCESS)
118 sttydefs: $(STTYDEFSOBJ)
119 $(LINK.c) $(STTYDEFSOBJ) -o $@ $(LDLIBS)
120 $(POST_PROCESS)
122 install: all $(DIRS) $(ROOTLIBF) $(ROOTUSRSBINF) $(ROOTBINF)
124 $(POFILE): $(POFILES)
125 $(RM) $@
126 cat $(POFILES) > $@
128 $(DIRS):
129 $(INS.dir)
131 clean:
132 $(RM) $(OBJS)
134 include ../Makefile.targ