# Note: keytables used to be in /usr/lib, here it is in /usr/lib/kbd
# (and DATADIR also occurs in src/Makefile).
MANDIR  = /usr/man
BINDIR  = /usr/bin
DATADIR = /usr/lib/kbd
# If you change the names of the following three subdirs,
# also change paths.h.
KEYMAPDIR = keytables
FONTDIR   = consolefonts
TRANSDIR  = consoletrans
VIDEOMODEDIR = videomodes
SUBDIRS = $(KEYMAPDIR) $(FONTDIR) $(TRANSDIR) $(VIDEOMODEDIR)

DIR	= kbd-0.88

all:
	cd src; make bin; make clean

install:
	chmod go=r man?/*
	cp -p bin/* $(BINDIR)
#	chown root $(BINDIR)/resize; chmod u+s $(BINDIR)/resize
	for i in man?; do mkdir -p $(MANDIR)/$$i; cp -p $$i/* $(MANDIR)/$$i; done
	mkdir -p $(DATADIR); chmod ugo+rx $(DATADIR)
	for i in $(SUBDIRS); do \
		chmod go+r $$i/* ;\
		mkdir -p $(DATADIR)/$$i ;\
		chmod ugo+rx $(DATADIR)/$$i ;\
		cp -p $$i/* $(DATADIR)/$$i ;\
	done

tar: reallyclean # analyze.c loadkeys.c
	cd ..; 	tar cvf - ./$(DIR) | gzip > $(DIR).tar.gz

clean::
	cd src; make clean

reallyclean: clean
	find . -name "*~" -exec rm {} ";"
	rm -rf bin
	cd src; make reallyclean

