# This makefile has been tuned to compile the VS4 VME motor controller # driver and corresponding client programs for the Hall-D FDC laser # scaning system. # # July 7,2008 D. Lawrence # OS = $(shell uname) ifeq ($(OS), Darwin) CC = ppc-vxworks-gcc CXX = ppc-vxworks-g++ LD = ppc-vxworks-ld INCS = -I/usr/local/vxworks/lib/gcc/ppc-vxworks/3.4.1/include else WIND_BASE = /group/da/tornado2.2/ppc WIND_HOST_TYPE = x86-linux CC = ccppc CXX = c++ppc LD = ldppc INCS = -I$(WIND_BASE)/host/$(WIND_HOST_TYPE)/lib/gcc-lib/powerpc-wrs-vxworks/gcc-2.96/include endif # This path is used to make sure both gcc and as (binutils) # are used from the cross-compiler rather than from the native one path = .:$(WIND_BASE)/host/$(WIND_HOST_TYPE)/bin:$(CODA_BIN):/usr/local/vxworks/bin:/usr/bin:/bin SHELL = /bin/bash DEFINES = -DVXWORKS -DVXWORKSPPC -DCPU=PPC604 -D_GNU_TOOL INCS += -I$(WIND_BASE)/target/h CFLAGS = -O -mcpu=604 -nostdinc -fno-writable-strings -mlongcall\ -mstrict-align -ansi $(DEFINES) OBJS = vs4.o fdc_laser.o all: $(OBJS) @echo " " @echo "Done making $(OBJS)." @echo " " vs4.o: vs4.c vs4.h @echo compiling vs4.c ... export PATH=$(path) ; $(CC) -c $(CFLAGS) vs4.c $(INCS) -o vs4.o @echo made vs4.o @echo " " fdc_laser.o: fdc_laser.cc vs4.h @echo compiling fdc_laser.cc ... export PATH=$(path) ; $(CXX) -c $(CFLAGS) fdc_laser.cc $(INCS) -o fdc_laser.o @echo made fdc_laser.o @echo " " install: fdc_laser.o vs4.o ifeq ($(OS), Darwin) cp fdc_laser.* vs4.* /Volumes/"NO NAME" else @echo @echo "make install not implemented on Linux" @echo endif clean: rm -f $(OBJS) env: @echo OS=$(OS)