TARGET	= vme58
DEBUG	= 1
CC 	= /usr/bin/m68k-linux-gcc

ifdef DEBUG
  # -O is needed because of "extern inline"
  # Add -g if your gdb is patched and can use it
  CFLAGS = -I/usr/include/m68k-linux/ -I./ -O -DVME58 \
           -D__KERNEL__ -Wall
else
  CFLAGS = -I/usr/include/m68k-linux/ -I./ -O3 -DVME58 \
           -D__KERNEL__ -Wall -fomit-frame-pointer
endif

all:	$(TARGET).o test threads

vme58.o:	oms.c oms.h
	$(CC) -c $(CFLAGS) -o vme58.o oms.c

#CFLAGS   = -g -Wall -DVME58 -DANSI=1 -DLINUX=1 -I./
#CC       = gcc
 
# linking executables...
 
test:	test.o omslib.o
	$(CC) ${CFLAGS} ${LFLAGS} -o test test.o omslib.o

threads:	threads.o omslib.o
	$(CC) ${CFLAGS} ${LFLAGS} -lpthread -o threads threads.o omslib.o

threads.o:	threads.c omslib.h

test.o:	test.c omslib.h

omslib.o:	omslib.c omslib.h

clean:
	rm test test.o omslib.o
