[BACK]Return to Makefile CVS log [TXT][DIR] Up to [Development] / projects / failsafe / FailSafe-books

File: [Development] / projects / failsafe / FailSafe-books / Makefile (download)

Revision 1.6, Wed Aug 9 00:48:10 2000 UTC (17 years, 2 months ago) by vasa
Branch: MAIN
Changes since 1.5: +2 -1 lines

Modified release # to reflect newer books

# 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
FHS_DOC_DIR = usr/share/doc
#FHS_DOC_DIR = usr/doc/sgi
PROD_DIR=./$(FHS_DOC_DIR)/$(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 = 2
DOC_INSTALL_DIR = ../image
RPM_INSTALL_DIR = ../image/RPMS

TARUP_FILES = books/Makefile books/generate_targets books/failsafedocs.spec \
	books/INSTALL \
	books/LnxFailSafe_AG-001 books/LnxFailSafe_PG-001 books/usr \
	books/html_targets.auto books/print_targets.auto books/sgml_targets.auto

#**********************************************
#
# 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
PKG_ROOT = dist
SOURCES_DIR = $(shell pwd)/$(PKG_ROOT)/SOURCES
BUILD_DIR = $(PKG_ROOT)/BUILD/books
RPMS_DIR = $(PKG_ROOT)/RPMS
SRPMS_DIR = $(PKG_ROOT)/SRPMS
PKG_BUILD_ROOT	= $(shell pwd)/$(PKG_ROOT)/install
RPMOPTS = --define "buildroot $(PKG_BUILD_ROOT)" --define "_topdir $(shell pwd)/$(PKG_ROOT)"

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 "./$(FHS_DOC_DIR)" ] ; then rm -rf "./$(FHS_DOC_DIR)" ; 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
	mkdir -p $(SOURCES_DIR) $(BUILD_DIR) $(RPMS_DIR) $(SRPMS_DIR)
	./generate_targets
	(cd .. ; tar czBf $(SOURCES_DIR)/$(RPM_ROOT).tar.gz $(TARUP_FILES) )

dist rpm: all
	rpm -ba $(RPMOPTS) $(RPM_ROOT).spec
	if [ ! -d $(RPM_TARGET_DIR) ] ; then mkdir $(RPM_TARGET_DIR) ; fi
	mv $(RPMS_DIR)/noarch/$(RPM_NAMES) $(RPM_TARGET_DIR)
	mv $(SRPMS_DIR)/$(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 $(SRPMS_DIR)/$(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
	rm -rf $(PKG_BUILD_ROOT)