#
# Linux Makefile template
#
#
# $Id$
#
include ../Makefile.config
@AUTODEPRULE_SUBDIR@

CXXFLAGS += -I@top_srcdir@

OBJS = \
cpumeter.o \
memmeter.o \
swapmeter.o \
pagemeter.o \
netmeter.o \
nfsmeter.o \
intmeter.o \
loadmeter.o \
btrymeter.o \
diskmeter.o \
raidmeter.o \
lmstemp.o \
MeterMaker.o

FAIL_ARCHS = arm m68k powerpc s390 sparc 3D s390x powerpc64

# Test for arm specifically, because arm can show up as a number of
# things prefixed by "arm"
# This means that no return value for host_cpu that contains a
# substring of "arm" will ever have a serialmeter.  Oh well.
#
# With the ioperm checks in serialmeter.cc, this should no longer be
# necessary.  In fact, it may no longer be necessary to perform this
# check at all, but it is left here just in case until this can be
# tested.
#
# ifneq (,$(findstring arm, @host_cpu@))
# ARCH = arm
# else
# ARCH = @host_cpu@
# endif

ARCH = @host_cpu@

ifneq (,$(findstring $(ARCH), $(FAIL_ARCHS)))
# Don't include serialmeter for above architectures
else
OBJS += serialmeter.o
endif

CFILES := $(OBJS:.o=.cc)
DEPFILES := $(OBJS:%=.%.d)

vpath %.h $(TOP)
vpath %.cc $(TOP)

#-----------------------------------------------------------------------

all : libmeter.a @MEMSTAT@

MemStat:
	$(MAKE) -C memstat

clean :
	rm -f $(OBJS) $(DEPFILES) libmeter.a *~
	if test "@MEMSTAT@" = "MemStat"; then $(MAKE) -C memstat clean; fi

libmeter.a : $(OBJS)
	ar cvr libmeter.a $(OBJS)
	@RANLIB@ $@

@AUTODEPEND@


syntax highlighted by Code2HTML, v. 0.9.1