xref: /titanic_44/usr/src/cmd/bnu/Makefile (revision 03831d35f7499c87d51205817c93e9a8d42c4bae)
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, Version 1.0 only
6# (the "License").  You may not use this file except in compliance
7# with the License.
8#
9# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10# or http://www.opensolaris.org/os/licensing.
11# See the License for the specific language governing permissions
12# and limitations under the License.
13#
14# When distributing Covered Code, include this CDDL HEADER in each
15# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16# If applicable, add the following below this CDDL HEADER, with the
17# fields enclosed by brackets "[]" replaced with your own identifying
18# information: Portions Copyright [yyyy] [name of copyright owner]
19#
20# CDDL HEADER END
21#
22#
23# ident	"%Z%%M%	%I%	%E% SMI"
24#
25# Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
26# Use is subject to license terms.
27#
28# cmd/bnu/Makefile
29#
30
31include		../Makefile.cmd
32
33USERPROG1 =	uudecode uuencode
34USERPROG =	$(USERPROG1) uucp uuglist uuname uustat uux ct cu
35UUCPPROG1 =	bnuconvert uucheck uucleanup
36UUCPPROG =	$(UUCPPROG1) remote.unknown uusched uucico uuxqt
37SBINPROG =	in.uucpd
38
39PROG =		$(UUCPPROG) $(USERPROG) $(SBINPROG)
40
41MANIFEST =	uucp.xml
42
43LIBSHELLS =	Uutry uudemon.admin uudemon.cleanup uudemon.hour uudemon.poll
44BINSHELLS =	uulog uupick uuto
45SHELLS =	$(LIBSHELLS) $(BINSHELLS)
46CRONTAB =	uudemon.crontab
47
48#include	../../lib/Makefile.lib
49
50FILES =		Config Devconfig Devices Dialcodes	\
51		Dialers Grades Limits Permissions	\
52		Poll Sysfiles Systems
53
54CLEANFILES =	$(SRCS:%.c=%.o) common.o
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$(ROOTMANIFEST)		:= FILEMODE= 444
62
63CAT =		cat
64POFILE =	bnu.po
65# step around name collisions
66POFILES =	$(PROG:%=%.cat)
67
68CPPFLAGS =	-I. $(SMALLFLAG) $(CPPFLAGS.master) # -DSMALL
69
70OWNER =		uucp
71GROUP =		uucp
72FILEMODE =	4511
73
74# if you change these directories, change them in uucp.h as well
75
76ROOTLIBUUCP =	$(ROOT)/usr/lib/uucp
77ROOTETCUUCP =	$(ROOT)/etc/uucp
78ROOTVAR =	$(ROOT)/var
79ROOTVARUUCP =	$(ROOTVAR)/uucp
80ROOTSPOOL =	$(ROOTVAR)/spool
81ROOTSPLOCKS =	$(ROOTSPOOL)/locks
82ROOTSPUUCP =	$(ROOTSPOOL)/uucp
83ROOTSPPUB =	$(ROOTSPOOL)/uucppublic
84
85DOTADMIN =	.Admin
86DOTCORRUPT =	.Corrupt
87DOTLOG =	.Log
88DOTOLD =	.Old
89DOTSEQ =	.Sequence
90DOTSTATUS =	.Status
91DOTWORKSPACE =	.Workspace
92DOTXQT =	.Xqtdir
93DOTDIRS =	$(DOTADMIN) $(DOTLOG) $(DOTOLD) $(DOTSEQ) $(DOTSTATUS)
94DOTSPDIRS =	$(DOTCORRUPT) $(DOTWORKSPACE) $(DOTXQT)
95
96DOTLOGCICO =	$(DOTLOG)/uucico
97DOTLOGUUCP =	$(DOTLOG)/uucp
98DOTLOGUUX =	$(DOTLOG)/uux
99DOTLOGUUXQT =	$(DOTLOG)/uuxqt
100DOTLOGDIRS =	$(DOTLOGCICO) $(DOTLOGUUCP) $(DOTLOGUUX) $(DOTLOGUUXQT)
101
102ROOTDOTDIRS =	$(DOTDIRS:%=$(ROOTVARUUCP)/%)
103ROOTDOTSPDIRS =	$(DOTSPDIRS:%=$(ROOTSPUUCP)/%)
104ROOTDOTLOGDIRS = $(DOTLOGDIRS:%=$(ROOTVARUUCP)/%)
105
106ROOTPROG =	$(USERPROG:%=$(ROOTBIN)/%)
107ROOTSPROG =	$(SBINPROG:%=$(ROOTUSRSBIN)/%)
108ROOTSHELLS =	$(BINSHELLS:%=$(ROOTBIN)/%)
109ROOTUUCPPROG =	$(UUCPPROG:%=$(ROOTLIBUUCP)/%)
110ROOTLIBSHELLS =	$(LIBSHELLS:%=$(ROOTLIBUUCP)/%)
111ROOTCRONTAB =	$(CRONTAB:%=$(ROOTLIBUUCP)/%)
112ROOTFILES =	$(FILES:%=$(ROOTETCUUCP)/%)
113
114ROOTDIRS =	$(ROOTLIBUUCP) $(ROOTETCUUCP) $(ROOTSPLOCKS)	\
115		$(ROOTDOTDIRS) $(ROOTDOTSPDIRS) $(ROOTDOTLOGDIRS)
116
117ROOTSYMDIRS =	$(DOTDIRS:%=$(ROOTSPUUCP)/%)
118SYMDEST =	../../uucp
119ROOTREMOTE =	$(ROOTETCUUCP)/remote.unknown
120REMOTESYMDEST =	../../usr/lib/uucp
121
122$(USERPROG1) := CPPFLAGS += -D_FILE_OFFSET_BITS=64
123
124# Mode is assigned in Targetdirs.  It shoudn't be re-assigned here
125#$(ROOTSPPUB) :=				DIRMODE = 1777
126$(USERPROG1:%=$(ROOTBIN)/%) :=		FILEMODE = 0555
127$(USERPROG1:%=$(ROOTBIN)/%) :=		OWNER = root
128$(ROOTSHELLS) :=			FILEMODE = 0555
129$(ROOTSHELLS) :=			OWNER = root
130$(ROOTLIBSHELLS) :=			FILEMODE = 0555
131$(ROOTLIBSHELLS) :=			OWNER = root
132$(UUCPPROG1:%=$(ROOTLIBUUCP)/%) :=	FILEMODE = 0510
133$(ROOTCRONTAB) :=			FILEMODE = 0444
134$(ROOTCRONTAB) :=			OWNER = root
135$(ROOTFILES) :=				FILEMODE = 0644
136$(ROOTETCUUCP)/Permissions :=		FILEMODE = 0600
137$(ROOTETCUUCP)/Systems :=		FILEMODE = 0600
138$(ROOTBIN)/ct :=			OWNER = root
139$(ROOTSPROG) :=				FILEMODE = 0555
140$(ROOTSPROG) :=				OWNER = root
141
142include		./Makefile.inc
143
144.KEEP_STATE:
145
146all:		$(TXTFILES) $(PROG) $(SHELLS)
147
148install:	$(ROOTDIRS) $(ROOTSYMDIRS) $(ROOTPROG)		\
149		$(ROOTUUCPPROG) $(ROOTLIBSHELLS) $(ROOTSHELLS)	\
150		$(ROOTFILES) $(ROOTSYMFILES) $(ROOTSPROG)	\
151		$(ROOTREMOTE) $(ROOTCRONTAB) $(ROOTMANIFEST)
152
153$(ROOTLIBUUCP)/% $(ROOTETCUUCP)/% $(ROOTUSRSBIN)/%: %
154		$(INS.file)
155
156$(PROG):	$$(POBJS)
157		$(LINK.c) $(POBJS) -o $@ $(LDLIBS) $(PLIBS)
158		$(POST_PROCESS)
159
160$(POFILE):	$(POFILES)
161		$(RM) $@; $(CAT) $(POFILES) > $@
162
163$(POFILES):	$$(POBJS:.o=.po)
164		$(RM) $@; $(CAT) $(POBJS:.o=.po) > $@
165
166$(ROOTDIRS):
167		$(INS.dir)
168
169$(ROOTSYMDIRS):
170		$(RM) $@; $(SYMLINK) $(SYMDEST)/$(@F) $@
171
172$(ROOTREMOTE):
173		$(RM) $@; $(SYMLINK) $(REMOTESYMDEST)/$(@F) $@
174
175check:		$(CHKMANIFEST)
176
177clean:
178		$(RM) $(CLEANFILES)
179
180lint:		lint_SRCS
181
182strip:
183		$(STRIP) $(PROG)
184
185# special rules for 'common', since it lives in chmod's directory
186
187common.o:	../chmod/common.c
188		$(COMPILE.c) -o $@ ../chmod/common.c
189
190common.po:	../chmod/common.c
191		$(COMPILE.cpp) ../chmod/common.c > common.c.i
192		$(XGETTEXT) $(XGETFLAGS) common.c.i ;\
193		$(RM)   $@ ;\
194		sed "/^domain/d" < messages.po  > $@ ;\
195		$(RM) messages.po common.c.i
196
197include		../Makefile.targ
198