# # Description: Makefile for f1tdcLib.o # This driver is specific to VxWorks BSPs and must be compiled # with access to vxWorks headers. # ARCH=Linux #Check Operating system we are using ifndef OSNAME OSNAME := $(subst -,_,$(shell uname)) endif ifndef ARCH ARCH = VXWORKSPPC endif ifndef WIND_BASE WIND_BASE = /site/vxworks/5.5/ppc endif ifeq ($(OSNAME),SunOS) CODALIB = $(CODA)/$(OSNAME)/lib CODAINC = $(CODA)/common/include CFLAGS = -O $(DEFS) endif ifeq ($(OSNAME),Linux) FWFILE_V2 = $(shell cat .currentfw_v2) FWFILE_V3 = $(shell cat .currentfw_v3) FWFILES = ${FWFILE_V2} ${FWFILE_V3} LINUXVME_LIB ?= ${CODA}/linuxvme/lib LINUXVME_INC ?= ${CODA}/linuxvme/include LINUXVME_BIN ?= ${CODA}/linuxvme/bin LINUXVME_FW ?= ${CODA}/linuxvme/firmware CODALIB = $(CODA)/$(OSNAME)/lib CODAINC = $(CODA)/common/include CFLAGS = -O $(DEFS) -Wall -O2 \ -I${LINUXVME_INC} -I. \ -L${LINUXVME_LIB} -L. -DJLAB CFLAGS += -g AR = ar RANLIB = ranlib endif ifeq ($(ARCH),VXWORKSPPC) INCDIR=$(WIND_BASE)/target/h CC = ccppc LD = ldppc DEFS = -mcpu=604 -DCPU=PPC604 -DVXWORKS -D_GNU_TOOL -DVXWORKSPPC INCS = -fno-for-scope -fno-builtin -fvolatile -fstrength-reduce -mlongcall -I. -I$(CODAINC) -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 PROGS = f1FirmwareUpdate f1GFirmwareUpdate all: echoarch $(PROGS) f1FirmwareUpdate: f1FirmwareUpdate.c $(CC) $(CFLAGS) -o $@ $(@:%=%.c) $(LIBS_$@) -lrt -ljvme \ -lf1tdc -lti f1GFirmwareUpdate: f1GFirmwareUpdate.c $(CC) $(CFLAGS) -o $@ $(@:%=%.c) $(LIBS_$@) -lrt -ljvme \ -lf1tdc install: $(PROGS) @echo "Installing $(PROGS)" @install -v -d $(LINUXVME_BIN) @install -v -p $(PROGS) -D $(LINUXVME_BIN)/ fwinstall: @ln -sf $(FWFILE_V2) f1tdc_v2_current_firmware.mcs @ln -sf $(FWFILE_V3) f1tdc_v3_current_firmware.mcs @install -v -d $(LINUXVME_FW)/f1tdc @install -p -m 664 -v $(FWFILES) \ f1tdc_v2_current_firmware.mcs f1tdc_v3_current_firmware.mcs \ -D $(LINUXVME_FW)/f1tdc/ clean: rm -f $(PROGS) *~ echoarch: echo "Make for $(ARCH)"