# # File: # Makefile # # Description: # Makefile CTP Firmware Updating program # # ifndef ARCH ifdef LINUXVME_LIB ARCH=Linux else ARCH=VXWORKSPPC endif endif FWFILES = $(shell cat .currentfw) U1FWFILE = $(shell cat .currentfw | grep U1) U3FWFILE = $(shell cat .currentfw | grep U3) # Defs and build for VxWorks ifeq ($(ARCH),VXWORKSPPC) VXWORKS_ROOT = /site/vxworks/5.5/ppc/target CC = ccppc LD = ldppc DEFS = -mcpu=604 -DCPU=PPC604 -DVXWORKS -D_GNU_TOOL -mlongcall \ -fno-for-scope -fno-builtin -fvolatile -DVXWORKSPPC INCS = -I. -I../ -I$(VXWORKS_ROOT)/h -I$(VXWORKS_ROOT)/h/rpc -I$(VXWORKS_ROOT)/h/net CFLAGS = $(INCS) $(DEFS) OBJS = ctpFirmwareUpdate.o PROGS = endif #ARCH=VXWORKSPPC# # Defs and build for Linux ifeq ($(ARCH),Linux) LINUXVME_LIB ?= ../../libs LINUXVME_INC ?= ../../include LINUXVME_BIN ?= ../../bin LINUXVME_FW ?= ../../firmware CC = $(CROSS_COMPILE)gcc AR = ar RANLIB = ranlib CFLAGS = -Wall -O2 -I${LINUXVME_INC} -I. -I/usr/include \ -L${LINUXVME_LIB} -L. OBJS = PROGS = ctpFirmwareUpdate endif ifeq ($(ARCH),VXWORKSPPC) all: $(OBJS) else all: $(PROGS) endif clean: @rm -vf $(PROGS) $(OBJS) *~ %: %.c @echo "Making $@ for $(ARCH)" $(CC) $(CFLAGS) -o $@ $(@:%=%.c) -lrt -ljvme -lti -lctp ifeq ($(ARCH),VXWORKSPPC) ctpFirmwareUpdate.o: ctpFirmwareUpdate.c @echo "Making $@ for $(ARCH)" $(CC) $(CFLAGS) -c -o $@ $(<) else install: $(PROGS) @echo "Installing $(PROGS)" @install -v -d $(LINUXVME_BIN) @install -v -p $(PROGS) -D $(LINUXVME_BIN)/ fwinstall: @ln -sf $(U1FWFILE) ctp_current_firmware_U1.mcs @ln -sf $(U3FWFILE) ctp_current_firmware_U3.mcs @install -v -d $(LINUXVME_FW)/ctp @install -p -m 664 -v $(FWFILES) ctp_current_firmware*.mcs -D $(LINUXVME_FW)/ctp test: $(FWFILES) @echo $(FWFILES) endif .PHONY: all clean