# # File: # Makefile # # Description: # Makefile for the JLAB extensions to the GEFANUC Controller API # # # $Date$ # $Rev$ # ifndef ARCH ifdef LINUXVME_LIB ARCH=Linux else ARCH=VXWORKSPPC endif endif FWFILES = $(shell cat .currentfw) # 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 = tdFirmwareUpdate.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 = tdFirmwareUpdate 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 -ltd ifeq ($(ARCH),VXWORKSPPC) tdFirmwareUpdate.o: tdFirmwareUpdate.c @echo "Making $@ for $(ARCH)" $(CC) $(CFLAGS) -c -DTEMPE -o $@ $(<) $(CC) $(CFLAGS) -c -o $(@:.o=_univ.o) $(<) else install: $(PROGS) @echo "Installing $(PROGS)" @install -v -d $(LINUXVME_BIN) @install -v -p $(PROGS) -D $(LINUXVME_BIN)/ fwinstall: @ln -sf $(FWFILES) td_current_firmware.svf @install -v -d $(LINUXVME_FW)/td @install -p -m 664 -v $(FWFILES) td_current_firmware.svf -D $(LINUXVME_FW)/td endif .PHONY: all clean