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