[BACK]Return to builddefs CVS log [TXT][DIR] Up to [Development] / failsafe / FailSafe / include

File: [Development] / failsafe / FailSafe / include / builddefs (download)

Revision 1.2, Fri Sep 8 02:14:14 2000 UTC (17 years, 1 month ago) by vasa
Branch: MAIN
Changes since 1.1: +3 -6 lines

Using top-level VERSION file to make builddefs independent

#!gmake
#
# 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

# Common gmake macros for building
#
# Generated automatically from builddefs.in by configure.
#
ifndef _BUILDDEFS_INCLUDED_
_BUILDDEFS_INCLUDED_ = 1

BUILDRULES=$(TOPDIR)/include/buildrules

TARGET_OS = linux

# General package information
include $(TOPDIR)/VERSION

ifndef PACKAGE_BUILDER 
PACKAGE_BUILDER = $(shell echo `id -un`@`hostname -f`)
endif

# LCFLAGS, LLDFLAGS, LLDLIBS, LSRCFILES and LDIRT may be specified in
# user Makefiles. Note: LSRCFILES is anything other than Makefile, $(CFILES)
# $(CXXFILES), or $(HFILES) and is used to construct the manifest list
# during the "dist" phase (packaging).

PTHREAD_LIB=-lpthread
SYSADM_LIBS = /usr/lib/sysadm/lib

CFLAGS +=  $(LCFLAGS) -Wall -g -DCAS_DEBUG -DCI_DEBUG -DFAILSAFE_DEBUG \
	-DCAS_VERSION=\"$(PACKAGE_VERSION)\"  \
	-DCI_VERSION=\"$(PACKAGE_VERSION)\"  \
	-DFAILSAFE_VERSION=\"$(PACKAGE_VERSION)\"  \
	-DCDB -DCDB_FS2 \
	-I$(TOPDIR)/include \
	$(LCINCS)

LDFLAGS += $(WARN_OFF) $(LLDFLAGS) $(LLDOPTS) \
	-Xlinker -rpath -Xlinker $(CAS_LIB_DIR):$(SYSADM_LIBS) -L$(SYSADM_LIBS)

SRCFILES = Makefile $(HFILES) $(CFILES) $(CXXFILES) $(MFILES) $(LSRCFILES) \
	$(LFILES) $(YFILES) $(SOURCES) $(LSOURCES) $(ASFILES)
LDLIBS = $(LLDLIBS)
MAKEOPTS = --no-print-directory
DIRT = $(LDIRT) .deps dep dep.bak $(OBJECTS) $(CMDTARGET) $(DSO_TARGET) \
	$(STATICLIBTARGET) *.[1-9].gz

OBJECTS = $(ASFILES:.S=.o) \
          $(CXXFILES:.c++=.o) \
          $(CFILES:.c=.o) \
          $(FFILES:.f=.o) \
          $(LFILES:.l=.o) \
          $(YFILES:%.y=%.tab.o) \
	  $(EXTRAOBJS)

MAKE	= /usr/bin/make
CC	= gcc
CXX	= @cxx@
LD	= /usr/bin/ld
AWK	= awk
SED	= /bin/sed
CPP	= gcc -E
#INSTALL	= $(TOPDIR)/install-sh -o root -g bin
INSTALL	= $(TOPDIR)/install-sh
LEX	= lex
YACC	= yacc
ECHO	= /bin/echo
LN_S	= ln -s

CCF	= $(CC) $(CFLAGS)
MAKEF	= $(MAKE) $(MAKEOPTS)
CXXF	= $(CXX) $(CXXFLAGS)
LDF	= $(LD) $(LDFLAGS)
MAKEDEPEND= /usr/bin/X11/makedepend

GZIP	= /bin/gzip
TAR	= /bin/tar
RPM	:= $(shell which rpm)
RPM_VERSION = 3
RPMF	= $(RPM) $(RPMFLAGS)
GENDIST	= 
DPKG	= 

HAVE_GZIPPED_MANPAGES = @have_gzipped_manpages@
CPP_SIMPLE = /lib/cpp
CPP_SIMPLE_ARGS =  -P -traditional -undef
RDYNAMIC_FLAG = -rdynamic

