[BACK]Return to Makefile CVS log [TXT][DIR] Up to [Development] / xfs-cmds

File: [Development] / xfs-cmds / Makefile (download)

Revision 1.7, Tue Oct 28 04:06:28 2003 UTC (13 years, 11 months ago) by wessmith
Branch: MAIN
Changes since 1.6: +1 -14 lines

merge of xfs-cmds-lbs:slinx:154649a
Merge of xfs-cmds-lbs:slinx:154649a by roehrich.

  Install RPMs into chroot environment after they're built, as other
  products (XVM GUI) depend on xfsprogs and xfsprogs-devel.

#
# Copyright (c) 2002 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/SGIGPLNoticeExplan/
#
#
# Top-level makefile for xfs-cmds
#	(with specific bits for LBS)
# 

XFS_CMDS_DIR := $(shell pwd)

# This is true for both LBS and 2.4.x-xfs builds... for now...
TOP=..

ARCH := $(shell uname -m | sed -e s/i.86/i386/)

COMMANDS = attr acl xfsprogs dmapi xfsdump

# We'd like to be able to satisfy dependencies from within the
# xfs-cmds tree when we can; we can use environment vars to
# point autoconf & the build within the tree.

# Set up environment vars for cmd build; this is the superset of needed
# includes/libs, but we'll just set them all here unless there's a good
# reason not to...

export	CPPFLAGS =  -I$(XFS_CMDS_DIR)/xfsprogs/include \
		    -I$(XFS_CMDS_DIR)/dmapi/include \
		    -I$(XFS_CMDS_DIR)/attr/include

export	LDFLAGS =   -L$(XFS_CMDS_DIR)/xfsprogs/libxfs/.libs \
		    -L$(XFS_CMDS_DIR)/xfsprogs/libhandle/.libs \
		    -L$(XFS_CMDS_DIR)/dmapi/libdm/.libs \
		    -L$(XFS_CMDS_DIR)/attr/libattr/.libs

export	LTLDFLAGS = -L$(XFS_CMDS_DIR)/xfsprogs/libxfs \
		    -L$(XFS_CMDS_DIR)/xfsprogs/libhandle \
		    -L$(XFS_CMDS_DIR)/dmapi/libdm \
		    -L$(XFS_CMDS_DIR)/attr/libattr

default all: cmds

cmds-install: cmds
	echo "=== Making $@ `date`"
	( rpm -Uvh --replacefiles --replacepkgs \
		$(XFS_CMDS_DIR)/RPMS/$(ARCH)/*.$(ARCH).rpm )

cmds: builddirs

	echo "=== Making $@ `date`"
	for d in $(COMMANDS); do \
		echo "== Building $$d"; \
		( cd $(XFS_CMDS_DIR)/$$d && ./Makepkgs ) || exit 1; \
	done
	for d in $(COMMANDS); do \
		( cd $(XFS_CMDS_DIR) && /bin/cp $$d/build/rpm/*.src.rpm SRPMS ) \
	done
	for d in $(COMMANDS); do \
		( cd $(XFS_CMDS_DIR) && /bin/cp $$d/build/rpm/*.$(ARCH).rpm RPMS/$(ARCH) ) \
	done

	# If this is an LBS build ($(TOP)/sgi-install/SGI/RPMS exists)
	# then copy the RPMs over to sgi-install after they're built
	([ -d $(TOP)/sgi-install/SGI/RPMS ] && \
		( /bin/cp $(XFS_CMDS_DIR)/RPMS/$(ARCH)/*.rpm $(TOP)/sgi-install/SGI/RPMS )) || \
		echo

	([ -d $(TOP)/sgi-install/SGI/SRPMS ] && \
		( /bin/cp $(XFS_CMDS_DIR)/SRPMS/*.src.rpm $(TOP)/sgi-install/SGI/SRPMS )) || \
		echo

builddirs:
	echo "cmd builddirs"
	([ -d $(XFS_CMDS_DIR)/BUILD ] || mkdir $(XFS_CMDS_DIR)/BUILD)
	([ -d $(XFS_CMDS_DIR)/SRPMS ] || mkdir $(XFS_CMDS_DIR)/SRPMS)
	([ -d $(XFS_CMDS_DIR)/RPMS/$(ARCH) ] || mkdir -p $(XFS_CMDS_DIR)/RPMS/$(ARCH))

clean:
	rm -rf RPMS SRPMS BUILD SOURCES
	for d in $(COMMANDS); do \
		( cd $(XFS_CMDS_DIR)/$$d && make -i clean ) \
	done

realclean: clean
	for d in $(COMMANDS); do ( cd $(XFS_CMDS_DIR)/$$d && make realclean ) done

clean-lbs:    realclean

build-lbs:    cmds-install