xref: /illumos-gate/usr/src/cmd/bnu/Makefile (revision 02b17e23cf5bf66a5ea787e066ae3d1aa49bd856)
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# cmd/bnu/Makefile
25#
26
27MANIFEST =	uucp.xml
28
29include		../Makefile.cmd
30
31USERPROG1 =	uudecode uuencode
32USERPROG =	$(USERPROG1) uucp uuglist uuname uustat uux ct cu
33UUCPPROG1 =	bnuconvert uucheck uucleanup
34UUCPPROG =	$(UUCPPROG1) remote.unknown uusched uucico uuxqt
35SBINPROG =	in.uucpd
36
37PROG =		$(UUCPPROG) $(USERPROG) $(SBINPROG)
38
39LIBSHELLS =	Uutry uudemon.admin uudemon.cleanup uudemon.hour uudemon.poll
40BINSHELLS =	uulog uupick uuto
41SHELLS =	$(LIBSHELLS) $(BINSHELLS)
42CRONTAB =	uudemon.crontab
43
44#include	../../lib/Makefile.lib
45
46FILES =		Config Devconfig Devices Dialcodes	\
47		Dialers Grades Limits Permissions	\
48		Poll Sysfiles Systems
49
50CLEANFILES =	$(SRCS:%.c=%.o) common.o
51
52# This Makefile overrides the standard POFILES (*.cat)
53# so we have to augment clobber this ugly way.
54CLOBBERFILES +=	$(SRCS:%.c=%.po) common.po
55
56TXTFILES =	README $(FILES)	\
57		dkbreak.c dkdial.c dkerr.c dkminor.c dtnamer.c	\
58		Cvt Install SetUp Teardown dial.c dial.h getopt.c strpbrk.c
59
60ROOTMANIFESTDIR=	$(ROOTSVCNETWORK)
61
62POFILE =	bnu.po
63# step around name collisions
64POFILES =	$(PROG:%=%.cat)
65
66CPPFLAGS =	-I. $(SMALLFLAG) $(CPPFLAGS.master) # -DSMALL
67
68FILEMODE =	4511
69
70# if you change these directories, change them in uucp.h as well
71
72ROOTLIBUUCP =	$(ROOT)/usr/lib/uucp
73ROOTETCUUCP =	$(ROOT)/etc/uucp
74ROOTVAR =	$(ROOT)/var
75ROOTVARUUCP =	$(ROOTVAR)/uucp
76ROOTSPOOL =	$(ROOTVAR)/spool
77ROOTSPLOCKS =	$(ROOTSPOOL)/locks
78ROOTSPUUCP =	$(ROOTSPOOL)/uucp
79ROOTSPPUB =	$(ROOTSPOOL)/uucppublic
80
81DOTADMIN =	.Admin
82DOTCORRUPT =	.Corrupt
83DOTLOG =	.Log
84DOTOLD =	.Old
85DOTSEQ =	.Sequence
86DOTSTATUS =	.Status
87DOTWORKSPACE =	.Workspace
88DOTXQT =	.Xqtdir
89DOTDIRS =	$(DOTADMIN) $(DOTLOG) $(DOTOLD) $(DOTSEQ) $(DOTSTATUS)
90DOTSPDIRS =	$(DOTCORRUPT) $(DOTWORKSPACE) $(DOTXQT)
91
92DOTLOGCICO =	$(DOTLOG)/uucico
93DOTLOGUUCP =	$(DOTLOG)/uucp
94DOTLOGUUX =	$(DOTLOG)/uux
95DOTLOGUUXQT =	$(DOTLOG)/uuxqt
96DOTLOGDIRS =	$(DOTLOGCICO) $(DOTLOGUUCP) $(DOTLOGUUX) $(DOTLOGUUXQT)
97
98ROOTDOTDIRS =	$(DOTDIRS:%=$(ROOTVARUUCP)/%)
99ROOTDOTSPDIRS =	$(DOTSPDIRS:%=$(ROOTSPUUCP)/%)
100ROOTDOTLOGDIRS = $(DOTLOGDIRS:%=$(ROOTVARUUCP)/%)
101
102ROOTPROG =	$(USERPROG:%=$(ROOTBIN)/%)
103ROOTSPROG =	$(SBINPROG:%=$(ROOTUSRSBIN)/%)
104ROOTSHELLS =	$(BINSHELLS:%=$(ROOTBIN)/%)
105ROOTUUCPPROG =	$(UUCPPROG:%=$(ROOTLIBUUCP)/%)
106ROOTLIBSHELLS =	$(LIBSHELLS:%=$(ROOTLIBUUCP)/%)
107ROOTCRONTAB =	$(CRONTAB:%=$(ROOTLIBUUCP)/%)
108ROOTFILES =	$(FILES:%=$(ROOTETCUUCP)/%)
109
110ROOTDIRS =	$(ROOTLIBUUCP) $(ROOTETCUUCP) $(ROOTSPLOCKS)	\
111		$(ROOTDOTDIRS) $(ROOTDOTSPDIRS) $(ROOTDOTLOGDIRS)
112
113ROOTSYMDIRS =	$(DOTDIRS:%=$(ROOTSPUUCP)/%)
114SYMDEST =	../../uucp
115ROOTREMOTE =	$(ROOTETCUUCP)/remote.unknown
116REMOTESYMDEST =	../../usr/lib/uucp
117
118$(USERPROG1) := CPPFLAGS += -D_FILE_OFFSET_BITS=64
119
120# Mode is assigned in Targetdirs.  It shoudn't be re-assigned here
121$(USERPROG1:%=$(ROOTBIN)/%) :=		FILEMODE = 0555
122$(ROOTSHELLS) :=			FILEMODE = 0555
123$(ROOTLIBSHELLS) :=			FILEMODE = 0555
124$(UUCPPROG1:%=$(ROOTLIBUUCP)/%) :=	FILEMODE = 0510
125$(ROOTCRONTAB) :=			FILEMODE = 0444
126$(ROOTFILES) :=				FILEMODE = 0644
127$(ROOTETCUUCP)/Permissions :=		FILEMODE = 0600
128$(ROOTETCUUCP)/Systems :=		FILEMODE = 0600
129$(ROOTSPROG) :=				FILEMODE = 0555
130
131include		./Makefile.inc
132
133.KEEP_STATE:
134
135all:		$(TXTFILES) $(PROG) $(SHELLS)
136
137install:	$(ROOTDIRS) $(ROOTSYMDIRS) $(ROOTPROG)		\
138		$(ROOTUUCPPROG) $(ROOTLIBSHELLS) $(ROOTSHELLS)	\
139		$(ROOTFILES) $(ROOTSYMFILES) $(ROOTSPROG)	\
140		$(ROOTREMOTE) $(ROOTCRONTAB) $(ROOTMANIFEST)
141
142$(ROOTLIBUUCP)/% $(ROOTETCUUCP)/% $(ROOTUSRSBIN)/%: %
143		$(INS.file)
144
145$(PROG):	$$(POBJS)
146		$(LINK.c) $(POBJS) -o $@ $(LDLIBS) $(PLIBS)
147		$(POST_PROCESS)
148
149$(POFILE):	$(POFILES)
150		$(RM) $@; $(CAT) $(POFILES) > $@
151
152$(POFILES):	$$(POBJS:.o=.po)
153		$(RM) $@; $(CAT) $(POBJS:.o=.po) > $@
154
155$(ROOTDIRS):
156		$(INS.dir)
157
158$(ROOTSYMDIRS):
159		$(RM) $@; $(SYMLINK) $(SYMDEST)/$(@F) $@
160
161$(ROOTREMOTE):
162		$(RM) $@; $(SYMLINK) $(REMOTESYMDEST)/$(@F) $@
163
164check:		$(CHKMANIFEST)
165
166clean:
167		$(RM) $(CLEANFILES)
168
169lint:		lint_SRCS
170
171strip:
172		$(STRIP) $(PROG)
173
174# special rules for 'common', since it lives in chmod's directory
175
176common.o:	../chmod/common.c
177		$(COMPILE.c) -o $@ ../chmod/common.c
178
179common.po:	../chmod/common.c
180		$(COMPILE.cpp) ../chmod/common.c > common.c.i
181		$(XGETTEXT) $(XGETFLAGS) common.c.i ;\
182		$(RM)   $@ ;\
183		$(SED) "/^domain/d" < messages.po  > $@ ;\
184		$(RM) messages.po common.c.i
185
186include		../Makefile.targ
187