#
# Description:  Makefile for v775Lib.o
#   This driver is specific to VxWorks BSPs and must be compiled
#   with access to vxWorks headers.
#

#Check Operating system we are using
ifndef OSNAME
  OSNAME := $(subst -,_,$(shell uname))
endif

ifndef ARCH
  ARCH = VXWORKSPPC
endif

ifeq ($(OSNAME),SunOS)
LIBDIR = $(CODA)/$(ARCH)/lib

ifeq ($(ARCH),VXWORKSPPC)
INCDIR=/site/vxworks/5.5/ppc/target/h
CC = ccppc
LD = ldppc
DEFS = -mcpu=604 -DCPU=PPC604 -DVXWORKS -D_GNU_TOOL -DVXWORKSPPC
INCS = -Wall -fno-for-scope -fno-builtin -fvolatile -fstrength-reduce -mlongcall -I. -I$(INCDIR)

endif

ifeq ($(ARCH),VXWORKS68K51)
INCDIR=/site/vxworks/5.3/68k/target/h
CC = cc68k
DEFS = -DCPU=MC68040 -DVXWORKS -DVXWORKS68K51
INCS = -Wall -mc68020 -fvolatile -fstrength-reduce -nostdinc -I. -I$(INCDIR)
endif


CFLAGS = -O $(DEFS)

endif


all: echoarch c775Lib.o v775_readout.o

c775Lib.o: caen775Lib.c c775Lib.h
	$(CC) -c $(CFLAGS) $(INCS) -o $@ caen775Lib.c

v775_readout.o: v775_readout.c c775Lib.h
	$(CC) -c $(CFLAGS) $(INCS) -o $@ v775_readout.c

clean:
	rm -f *.o

echoarch:
	echo "Make for $(ARCH)"
