Home | History | Annotate | Download | only in bnu
      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 
     27 MANIFEST =	uucp.xml
     28 
     29 include		../Makefile.cmd
     30 
     31 USERPROG1 =	uudecode uuencode
     32 USERPROG =	$(USERPROG1) uucp uuglist uuname uustat uux ct cu
     33 UUCPPROG1 =	bnuconvert uucheck uucleanup
     34 UUCPPROG =	$(UUCPPROG1) remote.unknown uusched uucico uuxqt
     35 SBINPROG =	in.uucpd
     36 
     37 PROG =		$(UUCPPROG) $(USERPROG) $(SBINPROG)
     38 
     39 LIBSHELLS =	Uutry uudemon.admin uudemon.cleanup uudemon.hour uudemon.poll
     40 BINSHELLS =	uulog uupick uuto
     41 SHELLS =	$(LIBSHELLS) $(BINSHELLS)
     42 CRONTAB =	uudemon.crontab
     43 
     44 #include	../../lib/Makefile.lib
     45 
     46 FILES =		Config Devconfig Devices Dialcodes	\
     47 		Dialers Grades Limits Permissions	\
     48 		Poll Sysfiles Systems
     49 
     50 CLEANFILES =	$(SRCS:%.c=%.o) common.o
     51 
     52 TXTFILES =	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 
     56 ROOTMANIFESTDIR=	$(ROOTSVCNETWORK)
     57 
     58 CAT =		cat
     59 POFILE =	bnu.po
     60 # step around name collisions
     61 POFILES =	$(PROG:%=%.cat)
     62 
     63 CPPFLAGS =	-I. $(SMALLFLAG) $(CPPFLAGS.master) # -DSMALL
     64 
     65 FILEMODE =	4511
     66 
     67 # if you change these directories, change them in uucp.h as well
     68 
     69 ROOTLIBUUCP =	$(ROOT)/usr/lib/uucp
     70 ROOTETCUUCP =	$(ROOT)/etc/uucp
     71 ROOTVAR =	$(ROOT)/var
     72 ROOTVARUUCP =	$(ROOTVAR)/uucp
     73 ROOTSPOOL =	$(ROOTVAR)/spool
     74 ROOTSPLOCKS =	$(ROOTSPOOL)/locks
     75 ROOTSPUUCP =	$(ROOTSPOOL)/uucp
     76 ROOTSPPUB =	$(ROOTSPOOL)/uucppublic
     77 
     78 DOTADMIN =	.Admin
     79 DOTCORRUPT =	.Corrupt
     80 DOTLOG =	.Log
     81 DOTOLD =	.Old
     82 DOTSEQ =	.Sequence
     83 DOTSTATUS =	.Status
     84 DOTWORKSPACE =	.Workspace
     85 DOTXQT =	.Xqtdir
     86 DOTDIRS =	$(DOTADMIN) $(DOTLOG) $(DOTOLD) $(DOTSEQ) $(DOTSTATUS)
     87 DOTSPDIRS =	$(DOTCORRUPT) $(DOTWORKSPACE) $(DOTXQT)
     88 
     89 DOTLOGCICO =	$(DOTLOG)/uucico
     90 DOTLOGUUCP =	$(DOTLOG)/uucp
     91 DOTLOGUUX =	$(DOTLOG)/uux
     92 DOTLOGUUXQT =	$(DOTLOG)/uuxqt
     93 DOTLOGDIRS =	$(DOTLOGCICO) $(DOTLOGUUCP) $(DOTLOGUUX) $(DOTLOGUUXQT)
     94 
     95 ROOTDOTDIRS =	$(DOTDIRS:%=$(ROOTVARUUCP)/%)
     96 ROOTDOTSPDIRS =	$(DOTSPDIRS:%=$(ROOTSPUUCP)/%)
     97 ROOTDOTLOGDIRS = $(DOTLOGDIRS:%=$(ROOTVARUUCP)/%)
     98 
     99 ROOTPROG =	$(USERPROG:%=$(ROOTBIN)/%)
    100 ROOTSPROG =	$(SBINPROG:%=$(ROOTUSRSBIN)/%)
    101 ROOTSHELLS =	$(BINSHELLS:%=$(ROOTBIN)/%)
    102 ROOTUUCPPROG =	$(UUCPPROG:%=$(ROOTLIBUUCP)/%)
    103 ROOTLIBSHELLS =	$(LIBSHELLS:%=$(ROOTLIBUUCP)/%)
    104 ROOTCRONTAB =	$(CRONTAB:%=$(ROOTLIBUUCP)/%)
    105 ROOTFILES =	$(FILES:%=$(ROOTETCUUCP)/%)
    106 
    107 ROOTDIRS =	$(ROOTLIBUUCP) $(ROOTETCUUCP) $(ROOTSPLOCKS)	\
    108 		$(ROOTDOTDIRS) $(ROOTDOTSPDIRS) $(ROOTDOTLOGDIRS)
    109 
    110 ROOTSYMDIRS =	$(DOTDIRS:%=$(ROOTSPUUCP)/%)
    111 SYMDEST =	../../uucp
    112 ROOTREMOTE =	$(ROOTETCUUCP)/remote.unknown
    113 REMOTESYMDEST =	../../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 
    128 include		./Makefile.inc
    129 
    130 .KEEP_STATE:
    131 
    132 all:		$(TXTFILES) $(PROG) $(SHELLS)
    133 
    134 install:	$(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 
    161 check:		$(CHKMANIFEST)
    162 
    163 clean:
    164 		$(RM) $(CLEANFILES)
    165 
    166 lint:		lint_SRCS
    167 
    168 strip:
    169 		$(STRIP) $(PROG)
    170 
    171 # special rules for 'common', since it lives in chmod's directory
    172 
    173 common.o:	../chmod/common.c
    174 		$(COMPILE.c) -o $@ ../chmod/common.c
    175 
    176 common.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 
    183 include		../Makefile.targ
    184