bin_PROGRAMS = xcopilot

SUBDIRS = mc68k mx
xcopilot_SOURCES = cmap_mgr.c cmap_mgr.h fakecall.c fakecall.h optutil.c optutil.h pilotcpu.c pilotcpu.h xcopilot.c display.c display.h main.c main.h pdebug.c pdebug.h ser-tcp.c bittypes.h open_app.h open_app.c
xcopilot_LDADD = ${X_LIBS} mc68k/libmc68k.a mx/libmx.a ${X_PRE_LIBS} -lXpm -lXext -lXt -lX11 ${X_EXTRA_LIBS}
INCLUDES = -I$(top_srcdir)/mx -I$(top_srcdir)/mc68k
man_MANS = xcopilot.1
EXTRA_DIST = xcopilot.sgml xcopilot.1 case.xpm case.fancy.xpm icon.xpm icon2.xpm

xcopilot.1: xcopilot.sgml
	sgml2txt -man $<
	mv xcopilot.man $@

clobber: clean

dist-hook:
	mkdir $(distdir)/debian
	cp -p debian/control debian/menu debian/rules debian/README.debian debian/copyright debian/postinst debian/substvars debian/changelog debian/postrm $(distdir)/debian

ARCH = $(shell dpkg --print-architecture)

$(PACKAGE)_$(VERSION)_$(ARCH).deb: distdir
	(cd $(PACKAGE)-$(VERSION); ./configure; dpkg-buildpackage -rfakeroot)

deb: $(PACKAGE)_$(VERSION)_$(ARCH).deb
