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