xref: /titanic_41/usr/src/cmd/bnu/Makefile (revision bbb1277b6ec1b0daad4e3ed1a2b891d3e2ece2eb)
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
52TXTFILES =	README $(FILES)	\
53		dkbreak.c dkdial.c dkerr.c dkminor.c dtnamer.c	\
54		Cvt Install SetUp Teardown dial.c dial.h getopt.c strpbrk.c
55
56ROOTMANIFESTDIR=	$(ROOTSVCNETWORK)
57
58CAT =		cat
59POFILE =	bnu.po
60# step around name collisions
61POFILES =	$(PROG:%=%.cat)
62
63CPPFLAGS =	-I. $(SMALLFLAG) $(CPPFLAGS.master) # -DSMALL
64
65FILEMODE =	4511
66
67# if you change these directories, change them in uucp.h as well
68
69ROOTLIBUUCP =	$(ROOT)/usr/lib/uucp
70ROOTETCUUCP =	$(ROOT)/etc/uucp
71ROOTVAR =	$(ROOT)/var
72ROOTVARUUCP =	$(ROOTVAR)/uucp
73ROOTSPOOL =	$(ROOTVAR)/spool
74ROOTSPLOCKS =	$(ROOTSPOOL)/locks
75ROOTSPUUCP =	$(ROOTSPOOL)/uucp
76ROOTSPPUB =	$(ROOTSPOOL)/uucppublic
77
78DOTADMIN =	.Admin
79DOTCORRUPT =	.Corrupt
80DOTLOG =	.Log
81DOTOLD =	.Old
82DOTSEQ =	.Sequence
83DOTSTATUS =	.Status
84DOTWORKSPACE =	.Workspace
85DOTXQT =	.Xqtdir
86DOTDIRS =	$(DOTADMIN) $(DOTLOG) $(DOTOLD) $(DOTSEQ) $(DOTSTATUS)
87DOTSPDIRS =	$(DOTCORRUPT) $(DOTWORKSPACE) $(DOTXQT)
88
89DOTLOGCICO =	$(DOTLOG)/uucico
90DOTLOGUUCP =	$(DOTLOG)/uucp
91DOTLOGUUX =	$(DOTLOG)/uux
92DOTLOGUUXQT =	$(DOTLOG)/uuxqt
93DOTLOGDIRS =	$(DOTLOGCICO) $(DOTLOGUUCP) $(DOTLOGUUX) $(DOTLOGUUXQT)
94
95ROOTDOTDIRS =	$(DOTDIRS:%=$(ROOTVARUUCP)/%)
96ROOTDOTSPDIRS =	$(DOTSPDIRS:%=$(ROOTSPUUCP)/%)
97ROOTDOTLOGDIRS = $(DOTLOGDIRS:%=$(ROOTVARUUCP)/%)
98
99ROOTPROG =	$(USERPROG:%=$(ROOTBIN)/%)
100ROOTSPROG =	$(SBINPROG:%=$(ROOTUSRSBIN)/%)
101ROOTSHELLS =	$(BINSHELLS:%=$(ROOTBIN)/%)
102ROOTUUCPPROG =	$(UUCPPROG:%=$(ROOTLIBUUCP)/%)
103ROOTLIBSHELLS =	$(LIBSHELLS:%=$(ROOTLIBUUCP)/%)
104ROOTCRONTAB =	$(CRONTAB:%=$(ROOTLIBUUCP)/%)
105ROOTFILES =	$(FILES:%=$(ROOTETCUUCP)/%)
106
107ROOTDIRS =	$(ROOTLIBUUCP) $(ROOTETCUUCP) $(ROOTSPLOCKS)	\
108		$(ROOTDOTDIRS) $(ROOTDOTSPDIRS) $(ROOTDOTLOGDIRS)
109
110ROOTSYMDIRS =	$(DOTDIRS:%=$(ROOTSPUUCP)/%)
111SYMDEST =	../../uucp
112ROOTREMOTE =	$(ROOTETCUUCP)/remote.unknown
113REMOTESYMDEST =	../../usr/lib/uucp
114
115$(USERPROG1) := CPPFLAGS += -D_FILE_OFFSET_BITS=64
116
117# Mode is assigned in Targetdirs.  It shoudn't be re-assigned here
118$(USERPROG1:%=$(ROOTBIN)/%) :=		FILEMODE = 0555
119$(ROOTSHELLS) :=			FILEMODE = 0555
120$(ROOTLIBSHELLS) :=			FILEMODE = 0555
121$(UUCPPROG1:%=$(ROOTLIBUUCP)/%) :=	FILEMODE = 0510
122$(ROOTCRONTAB) :=			FILEMODE = 0444
123$(ROOTFILES) :=				FILEMODE = 0644
124$(ROOTETCUUCP)/Permissions :=		FILEMODE = 0600
125$(ROOTETCUUCP)/Systems :=		FILEMODE = 0600
126$(ROOTSPROG) :=				FILEMODE = 0555
127
128include		./Makefile.inc
129
130.KEEP_STATE:
131
132all:		$(TXTFILES) $(PROG) $(SHELLS)
133
134install:	$(ROOTDIRS) $(ROOTSYMDIRS) $(ROOTPROG)		\
135		$(ROOTUUCPPROG) $(ROOTLIBSHELLS) $(ROOTSHELLS)	\
136		$(ROOTFILES) $(ROOTSYMFILES) $(ROOTSPROG)	\
137		$(ROOTREMOTE) $(ROOTCRONTAB) $(ROOTMANIFEST)
138
139$(ROOTLIBUUCP)/% $(ROOTETCUUCP)/% $(ROOTUSRSBIN)/%: %
140		$(INS.file)
141
142$(PROG):	$$(POBJS)
143		$(LINK.c) $(POBJS) -o $@ $(LDLIBS) $(PLIBS)
144		$(POST_PROCESS)
145
146$(POFILE):	$(POFILES)
147		$(RM) $@; $(CAT) $(POFILES) > $@
148
149$(POFILES):	$$(POBJS:.o=.po)
150		$(RM) $@; $(CAT) $(POBJS:.o=.po) > $@
151
152$(ROOTDIRS):
153		$(INS.dir)
154
155$(ROOTSYMDIRS):
156		$(RM) $@; $(SYMLINK) $(SYMDEST)/$(@F) $@
157
158$(ROOTREMOTE):
159		$(RM) $@; $(SYMLINK) $(REMOTESYMDEST)/$(@F) $@
160
161check:		$(CHKMANIFEST)
162
163clean:
164		$(RM) $(CLEANFILES)
165
166lint:		lint_SRCS
167
168strip:
169		$(STRIP) $(PROG)
170
171# special rules for 'common', since it lives in chmod's directory
172
173common.o:	../chmod/common.c
174		$(COMPILE.c) -o $@ ../chmod/common.c
175
176common.po:	../chmod/common.c
177		$(COMPILE.cpp) ../chmod/common.c > common.c.i
178		$(XGETTEXT) $(XGETFLAGS) common.c.i ;\
179		$(RM)   $@ ;\
180		sed "/^domain/d" < messages.po  > $@ ;\
181		$(RM) messages.po common.c.i
182
183include		../Makefile.targ
184