GNUmakefile 3.67 KB
#!smake
#
# local all inclusive Makefile for Project Reality diags
#

DIAGSDEPTH=..
PRDEPTH=../..
include $(PRDEPTH)/PRdefs
CC=$(HOST_CC)
GCINCS=
GLDOPTS=

AIDIR = $(DIAGSDEPTH)/ai
COMMONDIR = $(DIAGSDEPTH)/common
IODIR = $(DIAGSDEPTH)/io
NDEVDIR = $(DIAGSDEPTH)/ndev
PIDIR = $(DIAGSDEPTH)/pi
RDPDIR = $(DIAGSDEPTH)/rdp
RDRAMDIR = $(DIAGSDEPTH)/rdram
RSPDIR = $(DIAGSDEPTH)/rsp
SIDIR = $(DIAGSDEPTH)/si
VIDIR = $(DIAGSDEPTH)/vi

DIAGCMD = prcmd
TARGET = u64ide

AIOBJS =			\
	$(AIDIR)/ai.o		\
	$(AIDIR)/ai_regtests.o	\
	$(AIDIR)/ai_pintests.o	\
	$(AIDIR)/ai_sounds.o

COMMONOBJS =				\
	$(COMMONDIR)/examineMem.o	\
	$(COMMONDIR)/rdpDump.o		\
	$(COMMONDIR)/reg.o

IOOBJS = $(IODIR)/io.o

NDEVOBJS = $(NDEVDIR)/ndev_bcopy.o	\
	$(NDEVDIR)/ndev_bzero.o		\
	$(NDEVDIR)/ndev_memtest.o

PIOBJS = $(PIDIR)/pi.o

RDPOBJS = $(RDPDIR)/rdp.o	\
	$(RDPDIR)/rdp_dl.o

RDRAMOBJS = $(RDRAMDIR)/rdram.o

RSPOBJS = $(RSPDIR)/rsp.o			\
	$(RSPDIR)/rspcor.o			\
	$(RSPDIR)/rspcor1.o			\
	$(RSPDIR)/rsp_regr_common.o		\
	$(RSPDIR)/rsp_regr_dummy.o		\
	$(RSPDIR)/rsp_regr_su_alu.o		\
	$(RSPDIR)/rsp_regr_su_br.o		\
	$(RSPDIR)/rsp_regr_su_cp2.o		\
	$(RSPDIR)/rsp_regr_su_ld.o		\
	$(RSPDIR)/rsp_regr_su_log.o		\
	$(RSPDIR)/rsp_regr_su_sh.o		\
	$(RSPDIR)/rsp_regr_su_st.o		\
	$(RSPDIR)/rsp_regr_vu_abs.o		\
	$(RSPDIR)/rsp_regr_vu_add.o		\
	$(RSPDIR)/rsp_regr_vu_cmp.o		\
	$(RSPDIR)/rsp_regr_vu_dp_recp.o		\
	$(RSPDIR)/rsp_regr_vu_dp_sqrt.o		\
	$(RSPDIR)/rsp_regr_vu_ld.o		\
	$(RSPDIR)/rsp_regr_vu_log.o		\
	$(RSPDIR)/rsp_regr_vu_mac.o		\
	$(RSPDIR)/rsp_regr_vu_mad.o		\
	$(RSPDIR)/rsp_regr_vu_mov.o		\
	$(RSPDIR)/rsp_regr_vu_mrg.o		\
	$(RSPDIR)/rsp_regr_vu_mud.o		\
	$(RSPDIR)/rsp_regr_vu_mul.o		\
	$(RSPDIR)/rsp_regr_vu_rnd.o		\
	$(RSPDIR)/rsp_regr_vu_rom_tests.o	\
	$(RSPDIR)/rsp_regr_vu_sax.o		\
	$(RSPDIR)/rsp_regr_vu_sp_recp.o		\
	$(RSPDIR)/rsp_regr_vu_sp_sqrt.o		\
	$(RSPDIR)/rsp_regr_vu_st.o		\
	$(RSPDIR)/rsp_regr_vu_sub.o		\
	$(RSPDIR)/rsp_regr_vu_vcx.o		\
	$(RSPDIR)/rsp_regr_pipe.o		\
	$(RSPDIR)/rsp_regr_dma.o		\
	$(RSPDIR)/rsp_other_ucode.o		\
	$(RSPDIR)/rsp_other.o

SIOBJS = $(SIDIR)/si.o				\
 	$(SIDIR)/si_controller.o

VIOBJS = $(VIDIR)/vi.o

CFILES = $(DIAGCMD).c stubs.c rev.o

LOCALOBJS = $(DIAGCMD).o stubs.o rev.o

OBJECTS = $(AIOBJS) $(COMMONOBJS) $(IOOBJS) $(NDEVOBJS) $(PIOBJS) $(RDRAMOBJS) \
	$(RSPOBJS) $(SIOBJS) $(VIOBJS) $(LOCALOBJS) $(RDPOBJS)

IDEAWKSCRIPT=$(PRDEPTH)/diags/ide/builtins.awk

LIBDG= $(ROOT)/usr/lib/PR/libdg.a
LIBIDE= $(PRDEPTH)/diags/ide/libide.a

LCOPTS=	-g
STDINC=	$(ROOT)/usr/include
IDEINC=	$(ROOT)/usr/include/ide
PRINC=	$(PRDEPTH)/include

LCINCS=	-I$(PRINC) -I$(STDINC) -I$(IDEINC)

LLDOPTS = -L$(ROOT)/usr/lib/PR -L$(PRDEPTH)/diags/ide
LLDLIBS = -ldg -lide

$(TARGET): $(OBJECTS)
	echo "OBJECTS= $(OBJECTS)"
	$(CC) -o $@ $(OBJECTS) $(LDFLAGS)

$(DIAGCMD).awk: Makefile $(AIDIR)/aicmd.awk $(COMMONDIR)/commoncmd.awk \
	$(IODIR)/iocmd.awk $(NDEVDIR)/ndevcmd.awk $(PIDIR)/picmd.awk \
	$(RDPDIR)/rdpcmd.awk $(RDRAMDIR)/rdramcmd.awk $(RSPDIR)/rspcmd.awk \
	$(SIDIR)/sicmd.awk $(VIDIR)/vicmd.awk
	cat $(AIDIR)/aicmd.awk $(COMMONDIR)/commoncmd.awk \
	    $(IODIR)/iocmd.awk $(NDEVDIR)/ndevcmd.awk $(PIDIR)/picmd.awk \
	    $(RDPDIR)/rdpcmd.awk $(RDRAMDIR)/rdramcmd.awk \
	    $(RSPDIR)/rspcmd.awk $(SIDIR)/sicmd.awk \
	    $(VIDIR)/vicmd.awk \
	| sed -e '/^#/d' > $(DIAGCMD).awk

# generate the commands source file
$(DIAGCMD).c: $(DIAGCMD).awk
	$(NAWK) -v FILENAME=$(DIAGCMD).awk -F'\t[\t ]*' -f $(IDEAWKSCRIPT) $(DIAGCMD).awk > $@


rev.o: _forcerev

_forcerev:
	/bin/sh rev.sh $(RELEASE) > rev.c
	$(CC) $(CFLAGS) -c rev.c

default: $(TARGET)

install : default
	$(INSTALL) -F /usr/diags/bin $(TARGET) u64ide.script u64cor.script

clobber: clean
	rm -f $(TARGET) Makedepend rev.c $(DIAGCMD).c $(DIAGCMD).awk

clean:
	rm -f $(LOCALOBJS)