xref: /illumos-gate/usr/src/cmd/syslogd/Makefile.com (revision b3403853e80914bd0aade9b5b605da4878078173)
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# Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
22# Use is subject to license terms.
23#
24# Copyright (c) 2018, Joyent, Inc.
25
26PROG= 		syslogd
27ROTATESCRIPT=	newsyslog
28CONFIGFILE=	syslog.conf
29TXTS= 		syslog.conf
30PRODUCT=	$(PROG) $(ROTATESCRIPT)
31OBJS=		syslogd.o queue.o list.o conf.o
32SRCS=		$(OBJS:%.o=../%.c)
33LLOBJS=		$(OBJS:%.o=%.ll)
34
35include ../../Makefile.cmd
36
37$(PROG) lint 	:= LDLIBS += -lscf -lnsl
38CERRWARN	+= $(CNOWARN_UNINIT)
39
40# not linted
41SMATCH=off
42
43CPPFLAGS	+= -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT
44CFLAGS		+= -DNDEBUG
45
46# there's some extra utility code defined but not used.
47LINTFLAGS	+= -erroff=E_NAME_DEF_NOT_USED2
48
49VARSYSLOG=	syslog
50VARAUTHLOG=	authlog
51ROOTVARLOGD=	$(ROOT)/var/log
52
53ROOTETCCONFIG=	$(CONFIGFILE:%=$(ROOTETC)/%)
54ROOTLIBROTATE=	$(ROTATESCRIPT:%=$(ROOTLIB)/%)
55ROOTVARSYSLOG=	$(VARSYSLOG:%=$(ROOTVARLOGD)/%)
56ROOTVARAUTHLOG=	$(VARAUTHLOG:%=$(ROOTVARLOGD)/%)
57
58$(ROOTUSRSBINPROG) 	:= FILEMODE = 0555
59$(ROOTUSRLIBROTATE)	:= FILEMODE = 0555
60$(ROOTETCCONFIG)	:= FILEMODE = 0644
61$(ROOTVARSYSLOG)	:= FILEMODE = 0644
62$(ROOTVARAUTHLOG)	:= FILEMODE = 0600
63
64$(ROOTVARLOGD)/% : %
65	$(INS.file)
66
67$(ROOTETC)/%:	../%
68	$(INS.file)
69
70$(ROOTLIB)/%:	../%
71	$(INS.file)
72
73.KEEP_STATE:
74
75.SUFFIXES:	$(SUFFIXES) .ll
76
77.c.ll:
78	$(CC) $(CFLAGS) $(CPPFLAGS) -Zll -o $@ $<
79
80.PARALLEL: $(OBJS)
81
82
83$(VARSYSLOG) $(VARAUTHLOG):
84	$(ECHO) '\c' > $@
85
86%.o: ../%.c
87	$(COMPILE.c) $<
88
89%.ll: ../%.c
90	$(CC) $(CFLAGS) $(CPPFLAGS) -Zll -o $@ $<
91
92syslogd: $(OBJS)
93	$(LINK.c) -o $@ $(OBJS) $(LDLIBS)
94	$(POST_PROCESS)
95
96logfiles: $(ROOTVARSYSLOG) $(ROOTVARAUTHLOG)
97
98clean:
99	$(RM) $(OBJS) $(LLOBJS) $(VARSYSLOG) $(VARAUTHLOG)
100
101lint:	lint_SRCS
102
103lock_lint:	$(LLOBJS)
104
105include ../../Makefile.targ
106