#
#
# additional libraries needed for particular functions
LIB_FOR_BASENAME = 
LIB_FOR_DLOPEN = -ldl
LIB_FOR_MATH = 

SHELL = /bin/sh


SUBDIRS_MAKERULE = \
	@for d in $(SUBDIRS) ""; do \
	    if test -d "$$d" -a ! -z "$$d"; then \
		$(ECHO) === $$d ===; \
		$(MAKEF) -C $$d $@ || exit $$?; \
	    fi; \
	done

MAN_MAKERULE = \
    @for f in *.[12345678] ""; do \
	if test ! -z "$$f"; then \
	    $(GZIP) -c < $$f > $$f.gz; \
	fi; \
    done

INSTALL_MAN = \
    @for d in $(MAN_PAGES); do \
	first=true; \
	for m in `$(CAS_AWK_PROG) '/^\.SH NAME/ {ok=1; next} ok {print; exit}' $$d \
	| sed -e 's/,/ /g' -e 's/\\-.*//' -e 's/\\\f[0-9]//g' -e 's/  / /g;q'`; \
	do \
	    [ -z "$$m" -o "$$m" = "\\" ] && continue; \
	    t=$(MAN_DEST)/$$m.$(MAN_SECTION); \
	    if $$first; then \
		u=$$m.$(MAN_SECTION); \
		echo $(INSTALL) -m 644 $$d $$t; \
		$(INSTALL) -m 644 $$d $$t; \
	    else \
		echo $(INSTALL) -S $$u $$t; \
		$(INSTALL) -S $$u $$t; \
	    fi; \
	    first=false; \
	done; \
    done

DIST_MAKERULE = \
	$(MAKEF) -C build rpm

SOURCE_MAKERULE = \
	@test -z "$$DIR" && DIR="."; \
	for f in $(SRCFILES) ""; do \
	    if test ! -z "$$f"; then $(ECHO) $$DIR/$$f; fi;\
	done; \
	for d in `echo $(SUBDIRS)` ; do \
	    if test -d "$$d" -a ! -z "$$d"; then \
		$(MAKEF) DIR=$$DIR/$$d -C $$d $@ || exit $$?; \
	    fi; \
	done

endif

#
# common build targets
COMMONTARGS = install

#
# For targets that should always be rebuilt,
# define a target that is never up-to-date.
# Targets needing this should depend on $(_FORCE)
_FORCE = __force_build

#
# Tools for use when packaging ISMs
#
MKSPEC	= perl -e '%v=%ENV;'						\
	-e 'foreach (@ARGV) {						\
		if (/(\S+)=(\S+)/) { $$v{$$1} = $$2; }			\
		else { $$v{$$_} = 1; }					\
	}'								\
	-e 'while (<STDIN>) {						\
		print,next if /^\s*\#/;'				\
	-e	'if (/^(.*)\$$\(([^)]+)\)(.*)$$/) {'			\
	-e		'if ($$v{$$2}) { print $$1.$$v{$$2}.$$3."\n"; }'\
	-e		'else { print STDERR "$$0 WARNING: no value for variable $$2\n"; \
				print $$_; }'		\
	-e	'} else { print $$_; }			\
	}'
		
				

MKRELNUM	= $(TOOLROOT)/usr/bin/mkreleasenum
CHKRPM		= $(TOOLROOT)/usr/bin/chkrpm

#
# Tools with flags
#
MKSPECF		= $(MKSPEC) $(MKSPECFLAGS)
MKRELNUMF	= $(MKRELNUM) $(MKRELNUMFLAGS)
CHKRPMF		= $(CHKRPM) $(CHKRPMFLAGS)


#
# Spec processing arguments.
#
# Add to the macro MKSPEC_ARGS any environment variables you
# would like to use in the spec. Here is the default set:
#
MKSPECFLAGS = $(MKSPECOPTS) $(SPECVARS)
SPECVARS = $(GSPECVARS) $(ISPECVARS) $(LSPECVARS) $(VSPECVARS)

