Makefile 1.29 KB
#!/sbin/smake
#
# Makefile for PR/diags/ai
#
# aiide 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.1.1 $
#

PRDEPTH = ../..

include $(PRDEPTH)/PRdefs

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 -L$(ROOT)/usr/lib/PR -L$(PRDEPTH)/diags/ide
LLDLIBS = -ldg -lide

OBJS=	aicmd.o \
	ai.o \
	ai_pintests.o \
	ai_regtests.o \
	ai_sounds.o \
	aistubs.o

COMMONOBJS= ../common/reg.o

SOUND_FILES= elec_piano.bin

TARGETS= aiide

default install all: $(TARGETS)

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

install: default
	$(INSTALL) -m 444 -F /usr/diags data/$(SOUND_FILES)

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

clobber: clean
	rm -f $(TARGETS) Makedepend


aicmd.c: aicmd.awk $(IDEAWKSCRIPT)
	nawk -F'\t[\t ]*' -f $(IDEAWKSCRIPT) aicmd.awk > $@

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

ai.o: ai.c $(IDEINC)/diag.h

.SUFFIXES: .o

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