AUTOMAKE_OPTIONS=foreign
ACLOCAL_AMFLAGS=-I ac-macros

bin_PROGRAMS = seven
seven_SOURCES = seven.c x11.c  unicode.c xatoms.c xatoms.h unicode.h x11.h print_event.c print_event.h keysym2ucs.c keysym2ucs.h panic.c panic.h pane.c pane.h emulator.c emulator.h resizeable_buf.c resizeable_buf.h defaults.h defaults.c multigraph.c multigraph.h unix.c unix.h util.h proto_xdr.c proto.h proto_clnt.c proto_svc.c seven_client.c seven_client.h pty-outfifo.c pty-outfifo.h colors.c colors.h selections.c selections.h stty_print.c stty_print.h graphic-chars.c graphic-chars.h keys.c keys.h mod.c mod.h bitfield.h script.c script.h

seven_CFLAGS= @DEBUG_CFLAGS@ -std=gnu99 -ffunction-sections -fdata-sections @X_CFLAGS@  @Xft_CFLAGS@ @CURSES_INCLUDEDIR@ @glib2_CFLAGS@ $(CFLAGS)
seven_LDADD=  @X_LIBS@ @X_EXTRA_LIBS@ @Xft_LIBS@ -lX11 -lutil -lXext @CURSES_LIBS@  @glib2_LIBS@
seven_LDFLAGS=  --gc-sections


EXTRA_DIST = 256colors.prl genatoms.prl  xatoms.atoms   genkeys.prl keys.dat gendefs.prl defaults.txt CGenerator.pm  proto.x proto_clnt.c proto_svc.c proto_xdr.c proto.h 256colors.h  lineinfo.inc

CLEANFILES = core.*
DISTCLEANFILES = _stdint.h
MAINTAINERCLEANFILES = xatoms.c xatoms.h defaults.c defaults.h  256colors.h proto.h proto_svc.c proto_clnt.c proto_xdr.c



BUILT_SOURCES =  xatoms.h  defaults.h proto.h 256colors.h  proto.h proto_svc.c proto_clnt.c proto_xdr.c keys.c keys.h


256colors.h:  256colors.prl
	perl @srcdir@/256colors.prl > 256colors.h

xatoms.c: xatoms.atoms genatoms.prl
	perl @srcdir@/genatoms.prl < @srcdir@/xatoms.atoms || rm -f -- xatoms.h xatoms.c
xatoms.h: xatoms.atoms genatoms.prl
	perl @srcdir@/genatoms.prl < @srcdir@/xatoms.atoms || rm -f -- xatoms.h xatoms.c

defaults.c: defaults.txt gendefs.prl
	perl @srcdir@/gendefs.prl -c @srcdir@/defaults.txt > defaults.c
defaults.h: defaults.txt gendefs.prl
	perl @srcdir@/gendefs.prl -h @srcdir@/defaults.txt > defaults.h

keys.c: keys.dat genkeys.prl
	perl @srcdir@/genkeys.prl -c @srcdir@/keys.dat > keys.c
keys.h: keys.dat genkeys.prl
	perl @srcdir@/genkeys.prl -h @srcdir@/keys.dat > keys.h

proto.h: proto.x
	rpcgen -N -h  $< > $@
proto_svc.c: proto.x
	rpcgen -N -m $< > $@
proto_clnt.c: proto.x
	rpcgen -N -l $< > $@
proto_xdr.c: proto.x
	rpcgen -N -c $< > $@

.DELETE_ON_ERROR: defaults.c defaults.h proto.h proto_svc.c proto_clnt.c proto_xdr.c

gendefs.prl: CGenerator.pm
	touch $@
genkeys.prl: CGenerator.pm
	touch $@




