# on Intel systems use PENTIM_TIMER (uses the RDTSC instruction)
# on other systems (ALPHA,SPARC,PPC) use GENERIC_TIMER (uses gettimeofday() )


#TIMER_OPTIONS=-DUSE_GENERIC_TIMER

TIMER_OPTIONS=-DUSE_PENTIUM_TIMER

# BUILD_ALSA5=1
BUILD_ALSA9=1

ifeq (1,$(BUILD_ALSA5))
ALSA_DEFS = -DBUILD_ALSA5
ALSA_LIBS = -lasound
endif

ifeq (1,$(BUILD_ALSA9))
ALSA_DEFS = -DBUILD_ALSA9
ALSA_LIBS = -lasound -ldl
endif

CC=gcc
#CCOPTS=-Wall -O -D_REENTRANT
CFLAGS=-Wall -O2 $(TIMER_OPTIONS) $(ALSA_DEFS)

all: latencytest rtc_latencytest # cpu_latency


latencytest:	latencytest.o gfx.o
	$(CC) $(CFLAGS) -o $@ latencytest.o gfx.o $(ALSA_LIBS) -lm -lgd

rtc_latencytest:	rtc_latencytest.o gfx.o
	$(CC) $(CFLAGS) -o $@ rtc_latencytest.o gfx.o $(ALSA_LIBS) -lm -lgd

clean:
	rm -f *.o latencytest rtc_latencytest cpu_latency core

