GNUmakefile 1.15 KB
#!/sbin/smake
#
# Makefile for PR/diags/pi
#
# piide 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=	picmd.o \
	pi.o \
	pistubs.o 

TARGETS= piide

default install all: $(TARGETS)

piide: $(LIBDG) $(LIBIDE) $(OBJS)
	$(CC) -o $@ $(OBJS) $(LDFLAGS)

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

clobber: clean
	rm -f $(TARGETS) Makedepend

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

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

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

.SUFFIXES: .o

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