# Copyright (C) 1996,1997 Robert H”hne, see COPYING.RH for details 
# This file is part of RHIDE. 

srcdir=$(RHIDESRC)/libset/keydefs
VPATH=$(srcdir)

key_languages=azerty be-latin cf de-latin de de1 dk-latin dvorak es fi-latin \
	fi fr-latin fr gr-pc gr hebrew it no pl ru ru1 ru2 sf-latin sf \
	sg-latin sg sglatin1 uk lh-us-dv rh-us-dv
key_sources=$(addsuffix .h,$(key_languages))
project=

po_files=
src_files=$(po_files) makefile makefile.src $(key_sources) \
	dvorak.doc my.h
cfg_files=
update_files=

subdirs=
po_subdirs=

key_files=$(addsuffix .txt,$(key_languages)) lh-us-dv.txt rh-us-dv.txt\
	us.txt

install_data_files=$(key_files) dvorak.doc

all:: $(key_files)


K_CPP=gcc -E -I $(srcdir)

keybind_cc=../keybind.cc
keyind_h=../keybind.h

us.txt: $(keybind_cc)
	$(K_CPP) $< \
	  | sed -e '/^[ 	]*$$/d' -e 's/ [ ]*/ /g' -e '/^#.*$$/d' > $@

%.txt: %.h $(keybind_cc)
	$(K_CPP) -DKEYBOARD_HEADER=\"$(notdir $<)\" $(word 2,$^) \
	  | sed -e '/^[ 	]*$$/d' -e 's/ [ ]*/ /g' -e '/^#.*$$/d' > $@

clean::
	rm -f $(key_files)

include $(RHIDESRC)/common.mak
