1 # 2 # 3 # CDDL HEADER START 4 # 5 # The contents of this file are subject to the terms of the 6 # Common Development and Distribution License (the "License"). 7 # You may not use this file except in compliance 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 # Copyright 2009 Sun Microsystems, Inc. All rights reserved. 23 # Use is subject to license terms. 24 # 25 #ident "@(#)Makefile.sfw 1.3 09/10/08 SMI" 26 27 include ../Makefile.cmd 28 # include ../Makefile.cmd.64 29 30 VER = $(COMPONENT_NAME:sh)-$(COMPONENT_VERSION:sh) 31 TARBALL=$(VER).tar.gz 32 PATCHES:sh = echo Patches/[0-9]*.patch 33 GPATCH_FLAGS = -p1 34 35 CC += -features=extensions 36 CCC += -norunpath -library=%none -features=extensions 37 CXXLD = $(CCC) 38 PPDDIR = $(CFGPREFIX)/share/ppd 39 ROOTPPDCACHE = $(ROOT)/usr/lib/lp/caches/SUNWhpijs.cache 40 41 # configure(1) options to use 42 # a default --prefix and --mandir are set in Makefile.master 43 CONFIGURE_OPTIONS += --localedir=$(CFGLOCALE) 44 CONFIGURE_OPTIONS += --disable-pp-build 45 CONFIGURE_OPTIONS += --disable-gui-build 46 47 # use these options for the HPIJS only support 48 $(VER)-hpijs/config.status:= CONFIGURE_OPTIONS += --enable-foomatic-ppd-install 49 $(VER)-hpijs/config.status:= CONFIGURE_OPTIONS += --with-hpppddir=$(PPDDIR)/SUNWhpijs/HP 50 $(VER)-hpijs/config.status:= CONFIGURE_OPTIONS += --disable-cups-drv-install 51 $(VER)-hpijs/config.status:= CONFIGURE_OPTIONS += --disable-hpcups-install 52 $(VER)-hpijs/config.status:= CONFIGURE_OPTIONS += --disable-doc-install 53 $(VER)-hpijs/config.status:= CONFIGURE_OPTIONS += --enable-hpijs-only-build 54 $(VER)-hpijs/config.status:= CONFIGURE_OPTIONS += --enable-hpijs-install 55 56 # use these options for the CUPS/SANE support 57 $(VER)/config.status:= CONFIGURE_OPTIONS += --with-hpppddir=/usr/share/cups/model/SUNWhplip 58 $(VER)/config.status:= CONFIGURE_OPTIONS += --enable-lite-build 59 $(VER)/config.status:= CONFIGURE_OPTIONS += --enable-network-build 60 $(VER)/config.status:= CONFIGURE_OPTIONS += --enable-fax-build 61 $(VER)/config.status:= CONFIGURE_OPTIONS += --disable-udev-acl-rules 62 $(VER)/config.status:= CONFIGURE_OPTIONS += --enable-hpcups-install 63 $(VER)/config.status:= CONFIGURE_OPTIONS += --disable-new-hpcups 64 $(VER)/config.status:= CONFIGURE_OPTIONS += --enable-cups-drv-install 65 66 TARGET_ENV += CC="$(CC)" 67 TARGET_ENV += CXX="$(CCC)" 68 TARGET_ENV += CXXLD="$(CXXLD)" 69 TARGET_ENV += CPPFLAGS="$(CPPFLAGS)" 70 TARGET_ENV += LD_OPTIONS="$(LDLIBS) $(LDFLAGS)" 71 TARGET_ENV += PATH="$(SRC)/tools:$(SFW_PATH)" 72 TARGET_ENV += MAKE="$(CCSMAKE)" 73 74 all:= TARGET = all 75 install:= TARGET = -e install 76 install:= TARGET_ENV += halpredir=/etc/hal/fdi/preprobe/10osvendor 77 install:= TARGET_ENV += DESTDIR="$(ROOT)" 78 install:= TARGET_ENV += INSTALL="$(INSTALL_PROTO)" 79 install:= TARGET_ENV += PATH="$(SRC)/tools:$(SFW_PATH)" 80 install:= TARGET_ENV += MAKE="$(CCSMAKE)" 81 82 83 # 84 # Hopefully you will not need to make changes below this point 85 # 86 87 all: $(VER)/.built $(VER)-hpijs/.built 88 89 # build HPLIP (CUPS + SANE support) 90 $(VER)/.built: $(VER)/config.status 91 (cd $(@D) ; env - $(TARGET_ENV) $(CCSMAKE) $(TARGET)) 92 $(TOUCH) $@ 93 94 #build HPLIP (HPIJS support for LP) 95 $(VER)-hpijs/.built: $(VER)-hpijs/config.status 96 (cd $(@D) ; env - $(TARGET_ENV) $(CCSMAKE) $(TARGET)) 97 $(TOUCH) $@ 98 99 install: install-protofix 100 101 $(VER)/.installed: $(VER)/.built 102 (cd $(@D) ; env - $(TARGET_ENV) $(CCSMAKE) $(TARGET)) 103 $(RM) -r $(ROOTLIB)/libhp*.la 104 $(RM) -r $(ROOTLIB)/sane/libsane-hpaio.la 105 $(RM) -r $(ROOTETC)/udev 106 $(TOUCH) $@ 107 108 $(VER)-hpijs/.installed: $(VER)-hpijs/.built 109 (cd $(@D) ; env - $(TARGET_ENV) $(CCSMAKE) $(TARGET)) 110 $(MKDIR) -p $(ROOTSFWBIN) 111 $(RM) $(ROOTSFWBIN)/hpijs ; $(SYMLINK) ../../bin/hpijs $(ROOTSFWBIN)/hpijs 112 $(TOUCH) $@ 113 114 install-target: $(VER)/.installed $(VER)-hpijs/.installed 115 -$(RMDIR) $(ROOT)/usr/share/hplip 116 -$(RM) -r $(ROOT)/etc/hp 117 -$(RM) -r $(ROOT)/etc/hal/fdi/preprobe 118 -$(RM) -r $(ROOT)/var/lib/hp 119 120 $(ROOTPPDCACHE): $(VER)-hpijs/.installed 121 $(RM) $@ 122 $(MKDIR) -p $(ROOT)/usr/lib/lp/caches 123 ( env - \ 124 VER="$(VER)-hpijs" \ 125 PPDSRC="$(ROOT)/usr/share/ppd/SUNWhpijs" \ 126 DONOTINSTALL="/dev/null" \ 127 CACHE="$@" \ 128 IPATH="/usr/share/ppd/SUNWhpijs/" \ 129 $(KSH93) ../foomatic-ppd/cache.ksh) 130 131 install-protofix: install-target $(ROOTPPDCACHE) 132 # apply the file attributes from the packaging 133 for pkg in $(COMPONENT_PACKAGES:sh) ; do \ 134 $(SRC)/tools/protofix --pkg $$pkg --perm ; \ 135 done 136 137 # 138 # Since it looks like you can't build HPLIP with both HPIJS and CUPS support 139 # and seperate the HPIJS and CUPS PPD data, we need to replicate the code and 140 # build it twice. Once for the HPIJS support used by LP and once for the rest 141 # of the support used for CUPS and SANE. 142 # 143 $(VER)-hpijs/config.status: $(VER)-hpijs/configure 144 (cd $(@D) ; env - $(TARGET_ENV) ./configure $(CONFIGURE_OPTIONS)) 145 146 $(VER)-hpijs/configure: $(VER)/configure 147 ($(RM) -r $(@D) ; mkdir $(@D)) 148 (cd $(VER) ; find . | cpio -dump ../$(@D)) 149 $(TOUCH) $@ 150 151 $(VER)/config.status: $(VER)/configure .WAIT $(VER)-hpijs/configure 152 (cd $(VER) ; env - $(TARGET_ENV) ./configure $(CONFIGURE_OPTIONS)) 153 154 $(VER)/configure: $(VER)/configure.in 155 (cd $(VER) ; aclocal-1.10; libtoolize --force; autoconf ) 156 157 $(VER)/configure.in: $(VER)/.patched 158 touch $@ 159 160 clean: 161 -rm -rf $(VER) $(VER)-hpijs 162 163 include ../Makefile.targ 164 165 FRC: 166