xref: /illumos-gate/usr/src/cmd/listen/Makefile (revision 85f4cb87)
1#
2# CDDL HEADER START
3#
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.
7#
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.
12#
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]
18#
19# CDDL HEADER END
20#
21
22#
23# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
24# Use is subject to license terms.
25#
26# Copyright (c) 2018, Joyent, Inc.
27
28PROG= listen nlps_server
29
30DBGOBJ	= doprnt.o
31DBGSRC	= doprnt.c
32
33LSOBJS  =	listen.o lslog.o lsdbf.o lsdata.o nstoa.o nlsaddr.o
34
35NLPSOBJS =	nlps_serv.o lsdbf.o lssmb.o nstoa.o lslog.o lsdata.o
36
37OBJS= $(LSOBJS) $(NLPSOBJS)
38LSSRC= $(LSOBJS:%.o=%.c)
39NLPSSRC= $(NLPSOBJS:%.o=%.c)
40SRCS= $(LSSRC) $(NLPSSRC)
41
42include ../Makefile.cmd
43
44LIBSAFD = $(ROOTLIB)/saf
45NETD = $(ROOT)/usr/net
46NETNLSD = $(NETD)/nls
47
48# Don"t re-install /usr/lib/saf/ and /usr/net, Targetdirs installs them
49#DIRS= $(LIBSAFD) $(NETD) $(NETNLSD)
50DIRS=  $(NETNLSD)
51ROOTSAFPROG= $(PROG:%=$(LIBSAFD)/%)
52
53# If machine name and /etc/issue file need to be printed
54# before the service prompt is printed, then:  CPPFLAGS += -DSYS_NAME
55# If debug is needed, then:  CPPFLAGS += -DDEBUG
56
57LDLIBS += -lnsl
58LDFLAGS += $(MAPFILE.NGB:%=-Wl,-M%)
59FILEMODE= 0755
60
61CERRWARN += -_gcc=-Wno-implicit-function-declaration
62CERRWARN += -_gcc=-Wno-unused-variable
63CERRWARN += -_gcc=-Wno-empty-body
64CERRWARN += -_gcc=-Wno-parentheses
65CERRWARN += $(CNOWARN_UNINIT)
66
67# not linted
68SMATCH=off
69
70$(LIBSAFD)/% : %
71	$(INS.file)
72
73.KEEP_STATE:
74
75all: $(PROG)
76
77listen:	$(LSOBJS) $(MAPFILE.NGB)
78	$(LINK.c) $(LSOBJS) -o $@ $(LDLIBS)
79	$(POST_PROCESS)
80
81nlps_server:	$(NLPSOBJS) $(MAPFILE.NGB)
82	$(LINK.c) $(NLPSOBJS) -o $@ $(LDLIBS)
83	$(POST_PROCESS)
84
85install: all $(DIRS) $(ROOTSAFPROG)
86	$(RM) $(ROOT)/usr/net/nls/listen
87	-$(SYMLINK) ../../lib/saf/listen $(ROOT)/usr/net/nls/listen
88	$(RM) $(ROOT)/usr/net/nls/nlps_server
89	-$(SYMLINK) ../../lib/saf/nlps_server $(ROOT)/usr/net/nls/nlps_server
90
91$(DIRS):
92	$(INS.dir)
93
94clean:
95	$(RM) $(OBJS)
96
97include ../Makefile.targ
98