# # # in case XILHOME is active, use it, otherwise, # use the the system programmer release # HOMEDIR=if [ "$(XILHOME)" ]; \ then \ echo $(XILHOME); \ else \ echo "/opt/SUNWits/Graphics-sw/xil"; \ fi; XILHOMEDIR=$(HOMEDIR:sh) ARCH=${TARGET_ARCH:-%=%} PGM=${ARCH}/display EXAMPLE_DATA=toys.header toys.data # C++ source names, if any, go here -- minus the .c or .cc CC_PIECES= \ display \ fileio \ window CC_FILES=$(CC_PIECES:%=%.c) CC_O_FILES=$(CC_PIECES:%=${ARCH}/%.o) #H_FILES= SRCS=$(CC_FILES) $(H_FILES) OBJS=$(CC_O_FILES) # You may get better performance with these 2.0.1 flags # OPTFLAGS = -xcg89 -Wa,-cg92 CCFLAGS = $(OPTFLAGS) CPPFLAGS = -I$(XILHOMEDIR)/include -I/usr/openwin/include # point to the installed XIL library LD_LIBS = -L$(XILHOME)/lib -L$(OPENWINHOME)/lib LDFLAGS = -R/opt/SUNWits/Graphics-sw/xil/lib:/usr/openwin/lib install := LD_LIBS += -lxil -lX11 -ldl -ldga -lthread install: ${ARCH} ${PGM} $(EXAMPLE_DATA) debug_install := LD_LIBS += -lxil -lX11 -ldl -ldga -lthread debug_install := CCFLAGS += -g debug_install: ${ARCH} ${PGM} $(EXAMPLE_DATA) debug: debug_install ${ARCH}: test -d ${ARCH} || /usr/bin/mkdir ${ARCH} ${ARCH}/%.o: %.c $(CC) $(CCFLAGS) $(CPPFLAGS) -c -o $@ $< $(PGM): $(SRCS) $(OBJS) $(CC) -o $@ $(OBJS) $(LDFLAGS) $(LD_LIBS) clean: rm -f a.out core $(PGM) $(OBJS) # Won't work unless building within the project domains toys.data: @if [ "$(EX_DATA_DIR)" ]; then \ echo "Linking $@..." ; \ ln -s $(EX_DATA_DIR)/images/$@ . ; \ else \ if [ -f $(XIL_DATA_DIR)/images/$@ ]; then \ echo "Copying $@..." ; \ cp -p $(XIL_DATA_DIR)/images/$@ . ; \ else \ echo "Cannot install $@" ; \ fi ; \ fi ; \