Makefile revision 24da5b34f49324ed742a340010ed5bd3d4e06625
03831d35f7499c87d51205817c93e9a8d42c4baestevel#
03831d35f7499c87d51205817c93e9a8d42c4baestevel# CDDL HEADER START
03831d35f7499c87d51205817c93e9a8d42c4baestevel#
03831d35f7499c87d51205817c93e9a8d42c4baestevel# The contents of this file are subject to the terms of the
03831d35f7499c87d51205817c93e9a8d42c4baestevel# Common Development and Distribution License (the "License").
03831d35f7499c87d51205817c93e9a8d42c4baestevel# You may not use this file except in compliance with the License.
03831d35f7499c87d51205817c93e9a8d42c4baestevel#
03831d35f7499c87d51205817c93e9a8d42c4baestevel# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
03831d35f7499c87d51205817c93e9a8d42c4baestevel# or http://www.opensolaris.org/os/licensing.
03831d35f7499c87d51205817c93e9a8d42c4baestevel# See the License for the specific language governing permissions
03831d35f7499c87d51205817c93e9a8d42c4baestevel# and limitations under the License.
03831d35f7499c87d51205817c93e9a8d42c4baestevel#
03831d35f7499c87d51205817c93e9a8d42c4baestevel# When distributing Covered Code, include this CDDL HEADER in each
03831d35f7499c87d51205817c93e9a8d42c4baestevel# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
03831d35f7499c87d51205817c93e9a8d42c4baestevel# If applicable, add the following below this CDDL HEADER, with the
03831d35f7499c87d51205817c93e9a8d42c4baestevel# fields enclosed by brackets "[]" replaced with your own identifying
03831d35f7499c87d51205817c93e9a8d42c4baestevel# information: Portions Copyright [yyyy] [name of copyright owner]
03831d35f7499c87d51205817c93e9a8d42c4baestevel#
03831d35f7499c87d51205817c93e9a8d42c4baestevel# CDDL HEADER END
03831d35f7499c87d51205817c93e9a8d42c4baestevel#
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel#
24fe0b3bf671e123467ce1df0b67cadd3614c8e4jmcp# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
03831d35f7499c87d51205817c93e9a8d42c4baestevel# Use is subject to license terms.
03831d35f7499c87d51205817c93e9a8d42c4baestevel#
03831d35f7499c87d51205817c93e9a8d42c4baestevel# ident "%Z%%M% %I% %E% SMI"
03831d35f7499c87d51205817c93e9a8d42c4baestevel#
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelPROG = safe_finger tcpd tcpdchk tcpdmatch try-from
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelinclude ../Makefile.cmd
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelERROFF = -erroff=E_FUNC_HAS_NO_RETURN_STMT \
03831d35f7499c87d51205817c93e9a8d42c4baestevel -erroff=E_IMPLICIT_DECL_FUNC_RETURN_INT \
03831d35f7499c87d51205817c93e9a8d42c4baestevel -_gcc=-Wno-return-type -_gcc=-Wno-implicit
03831d35f7499c87d51205817c93e9a8d42c4baestevelCFLAGS += $(CCVERBOSE) $(ERROFF)
03831d35f7499c87d51205817c93e9a8d42c4baestevelCPPFLAGS += $(ACCESS) $(PARANOID) $(NETGROUP) $(TLI) \
03831d35f7499c87d51205817c93e9a8d42c4baestevel $(UMASK) $(STYLE) $(TABLES) $(KILL_OPT) $(BUGS) \
03831d35f7499c87d51205817c93e9a8d42c4baestevel -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
03831d35f7499c87d51205817c93e9a8d42c4baestevel -DFACILITY=$(FACILITY) -DSEVERITY=$(SEVERITY) \
03831d35f7499c87d51205817c93e9a8d42c4baestevel -DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" \
03831d35f7499c87d51205817c93e9a8d42c4baestevel -I$(ROOTSFWINCLUDE) -I../../lib/libwrap
03831d35f7499c87d51205817c93e9a8d42c4baesteveltcpd tcpdmatch try-from := \
03831d35f7499c87d51205817c93e9a8d42c4baestevel LDLIBS += -R$(SFW_ROOT)/lib -L$(ROOTSFWLIB) -lwrap
03831d35f7499c87d51205817c93e9a8d42c4baesteveltcpdchk := \
03831d35f7499c87d51205817c93e9a8d42c4baestevel LDLIBS += -R$(SFW_ROOT)/lib -L$(ROOTSFWLIB) -lwrap -lnsl
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel# Various components must export interfaces, but also contain name-space
03831d35f7499c87d51205817c93e9a8d42c4baestevel# clashes with system libraries.
03831d35f7499c87d51205817c93e9a8d42c4baestevelMAPFILE.INT.D = $(MAPFILE.NGB) mapfile-intf-tcpdchk
03831d35f7499c87d51205817c93e9a8d42c4baestevelMAPFILE.INT.M = $(MAPFILE.NGB) mapfile-intf-tcpdmatch
03831d35f7499c87d51205817c93e9a8d42c4baestevelMAPFILE.INT.F = $(MAPFILE.NGB) mapfile-intf-tryfrom
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baesteveltcpdchk := LDFLAGS +=$(MAPFILE.INT.D:%=-M%)
03831d35f7499c87d51205817c93e9a8d42c4baesteveltcpdmatch := LDFLAGS +=$(MAPFILE.INT.M:%=-M%)
03831d35f7499c87d51205817c93e9a8d42c4baesteveltry-from := LDFLAGS +=$(MAPFILE.INT.F:%=-M%)
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel# SRCONLY files are not used for building but are included in the source code
03831d35f7499c87d51205817c93e9a8d42c4baestevel# package SUNWtcpdS for consistency and completeness with respect to the
03831d35f7499c87d51205817c93e9a8d42c4baestevel# public tcp_wrappers distribution.
03831d35f7499c87d51205817c93e9a8d42c4baestevelSRCONLY = BLURB Banners.Makefile CHANGES DISCLAIMER Makefile \
03831d35f7499c87d51205817c93e9a8d42c4baestevel Makefile.dist Makefile.org README README.IRIX README.NIS \
03831d35f7499c87d51205817c93e9a8d42c4baestevel README.ipv6 hosts_access.c.org misc.c.org miscd.c myvsyslog.c \
03831d35f7499c87d51205817c93e9a8d42c4baestevel ncr.c printf.ck ptx.c rfc931.c.org scaffold.c.org \
03831d35f7499c87d51205817c93e9a8d42c4baestevel socket.c.diff socket.c.org strcasecmp.c tags tcpd.h.org \
03831d35f7499c87d51205817c93e9a8d42c4baestevel tcpdchk.c.org tcpdmatch.c.org tli-sequent.c tli-sequent.h \
03831d35f7499c87d51205817c93e9a8d42c4baestevel tli.c.org update.c.org vfprintf.c
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelMANDIRS = man3 man4 man1m
03831d35f7499c87d51205817c93e9a8d42c4baestevelMANPAGES = man3/hosts_access.3 man3/libwrap.3 man4/hosts_access.4 \
03831d35f7499c87d51205817c93e9a8d42c4baestevel man4/hosts_options.4 man4/hosts.allow.4 man4/hosts.deny.4 \
03831d35f7499c87d51205817c93e9a8d42c4baestevel man1m/tcpd.1m man1m/tcpdchk.1m man1m/tcpdmatch.1m
03831d35f7499c87d51205817c93e9a8d42c4baestevelDISTFILES = environ.c fakelog.c hosts_access.3 hosts_access.4 \
03831d35f7499c87d51205817c93e9a8d42c4baestevel hosts_options.4 inetcf.c inetcf.h safe_finger.c scaffold.c \
03831d35f7499c87d51205817c93e9a8d42c4baestevel scaffold.h tcpd.1m tcpd.c tcpdchk.1m tcpdchk.c tcpdmatch.1m \
03831d35f7499c87d51205817c93e9a8d42c4baestevel tcpdmatch.c try-from.c README.sfw $(SRCONLY)
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelROOTSFWSRC = $(ROOTSFWSHSRC)/tcp_wrappers
03831d35f7499c87d51205817c93e9a8d42c4baestevelROOTSFWSBINPROG = $(PROG:%=$(ROOTSFWSBIN)/%)
03831d35f7499c87d51205817c93e9a8d42c4baestevelROOTSFWMANPAGES = $(MANPAGES:%=$(ROOTSFWMAN)/%)
03831d35f7499c87d51205817c93e9a8d42c4baestevelROOTSFWMANDIRS = $(MANDIRS:%=$(ROOTSFWMAN)/%)
03831d35f7499c87d51205817c93e9a8d42c4baestevelROOTSFWSRCFILES = $(DISTFILES:%=$(ROOTSFWSRC)/%)
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel.KEEP_STATE:
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelall: $(PROG) THIRDPARTYLICENSE
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelinstall: all $(ROOTSFWSBINPROG) $(ROOTSFWMANPAGES) $(ROOTSFWSRCFILES)
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelclean:
03831d35f7499c87d51205817c93e9a8d42c4baestevel $(RM) *.o
03831d35f7499c87d51205817c93e9a8d42c4baestevel $(RM) -r sunman
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevellint: lint_PROG
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel$(ROOTSFWSBINPROG): $(ROOTSFWSBIN)
03831d35f7499c87d51205817c93e9a8d42c4baestevel$(ROOTSFWSBIN): $(ROOTSFW)
03831d35f7499c87d51205817c93e9a8d42c4baestevel $(INS.dir)
03831d35f7499c87d51205817c93e9a8d42c4baestevel$(ROOTSFWSBIN)/% : %
03831d35f7499c87d51205817c93e9a8d42c4baestevel $(INS.file)
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel# These Solaris-specific man page aliases are installed verbatim.
03831d35f7499c87d51205817c93e9a8d42c4baestevelsunman/libwrap.3: libwrap.3
03831d35f7499c87d51205817c93e9a8d42c4baestevel mkdir -p sunman; cat libwrap.3 > $@
03831d35f7499c87d51205817c93e9a8d42c4baestevelsunman/hosts.allow.4: hosts.allow.4
03831d35f7499c87d51205817c93e9a8d42c4baestevel mkdir -p sunman; cat hosts.allow.4 > $@
24fe0b3bf671e123467ce1df0b67cadd3614c8e4jmcpsunman/hosts.deny.4: hosts.deny.4
03831d35f7499c87d51205817c93e9a8d42c4baestevel mkdir -p sunman; cat hosts.deny.4 > $@
03831d35f7499c87d51205817c93e9a8d42c4baestevel
24fe0b3bf671e123467ce1df0b67cadd3614c8e4jmcp# The rest of the man pages are in the form provided in the original
03831d35f7499c87d51205817c93e9a8d42c4baestevel# distribution, but get edited and renamed to follow Solaris man page
03831d35f7499c87d51205817c93e9a8d42c4baestevel# conventions. E.g. tcpd.8 gets installed as /usr/sfw/man/man1m/tcpd.1m.
24fe0b3bf671e123467ce1df0b67cadd3614c8e4jmcp# Create temporary copies in the sunman directory with modified names
03831d35f7499c87d51205817c93e9a8d42c4baestevel# and contents. The sed program man.sed contains the content edits.
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevelsunman/%.1m: %.8
03831d35f7499c87d51205817c93e9a8d42c4baestevel mkdir -p sunman; sed -f man.sed < $< > $@
03831d35f7499c87d51205817c93e9a8d42c4baestevelsunman/%.4: %.5
03831d35f7499c87d51205817c93e9a8d42c4baestevel mkdir -p sunman; sed -f man.sed < $< > $@
03831d35f7499c87d51205817c93e9a8d42c4baestevelsunman/%.3: %.3
03831d35f7499c87d51205817c93e9a8d42c4baestevel mkdir -p sunman; sed -f man.sed < $< > $@
03831d35f7499c87d51205817c93e9a8d42c4baestevel
03831d35f7499c87d51205817c93e9a8d42c4baestevel$(ROOTSFWMANPAGES) := FILEMODE = 0444
$(ROOTSFWMANPAGES): $(ROOTSFWMANDIRS) $(ROOTSFW)/man
$(ROOTSFWMANDIRS): $(ROOTSFWMAN)
$(INS.dir)
$(ROOTSFWMAN): $(ROOTSFW)/share
$(INS.dir)
$(ROOTSFW)/man: $(ROOTSFW)
$(RM) $@
$(SYMLINK) share/man $@ $(CHOWNLINK) $(CHGRPLINK)
$(ROOTSFWMAN)/man1m/% $(ROOTSFWMAN)/man3/% $(ROOTSFWMAN)/man4/%: sunman/%
$(INS.file)
$(ROOTSFWSRCFILES) := FILEMODE = 0444
$(ROOTSFWSRCFILES): $(ROOTSFWSRC)
$(ROOTSFWSRC): $(ROOTSFWSHSRC)
$(INS.dir)
$(ROOTSFWSHSRC): $(ROOTSFW)/share
$(INS.dir)
$(ROOTSFWSRC)/%: %.sfwsrc
$(INS.rename)
$(ROOTSFWSRC)/%: sunman/%
$(INS.file)
$(ROOTSFWSRC)/%: %
$(INS.file)
$(ROOTSFW)/share: $(ROOTSFW)
$(INS.dir)
$(ROOTSFW):
$(INS.dir)
TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
tcpdmatch: $(TCPDMATCH_OBJ) $(LIB) $(MAPFILE.INTF.M)
$(LINK.c) -o $@ $(TCPDMATCH_OBJ) $(LDLIBS)
$(POST_PROCESS)
try-from: try-from.o fakelog.o $(LIB) $(MAPFILE.INTF.F)
$(LINK.c) -o $@ try-from.o fakelog.o $(LDLIBS)
$(POST_PROCESS)
TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
tcpdchk: $(TCPDCHK_OBJ) $(LIB) $(MAPFILE.INTF.C)
$(LINK.c) -o $@ $(TCPDCHK_OBJ) $(LDLIBS)
$(POST_PROCESS)
THIRDPARTYLICENSE: DISCLAIMER
$(GREP) -v '\*\*\*\*' DISCLAIMER > $@
CLOBBERFILES += THIRDPARTYLICENSE
include ../Makefile.targ
# The rest of this file contains definitions more-or-less directly from the
# original Makefile of the tcp_wrappers distribution.
##############################
# System parameters appropriate for Solaris 9
REAL_DAEMON_DIR = /usr/sbin
TLI = -DTLI
NETGROUP = -DNETGROUP
##############################
# Start of the optional stuff.
###########################################
# Optional: Turning on language extensions
#
# Instead of the default access control language that is documented in
# the hosts_access.5 document, the wrappers can be configured to
# implement an extensible language documented in the hosts_options.5
# document. This language is implemented by the "options.c" source
# module, which also gives hints on how to add your own extensions.
# Uncomment the next definition to turn on the language extensions
# (examples: allow, deny, banners, twist and spawn).
#
STYLE = -DPROCESS_OPTIONS # Enable language extensions.
################################################################
# Optional: Changing the default disposition of logfile records
#
# By default, logfile entries are written to the same file as used for
# sendmail transaction logs. See your /etc/syslog.conf file for actual
# path names of logfiles. The tutorial section in the README file
# gives a brief introduction to the syslog daemon.
#
# Change the FACILITY definition below if you disagree with the default
# disposition. Some syslog versions (including Ultrix 4.x) do not provide
# this flexibility.
#
# If nothing shows up on your system, it may be that the syslog records
# are sent to a dedicated loghost. It may also be that no syslog daemon
# is running at all. The README file gives pointers to surrogate syslog
# implementations for systems that have no syslog library routines or
# no syslog daemons. When changing the syslog.conf file, remember that
# there must be TABs between fields.
#
# The LOG_XXX names below are taken from the /usr/include/syslog.h file.
FACILITY= LOG_MAIL # LOG_MAIL is what most sendmail daemons use
# The syslog priority at which successful connections are logged.
SEVERITY= LOG_INFO # LOG_INFO is normally not logged to the console
######################################################
# Optional: Changing the default file protection mask
#
# On many systems, network daemons and other system processes are started
# with a zero umask value, so that world-writable files may be produced.
# It is a good idea to edit your /etc/rc* files so that they begin with
# an explicit umask setting. On our site we use `umask 022' because it
# does not break anything yet gives adequate protection against tampering.
#
# The following macro specifies the default umask for processes run under
# control of the daemon wrappers. Comment it out only if you are certain
# that inetd and its children are started with a safe umask value.
UMASK = -DDAEMON_UMASK=022
#######################################
# Optional: Turning off access control
#
# By default, host access control is enabled. To disable host access
# control, comment out the following definition. Host access control
# can also be turned off at runtime by providing no or empty access
# control tables.
ACCESS = -DHOSTS_ACCESS
####################################################
# Optional: dealing with host name/address conflicts
#
# By default, the software tries to protect against hosts that claim to
# have someone elses host name. This is relevant for network services
# whose authentication depends on host names, such as rsh and rlogin.
#
# With paranoid mode on, connections will be rejected when the host name
# does not match the host address. Connections will also be rejected when
# the host name is available but cannot be verified.
#
# Comment out the following definition if you want more control over such
# requests. When paranoid mode is off and a host name double check fails,
# the client can be matched with the PARANOID access control pattern.
#
# Paranoid mode implies hostname lookup. In order to disable hostname
# lookups altogether, see the next section.
PARANOID= -DPARANOID
# The default username lookup timeout is 10 seconds. This may not be long
# enough for slow hosts or networks, but is enough to irritate PC users.
RFC931_TIMEOUT = 10
########################################################
# Optional: Changing the access control table pathnames
#
# The HOSTS_ALLOW and HOSTS_DENY macros define where the programs will
# look for access control information. Watch out for the quotes and
# backslashes when you make changes.
TABLES = -DHOSTS_DENY=\"/etc/hosts.deny\" -DHOSTS_ALLOW=\"/etc/hosts.allow\"
#############################################
# Optional: Turning on host ADDRESS checking
#
# Optionally, the software tries to protect against hosts that pretend to
# have someone elses host address. This is relevant for network services
# whose authentication depends on host names, such as rsh and rlogin,
# because the network address is used to look up the remote host name.
#
# The protection is to refuse TCP connections with IP source routing
# options.
#
# This feature cannot be used with SunOS 4.x because of a kernel bug in
# the implementation of the getsockopt() system call. Kernel panics have
# been observed for SunOS 4.1.[1-3]. Symptoms are "BAD TRAP" and "Data
# fault" while executing the tcp_ctloutput() kernel function.
#
# Reportedly, Sun patch 100804-03 or 101790 fixes this for SunOS 4.1.x.
#
# Uncomment the following macro definition if your getsockopt() is OK.
#
# -DKILL_IP_OPTIONS is not needed on modern UNIX systems that can stop
# source-routed traffic in the kernel. Examples: 4.4BSD derivatives,
# Solaris 2.x, and Linux. See your system documentation for details.
#
# KILL_OPT= -DKILL_IP_OPTIONS
## End configuration options
############################