Home | History | Annotate | Download | only in bsd-sysv-commands
      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 #
     22 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     23 # Use is subject to license terms.
     24 #
     25 #
     26 
     27 include		../Makefile.sp
     28 
     29 UCBPROGS =	lpr lpq lprm lpc
     30 BINPROGS =	lp lpstat cancel enable disable $(UCBPROGS)
     31 SBINPROGS =	accept reject lpmove
     32 
     33 LIBPRINTPROGS =	in.lpd
     34 
     35 LIBLPPROGS = $(BINPROGS) $(SBINPROGS)
     36 
     37 
     38 OBJS =	$(BINPROGS:=.o) $(SBINPROGS:=.o) $(LIBPRINTPROGS:=.o) common.o
     39 
     40 ROOTLIBLPBIN=$(ROOTLIBLP)/bin
     41 
     42 ROOTBINPROGS =		$(BINPROGS:%=$(ROOTBIN)/%)
     43 ROOTUSRSBINPROGS =	$(SBINPROGS:%=$(ROOTUSRSBIN)/%)
     44 ROOTLIBPRINTPROGS =	$(LIBPRINTPROGS:%=$(ROOTLIBPRINT)/%)
     45 ROOTLIBLPPROGS =	$(LIBLPPROGS:%=$(ROOTLIBLPBIN)/%)
     46 
     47 
     48 FILEMODE =	0555
     49 
     50 include ../../Makefile.cmd
     51 
     52 MANIFEST=	rfc1179.xml
     53 ROOTMANIFESTDIR=	$(ROOTSVCAPPLICATIONPRINT)
     54 $(ROOTMANIFEST)		:= FILEMODE= 444
     55 
     56 LPLIB	=	$(SRC)/cmd/lp/lib
     57 LIBLP	=	$(LPLIB)/lp/liblp.a
     58 CFLAGS +=	$(CCVERBOSE)
     59 CPPFLAGS +=	-I.
     60 CPPFLAGS +=	-I../../../lib/print/libpapi-common/common
     61 CPPFLAGS +=	-I$(ROOT)/usr/include
     62 CPPFLAGS +=	-I../../lp/include
     63 LDLIBS +=	$(LIBLP) -lpapi -lc
     64 in.lpd:=	CFLAGS +=	-DSOLARIS_PRIVATE_POST_0_9
     65 in.lpd:=	LDLIBS +=	-lnsl -lsocket
     66 
     67 all:	$(BINPROGS) $(SBINPROGS)
     68 
     69 #	each program needs common.o as well
     70 $(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS):	$(BINPROGS:%=%.c) $(SBINPROGS:%=%.c)  $(LIBPRINTPROGS:%=%.c) common.o
     71 	$(LINK.c) -o $@ $@.c common.o $(LDLIBS)
     72 	$(POST_PROCESS)
     73 
     74 #	ucb links (lptest is handled in usr/src/cmd/lp/cmd/Makefile)
     75 ROOTUSRUCB =		$(ROOT)/usr/ucb
     76 ROOTUCBSYMLINKS =	$(UCBPROGS:%=$(ROOTUSRUCB)/%)
     77 $(ROOTUSRUCB)/%:	$(ROOTUSRUCB) %
     78 
     79 $(ROOTLIBLPBIN)/%:	%
     80 	$(INS.file)
     81 
     82 $(ROOTUCBSYMLINKS):	
     83 	$(RM) $@; $(SYMLINK) ../bin/$(@F) $@
     84 
     85 #	usr/lib links
     86 ROOTUSRLIBSYMLINKS =	$(SBINPROGS:%=$(ROOTLIB)/%)
     87 $(ROOTLIB)/%:	$(ROOTLIB) %
     88 
     89 $(ROOTUSRLIBSYMLINKS):	
     90 	$(RM) $@; $(SYMLINK) ../sbin/$(@F) $@
     91 
     92 .KEEP_STATE:
     93 
     94 install:	$(ROOTLIBLPPROGS) \
     95 		$(ROOTLIBPRINT) $(ROOTLIBPRINTPROGS) $(ROOTMANIFEST) \
     96 		$(ROOTUCBSYMLINKS) $(ROOTUSRLIBSYMLINKS)
     97 
     98 check:	$(CHKMANIFEST)
     99 
    100 clean:
    101 	$(RM) $(OBJS) 
    102 
    103 CLOBBERFILES += $(BINPROGS) $(SBINPROGS) $(LIBPRINTPROGS)
    104 
    105 lint:
    106 
    107 include ../../Makefile.targ
    108