GSPECVARS = \
	PACKAGE_NAME=$(PACKAGE_NAME) \
	PACKAGE_VERSION=$(PACKAGE_VERSION) \
	PKG_SOURCE_NAME=$(PKG_SOURCE_NAME) \
	PKG_RELEASE=$(PKG_RELEASE) \
	PKG_ARCH=$(PKG_ARCH) \
	PKG_BUILDER=$(PKG_BUILDER) \
	PKG_DIST=$(PKG_DIST)	\
	DIST_PREFIX=$(DIST_PREFIX)	\
	SYSADM_PREFIX=$(SYSADM_PREFIX)

ifndef SPEC
#SPEC = build/spec
SPEC = spec
endif
_RELNUM_FILE := .release_number
_RPMRC_FILE = $(PKG_ROOT)/rpmrc

#
# Package directories and macros
#
PKG_NAME	= $(PACKAGE_NAME)-$(PACKAGE_VERSION)
PKG_SOURCE_NAME = $(PKG_NAME).tar.gz
PKG_SPEC_NAME	= $(PKG_NAME).spec
ifndef PKG_RELEASE
PKG_RELEASE	= `cat $(_RELNUM_FILE)`
endif
ifndef PKG_ARCH
PKG_ARCH := $(shell $(RPM) --showrc | perl -e 'while (<>) {	\
	    if (/\s*build\s+arch\s*:\s*(\S+)/i) {		\
		print $$1;					\
		last;						\
	    }							\
	}')
endif
PKG_RPM_NAME	= $(PKG_NAME).$(PKG_ARCH).rpm


#
# Unfortunately RPM changed its external interface significantly
# between version 2.5.5 (Red Hat 5.2) and 3.0 (Red Hat 6.0). To
# control RPM we must know what version we are working with. This
# will tell us whether we need to control RPM with an rpmrc file
# (the old way) or using macros defined on the command line (the
# new way).
#
PKG_RPM_NEEDS_MACROS := $(shell $(RPM) --version | perl -e 'while (<>) {\
	    if (/(\d+)\.(\d+)(\.\d+)?/) {				\
		(($$1 > 2) || ($$1 == 2 && $$2 > 92)) ?			\
		    print "1" : print "0";				\
		last;							\
	    }								\
	}')

PKG_ROOT	= dist

PKG_SPEC_DIR	= $(PKG_ROOT)/SPECS
PKG_SOURCE_DIR	= $(PKG_ROOT)/SOURCES
PKG_BUILD_DIR	= $(PKG_ROOT)/BUILD
PKG_RPM_DIR	= $(PKG_ROOT)/RPMS/$(PKG_ARCH)
PKG_SRPM_DIR	= $(PKG_ROOT)/SRPMS
PKG_BUILD_ROOT	= $(PKG_ROOT)/install

ifndef BUILDER
BUILDER		= Developer `whoami` on machine `hostname`
endif
PKG_BUILDER	= "$(BUILDER)"
PKG_DIST	= "$(PACKAGE_DISTRIBUTION)"

ifeq ($(PKG_RPM_NEEDS_MACROS),1)
PKG_OPTS	= -ba \
		  --define "buildroot $(shell pwd)/$(PKG_BUILD_ROOT)" \
		  --define "_topdir $(shell pwd)/$(PKG_ROOT)"
else
PKG_OPTS	= -ba --rcfile $(_RPMRC_FILE)
endif
PKG_CMD		= $(RPMF) $(PKG_OPTS)

#
# Macros for building up the list of sources to package.
#
_TAR_LIST := $(shell pwd)/$(PKG_ROOT)/tar-list

XDIRT = $(_TAR_LIST) $(_RELNUM_FILE)

_TAR_MAKERULE = \
	@terrstat=0; \
	echo "-- Creating source tar list"; \
	$(MAKEF) _TAR_LIST=$(_TAR_LIST) _SUBDIR_PATH="" tar-list \
		|| terrstat=$$?; \
	test $$terrstat -eq 0

#
# ################# Package specific macros - BEGIN

###### standard names

