#
# Description:  Makefile for C-RAMS Library and Micro strip detector library
#   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
CFLAGS = -O $(DEFS)

ifeq ($(ARCH),VXWORKSPPC)
INCDIR=/usr/local/tornado/ppc2/target/h
CC = ccppc
DEFS = -mcpu=604 -DCPU=PPC604 -DVXWORKS -D_GNU_TOOL -DVXWORKSPPC
INCS = -Wall -fno-for-scope -fno-builtin -fvolatile -fstrength-reduce -nostdinc -I. -I$(INCDIR)

endif

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

endif


all: echoarch c-ramsLib.o

c-ramsLib.o: c-ramsLib.c c-rams.h
	$(CC) -c $(CFLAGS) $(INCS) -o $@ c-ramsLib.c

clean:
	rm -f *.o

echoarch:
	echo "Make for $(ARCH)"
