###############################################################################
#    keyboard emulator project
#
#    Copyright (C) 1998-2003 Reznic Valery <valery_reznic@users.sourceforge.net>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
###############################################################################

all-local:

TOP_DIR := ..

G_MANPAGES_7           := xt_kbde_scancode.7
GENERATED_MANPAGE_FILES = scancode.inc $(G_MANPAGES)
BUILD_SCRIPTS           = $(addsuffix .sh,$(GENERATED_MANPAGE_FILES))

SOURCES = Makefile $(S_MANPAGES) $(BUILD_SCRIPTS) xt_kbde_scancode.7.in


S_MANPAGES_1 := kbde.1
S_MANPAGES_3 := kbde.3 kbde_ascii.3 kbde_misc.3

# First dependencies is a input file
xt_kbde_scancode.7: xt_kbde_scancode.7.in scancode.inc xt_kbde_scancode.7.sh
scancode.inc      : $(TOP_DIR)/lib/kbde.description $(TOP_DIR)/lib/kbde.awk scancode.inc.sh

install-local: install-man-local

clean-local:
	$(RM) $(GENERATED_MANPAGE_FILES)

include $(TOP_DIR)/Makefile.include
include $(TOP_DIR)/Makefile.man

all-local: $(GENERATED_MANPAGE_FILES)
$(GENERATED_MANPAGE_FILES):
	$(RM) $@
	/bin/sh ./$@.sh < $< > $@ || { $(RM) $@; exit 1; }