CASNAME	= cluster_admin
CINAME	= cluster_services
FSNAME	= failsafe

#
# Anything that the Package developer wants available to all
# Makefiles in the Package.


# Used by all the Makefiles for Linux to have a common 
# place where all headers and Libraries are stored.
# NOTE: we have to use absolute path in order the linux_rep dir
# to be available for the pristine source
ifndef FS_REPOSITORY
FS_REPOSITORY=/tmp/fs_repository
endif
REP_INCDIR=$(FS_REPOSITORY)/inc
REP_LIBDIR=$(FS_REPOSITORY)/lib

DIST_PREFIX=/usr/lib/failsafe
SYSADM_PREFIX=/usr/lib/sysadm

# General package information - how are these different from the above,
# where are both used ??
CAS_PACKAGE_NAME = cluster_admin
CI_PACKAGE_NAME = cluster_services

#
# IMPORTANT: we do not want the binaries to
# be stripped when building the RPM (for debugging purpose).
# So we set the macro NOSTRIP, which is a facility of SGI build
NOSTRIP = 1

######## General Package specific macros - END

######## CAS Package specific macros - BEGIN

# standard directories for installation, configuration and etc.

CAS_VERSION	= $(PACKAGE_VERSION)

# directory for rc/startup scripts
CAS_RC_DIR	= /etc/rc.d/init.d

# directory for sysconfig controls
CAS_ETC_DIR	= /etc/failsafe
CAS_CONFIG_DIR	= $(CAS_ETC_DIR)/config

# directory for public administrator binaries
PUB_BIN_DIR	= /usr/bin
PUB_SBIN_DIR	= /usr/sbin

# directory for runtime shared libraries, libcas.so, etc.
CAS_SHARE_DIR	= /usr/lib/failsafe
CAS_LIB_DIR	= $(CAS_SHARE_DIR)/lib
# directory for CAM libraries
CAS_PRIV_LIB	= $(CAS_SHARE_DIR)/libcam

# directory for private CAS binaries
CAS_BIN_DIR	= $(CAS_SHARE_DIR)/bin

# directory for CLI and GUI privbin commands
CAS_BINADM_DIR	= /usr/lib/sysadm/privbin

# directory for demo software
CAS_GIFT_DIR	= $(CAS_SHARE_DIR)/src

# directory for headers
CAS_INC_DIR	= /usr/include/cluster

# parent directory for man pages
PUB_MAN_DIR	= /usr/share/man
CAS_MAN_DIR	= $(PUB_MAN_DIR)/man1

# directory for persistent non-shared (i.e. system local) CAS files
CAS_STATE_DIR	= /var/lib/failsafe

# directory for volatile non-shared (i.e. system local) CAS files
CAS_VAR_DIR	= /var/run/failsafe

# directory for CAS logs
CAS_LOG_DIR	= /var/log/failsafe

# directory for CAS documentation
CAS_DOC_DIR	= /usr/share/doc/$(PKG_NAME)

###### end of directory paths

######## CAS Package specific macros - END



###### CI Package specific macros - BEGIN

###### standard directories for installation, configuration and etc.

CI_VERSION	= $(PACKAGE_VERSION)

# directory for rc/startup scripts
CI_RC_DIR	= /etc/rc.d/init.d

# directory for sysconfig controls
CI_ETC_DIR	= /etc/failsafe
CI_CONFIG_DIR	= $(CI_ETC_DIR)/config

# directory for public binaries
PUB_BIN_DIR	= /usr/bin
PUB_SBIN_DIR	= /usr/sbin

# directory for runtime shared libraries, libci.so, etc.
CI_SHARE_DIR	= /usr/lib/failsafe
CI_LIB_DIR	= $(CI_SHARE_DIR)/lib

# directory for shared CI files (shareable for diskless)
CI_PRIV_LIB	= $(CI_SHARE_DIR)/libcam

# directory for private CI binaries
CI_BIN_DIR	= $(CI_SHARE_DIR)/bin

# directory for CLI and GUI privbin commands
CI_BINADM_DIR	= /usr/lib/sysadm/privbin

