# Makefile for Linux FailSafe books. # Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved. # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # # This program is distributed in the hope that it would be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Further, this software is distributed without any warranty that it is # free of the rightful claim of any third person regarding infringement # or the like. Any license provided herein, whether implied or # otherwise, applies only to this software file. Patent licenses, if # any, provided herein do not apply to combinations of this program with # other software, or any other product whatsoever. # # You should have received a copy of the GNU General Public License # along with this program; if not, write the Free Software Foundation, # Inc., 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. # # Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy, # Mountain View, CA 94043, or: # # http://www.sgi.com # # For further information regarding this notice, see: # # http://oss.sgi.com/projects/GenInfo/NoticeExplan # Targets: # default -> all: makes the doc subtree # dist: creates the rpms # install: makes the rpms and "installs" them in the CD location # clean, realclean, clobber: wipes out the doc subtree # These vars are specific to the ism... PROD_NAME=failsafe-1.0 PROD_DIR=./usr/doc/sgi/$(PROD_NAME) HTML_SUBDIRS= LnxFailSafe_AG-001 LnxFailSafe_PG-001 PDF_SUBDIRS= LnxFailSafe_AG-001 LnxFailSafe_PG-001 # If you don't want the PostScript files included, just # remove the two directories from the next line. PS_SUBDIRS= LnxFailSafe_AG-001 LnxFailSafe_PG-001 SGML_SUBDIRS= LnxFailSafe_AG-001 LnxFailSafe_PG-001 RPM_ROOT = failsafedocs RPM_VERSION = 1.0 RPM_RELEASE = 1 DOC_INSTALL_DIR = ../image RPM_INSTALL_DIR = ../image/RPMS #********************************************** # # Shouldn't need to change anything below here. # #********************************************** # These vars are generic to the build... RPM_NAMES = $(RPM_ROOT)*-$(RPM_VERSION)-$(RPM_RELEASE).noarch.rpm SRPM_NAMES = $(RPM_ROOT)*-$(RPM_VERSION)-$(RPM_RELEASE).src.rpm #RPM_NAMES_PRINT = $(RPM_ROOT)-print*-$(RPM_VERSION)-$(RPM_RELEASE).noarch.rpm RPM_TARGET_DIR = RPMS SOURCES_DIR = /usr/src/redhat/SOURCES BUILD_DIR = /usr/src/redhat/BUILD/books default: all headers exports: $(NOOP) # Build a doc subtree that can be packaged as an RPM, or dumped # as-is on the CD. Update the spec. Build the rpms and dump them # here in books/. all: @if [ -d "./usr/doc" ] ; then rm -rf "./usr/doc" ; fi ; \ for d in $(HTML_SUBDIRS); do \ if [ -e $$d/html.tar ] ; then \ mkdir -p $(PROD_DIR)/$$d ; \ cp $$d/html.tar $(PROD_DIR)/$$d ; \ (cd $(PROD_DIR)/$$d ; \ tar xvf html.tar ; \ rm -f html.tar) ; \ fi ; \ cp $$d/$$d.html.ddf $(PROD_DIR)/$$d/html ; \ done for d in $(SGML_SUBDIRS); do \ if [ -e $$d/book.sgml ] ; then \ mkdir -p $(PROD_DIR)/$$d/sgml ; \ cp $$d/*.sgml $(PROD_DIR)/$$d/sgml ; \ cp -R $$d/figures $(PROD_DIR)/$$d/sgml ; \ fi ; \ cp $$d/$$d.sgml.ddf $(PROD_DIR)/$$d/sgml ; \ cp $$d/*.readme $(PROD_DIR)/$$d/sgml/README ; \ done for d in $(PDF_SUBDIRS); do \ if [ -e $$d/prod/[0-9\-]*.pdf ] ; then \ mkdir -p $(PROD_DIR)/$$d/pdf ; \ cp $$d/prod/[0-9\-]*.pdf $(PROD_DIR)/$$d/pdf ; \ (cd $(PROD_DIR)/$$d/pdf ; \ mv [0-9\-]*.pdf $$d.pdf) ; \ fi ; \ cp $$d/$$d.pdf.ddf $(PROD_DIR)/$$d/pdf ; \ done for d in $(PS_SUBDIRS); do \ if [ -e $$d/prod/psfiles.gz.tar ] ; then \ cp $$d/prod/psfiles.gz.tar $(PROD_DIR)/$$d ; \ (cd $(PROD_DIR)/$$d ; \ tar xvf psfiles.gz.tar ; mv psfiles ps ; \ rm -f psfiles.gz.tar) ; \ fi ; \ cp $$d/$$d.ps.ddf $(PROD_DIR)/$$d/ps ; \ done ./generate_targets (cd .. ; tar czBf $(SOURCES_DIR)/$(RPM_ROOT).tar.gz books) dist rpm: all rpm -ba $(RPM_ROOT).spec if [ ! -d $(RPM_TARGET_DIR) ] ; then mkdir $(RPM_TARGET_DIR) ; fi mv /usr/src/redhat/RPMS/noarch/$(RPM_NAMES) $(RPM_TARGET_DIR) mv /usr/src/redhat/SRPMS/$(SRPM_NAMES) $(RPM_TARGET_DIR) # Move/copy stuff to the image dir install: dist if [ ! -d $(RPM_INSTALL_DIR) ] ; then mkdir -p $(RPM_INSTALL_DIR) ; fi mv $(RPM_TARGET_DIR)/$(RPM_NAMES) $(RPM_INSTALL_DIR) if [ ! -d $(DOC_INSTALL_DIR) ] ; then mkdir -p $(DOC_INSTALL_DIR) ; fi cp -rf ./usr/doc $(DOC_INSTALL_DIR) clean: rm -rf RPMS rm -rf $(SOURCES_DIR)/$(RPM_ROOT).tar.gz rm -rf $(BUILD_DIR) rm -f /usr/src/redhat/SRPMS/$(SRPM_NAMES) realclean: clobber clobber: clean rm -f *.auto rm -rf ./usr rm -f $(RPM_INSTALL_DIR)/$(RPM_NAMES) rm -rf $(DOC_INSTALL_DIR)/doc