# # 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 # For LBS, the "all" target should build all RPMs, but # should _not_ install them 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 # For LBS, the "exports" target should install any packages that # are needed for other LBS packages; for now this does not include # any of the xfs userspace (?) # Docs say to copy RPMs after all: and exports: but building # exports won't _build_ any rpms, so...? exports: # (null) # if slinx build already has builddirs above, link to them, otherwise # make our own (LBS or standalone) builddirs: echo "cmd builddirs" ([ -d $(TOP)/BUILD ] && ln -s $(TOP)/BUILD $(XFS_CMDS_DIR)/BUILD) \ || ([ -d $(XFS_CMDS_DIR)/BUILD ] || mkdir $(XFS_CMDS_DIR)/BUILD) ([ -d $(TOP)/SRPMS ] && ln -s $(TOP)/SRPMS $(XFS_CMDS_DIR)/SRPMS) \ || ([ -d $(XFS_CMDS_DIR)/SRPMS ] || mkdir $(XFS_CMDS_DIR)/SRPMS) ([ -d $(TOP)/RPMS/$(ARCH) ] && ln -s $(TOP)/RPMS $(XFS_CMDS_DIR)/RPMS) \ || ([ -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