# various private directories
CI_CMGRSCRIPT_DIR = $(CI_SHARE_DIR)/cmgr-scripts
CI_TEMPLATE_DIR	= $(CI_SHARE_DIR)/cmgr-templates
CI_RESOURSE_DIR	= $(CI_SHARE_DIR)/resource_types
CI_COMMSCRIPT_DIR = $(CI_SHARE_DIR)/common_scripts
CI_PROCGROUP_DIR = $(CI_ETC_DIR)/cmon_process_groups

# directory for demo software
CI_GIFT_DIR	= $(CI_SHARE_DIR)/src

# directory for headers
CI_INC_DIR	= /usr/include/cluster

# parent directory of man pages
PUB_MAN_DIR	= /usr/share/man
CI_MAN_DIR	= $(PUB_MAN_DIR)/man1

# directory for persistent non-shared (i.e. system local) files
CI_STATE_DIR	= /var/lib/failsafe

# directory for non-shared (i.e. system local) files
CI_VAR_DIR	= /var/run/failsafe

# directory for CI logs
CI_LOG_DIR	= /var/log/failsafe

# directory for CI temp files
CI_TMP_DIR	= /var/tmp

# directory for CI documentation
CI_DOC_DIR	= /usr/share/doc/$(PKG_NAME)

# directory for CI demos and examples
CI_DEMOS_DIR	= /usr/lib/failsafe/demos

######## CI Package specific macros - END

# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

###### failsafe Package specific macros - BEGIN
###### standard directories for installation, configuration and etc.

FAILSAFE_VERSION	= $(PACKAGE_VERSION)

# directory for rc/startup scripts
FAILSAFE_RC_DIR	= /etc/rc.d/init.d

# directory for sysconfig controls
FAILSAFE_ETC_DIR	= /etc/failsafe
FAILSAFE_CONFIG_DIR	= $(FAILSAFE_ETC_DIR)/config

# directory for public binaries
PUB_BIN_DIR	= /usr/bin
PUB_SBIN_DIR	= /usr/sbin

# directory for runtime shared libraries, libci.so, etc.
FAILSAFE_SHARE_DIR	= /usr/lib/failsafe
FAILSAFE_LIB_DIR	= $(FAILSAFE_SHARE_DIR)/lib

# directory for shared FAILSAFE files (shareable for diskless)
FAILSAFE_PRIV_LIB	= $(FAILSAFE_SHARE_DIR)/libcam

# directory for private FAILSAFE binaries, etc
FAILSAFE_BIN_DIR	= $(FAILSAFE_SHARE_DIR)/bin
FAILSAFE_TEMPLATE_DIR	= $(FAILSAFE_SHARE_DIR)/cmgr-templates
FAILSAFE_POLICY_DIR	= $(FAILSAFE_SHARE_DIR)/policies

# directory for CLI and GUI privbin commands
FAILSAFE_BINADM_DIR	= /usr/lib/sysadm/privbin

# various private directories
FAILSAFE_PROCGROUP_DIR	= $(FAILSAFE_ETC_DIR)/cmon_process_groups

# directory for demo software
FAILSAFE_GIFT_DIR	= $(FAILSAFE_SHARE_DIR)/src

# directory for headers
FAILSAFE_INC_DIR	= /usr/include/cluster

# parent directory of man pages
PUB_MAN_DIR		= /usr/share/man
FAILSAFE_MAN_DIR	= $(PUB_MAN_DIR)/man1

# directory for persistent non-shared (i.e. system local) files
FAILSAFE_STATE_DIR	= /var/lib/failsafe

# directory for non-shared (i.e. system local) files
FAILSAFE_VAR_DIR	= /var/run/failsafe

# directory for FAILSAFE logs
FAILSAFE_LOG_DIR	= /var/log/failsafe

# directory for FAILSAFE temp files
FAILSAFE_TMP_DIR	= /var/tmp

# directory for FAILSAFE documentation
FAILSAFE_DOC_DIR	= /usr/share/doc/$(PKG_NAME)

###### end of directory paths
######## failsafe Package specific macros - END