#
# specify target machine ( for now only ./linux works real well )
# The ./hpux target will require you to edit some things in xosview.cc
#
# You can now have xosview use system calls rather than the /proc filesystem 
# for gathering some information.  This improves the overhead used by xosview
# quite a bit on my system.  To enable/disable this feature add/remove 
# '-DUSESYSCALLS' to DEFINES.
#
METERDIR = ./linux


EXE      = xosview
CXX      = g++ -m486
CXXFLAGS = -Wall -O3 -fomit-frame-pointer -finline-functions -fexpensive-optimizations -DDEBIAN 
DEFINES  = -DUSESYSCALLS
LFLAGS   = -s
LIBS     = -L/usr/X11R6/lib -lX11
IDIR     = -I./ -I$(METERDIR)
FEXT     = cc


OBJS = \
$(METERDIR)/cpumeter.o \
$(METERDIR)/memmeter.o \
$(METERDIR)/swapmeter.o \
$(METERDIR)/netmeter.o \
$(METERDIR)/netinmeter.o \
$(METERDIR)/netoutmeter.o \
$(METERDIR)/intmeter.o \
$(METERDIR)/serialmeter.o \
xwin.o \
meter.o \
fieldmeter.o \
bitmeter.o \
xosview.o \
main.o


CFILES := $(OBJS:.o=.cc)


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

all : $(EXE)

$(EXE) : $(OBJS) 
	$(CXX) $(LFLAGS) -o $(EXE) $(OBJS) $(LIBS)

$(EXE).purify : $(OBJS)
	purify -collector=/usr/local/gnu/lib/gcc-lib/hppa1.1-hp-hpux9/2.6.0/ld $(CXX) $(LFLAGS) -o $(EXE).purify $(OBJS) $(LIBS)

depend dep .depend :
	$(CXX) -MM $(DEFINES) $(IDIR) $(CFILES) > .depend

clean :
	rm -f .depend $(EXE) $(OBJS)

foo: foo.o
	$(CXX) $(LFLAGS) -o foo foo.o $(LIBS)

%.o : %.c
	$(CXX) $(CFLAGS) $(IDIR) -c $< -o $@
	
%.o : %.cc
	$(CXX) $(CXXFLAGS) $(DEFINES) $(IDIR) -c $< -o $@


-include .depend
