GNUmakefile 1.26 KB
#!/sbin/smake
#
# Makefile for PR/diags/rdram
#
# rdramide may be built locally here, for testing with just the local modules;
# a master ide will be built the next directory level up, and will link with
# all the test modules.
#
# $Revision: 1.1 $
#

PRDEPTH = ../..

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

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

OBJS=	rdramcmd.o \
	rdram.o \
	rdramstubs.o

COMMONOBJS= ../common/reg.o

TARGETS= rdramide

default install all: $(TARGETS)

rdramide: $(LIBDG) $(LIBIDE) $(OBJS) $(COMMONOBJS)
	$(CC) -o rdramide $(OBJS) $(COMMONOBJS) $(LDFLAGS)

clean:
	rm -f rdramcmd.c $(OBJS)

clobber: clean
	rm -f $(TARGETS) Makedepend

rdramcmd.c: rdramcmd.awk $(IDEAWKSCRIPT)
	$(NAWK) -v FILENAME=rdramcmd.awk -F'\t[\t ]*' -f $(IDEAWKSCRIPT) rdramcmd.awk > $@

rdramcmd.o: rdramcmd.c $(IDEINC)/ide.h
	$(CC) $(CFLAGS) -c rdramcmd.c -o rdramcmd.o

rdram.o: $(IDEINC)/diag.h $(IDEINC)/dbg_comm.h

.SUFFIXES: .o

.c.o:
	$(CC) $(CFLAGS) -c $< -o $*.o