# Makefile for Apout PDP-11 application emulator
#
# $Revision: 1.12 $
# $Date: 1999/01/06 00:17:47 $
#
# Set the CFLAGS, LDFLAGS for speed or debugging. If you don't want 2.11BSD
# emulation, then remove the -DEMU211 flag.
# Set up the LIBS if required for your system
#
# These flags for doing debugging
CFLAGS= -Wall -g -DEMU211 -DNATIVES -DDEBUG
LDFLAGS= -static -g

# These flags for speed
#CFLAGS= -DEMU211 -DNATIVES -DINLINE=inline -O3 -Winline -Wall \
#	-finline-functions -fomit-frame-pointer
#LDFLAGS=

# Any extra libraries required
LIBS= -lm

VERSION= apout2.2alpha6
SRCS=	cpu.c aout.c branch.c double.c ea.c itab.c main.c \
	single.c fp.c v7trap.c bsdtrap.c defines.h v7trap.h debug.c \
	bsdtrap.h README COPYRIGHT CHANGES LIMITATIONS Makefile apout.1 \
	apout.0
OBJS=	cpu.o aout.o branch.o double.o ea.o itab.o main.o \
	single.o fp.o v7trap.o bsdtrap.o debug.o

apout: $(OBJS)
	cc $(LDFLAGS) $(OBJS) -o apout $(LIBS)
	cp apout /usr/local/bin

clean:
	rm -rf apout *core $(OBJS) *.dbg $(VERSION) $(VERSION).tar.gz

apout.0: apout.1
	nroff -man apout.1 > apout.0

disttar: clean apout.0
	- mkdir $(VERSION)
	cp $(SRCS) $(VERSION)
	chmod -R go+rX $(VERSION)
	tar vzcf $(VERSION).tar.gz $(VERSION)

# Dependencies for object files
branch.o: branch.c defines.h Makefile
cpu.o: cpu.c defines.h Makefile
double.o: double.c defines.h Makefile
ea.o: ea.c defines.h Makefile
fp.o: fp.c defines.h Makefile
itab.o: itab.c defines.h Makefile
main.o: main.c defines.h Makefile
single.o: single.c defines.h Makefile
aout.o: aout.c defines.h Makefile
v7trap.o: v7trap.c defines.h Makefile v7trap.h
bsdtrap.o: bsdtrap.c defines.h Makefile bsdtrap.h
