#! gmake
#
# Copyright (c) 2000,2003,2004 Silicon Graphics, Inc.  All Rights Reserved.
# 
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
# 
# 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.,
# 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
# 
# Contact information: Silicon Graphics, Inc., 1500 Crittenden Lane,
# Mountain View, CA 94043, USA, or: http://www.sgi.com
#
# $Id: GNUmakefile,v 1.56 2005/07/10 06:57:52 kenmcd Exp $
#

TOPDIR = ../..
include $(TOPDIR)/src/include/builddefs
-include ./GNUlocaldefs

# This is the list of PMDAs which is supported on all platforms
# or at least for which it is safe to descend into these directories
# on all platforms ... if you want the source to be in the open
# source release, you need to be on this list and make sure you
# export the sources, even if you don't make any binaries on some
# platforms. The src tarball is always created on Linux. Hence the
# non-linux platform PMDAs (darwin, windows, solaris, aix, etc) are
# always present in SUBDIRS. Each is responsible for handling
# the "default" and "install" targets, even on Linux.
#
SUBDIRS = pmcd \
	sample simple trivial weblog sendmail mailq txmon \
	news cisco trace apache shping mounts darwin windows \
	solaris aix summary hotproc jstat

ifeq "$(TARGET_OS)" "linux" 
# PMDAs that only work on Linux.
SUBDIRS += linux lmsensors process roomtemp
endif

LDIRT = pmcd.conf

default :: default_pcp

default_pcp : $(SUBDIRS)
	@echo '# Performance Metrics Domain Specifications' > pmcd.conf
	@echo '# ' >> pmcd.conf
	@echo '# This file is automatically generated during the build' >> pmcd.conf
	@echo '# Name  Id      IPC     IPC Params      File/Cmd' >> pmcd.conf
	$(SUBDIRS_MAKERULE)

install :: install_pcp 

install_pcp :: $(SUBDIRS)
	$(SUBDIRS_MAKERULE)

install_pcp :: default_pcp
	$(INSTALL) -m 755 -d `dirname $(PCP_PMCDCONF_PATH)`
	$(INSTALL) -m 644 pmcd.conf $(PCP_PMCDCONF_PATH)

include $(BUILDRULES)
