# Copyright (C) 2008 Platform Computing Inc # # 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 will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA # # $Id$ # NAME = platform_ofed VERSION = 1.4 RELEASE = 0 TOPDIR = $(PWD) ARCH = $(shell arch) RPMS = `find $(TOPDIR)/RPMS/ -type f |grep -v '.svn'` @if [ -n "${PREBUILT_ROOT_DIR}" ]; then \ tempo:=`ls $(PREBUILT_ROOT_DIR)/x86_64/kernel-ib* | grep -v devel` ; \ ls $(PREBUILT_ROOT_DIR)/x86_64/kernel-ib* | grep -v devel ; \ echo "rpm for driverpack: $(tempo)" ; \ fi default: all all: packages components kit packages: -mkdir -p $(TOPDIR)/RPMS/$(ARCH) -mkdir -p $(TOPDIR)/BUILD cd packages; make components: cd components; make kit: -mkdir -p $(TOPDIR)/BUILD @if [ -n "${TAG_OS}" ]; then \ if [ -n "${PREBUILT_ROOT_DIR}" ]; then \ tempo=`ls -1 $(PREBUILT_ROOT_DIR)/*/kernel-ib-1.4* | awk -F/ '{print $$NF}' ` ; \ echo "rpm for driverpack: $$tempo" ; \ sed -i "s/TAG_RPM/$$tempo/" $(TOPDIR)/kitinfo ; \ rpmbuild -bb --define "_topdir $(TOPDIR)" kit-$(NAME).spec ; \ cp $(TOPDIR)/kitinfo $(TOPDIR)/kitinfo.verif ; \ sed -i "s/$$tempo/TAG_RPM/" $(TOPDIR)/kitinfo ; \ else \ tempo=`ls -1 RPMS/*/kernel-ib-1.4* | awk -F/ '{print $$NF}' ` ; \ sed -i "s/TAG_RPM/$$tempo/" $(TOPDIR)/kitinfo ; \ echo "rpm for driverpack: $$tempo" ; \ rpmbuild -bb --define "_topdir $(TOPDIR)" kit-$(NAME).spec ; \ sed -i "s/$$tempo/TAG_RPM/" $(TOPDIR)/kitinfo ; \ fi ; \ mkdir -p $(TOPDIR)/disk1/$(NAME) ; \ cd $(TOPDIR)/disk1/$(NAME) ; \ for i in $(RPMS); do ln -sf $$i; done ; \ cd $(TOPDIR) ; \ mkisofs -quiet -V "Platform OFED $(VERSION) Kit" -r -T -f -o kit-$(NAME)-$(VERSION)-$(RELEASE).noarch.iso disk1 ; \ else \ echo "please specify the OS" || exit 1; \ fi clean: rm -rf $(TOPDIR)/RPMS/$(ARCH)/* rm -rf $(TOPDIR)/disk1 cd components; make clean cd packages; make clean rm -rf kit-*.iso BUILD RPMS rm -rf *.rpm .PHONY: components packages