# Note: BINDIR, DATADIR also occur in src/Makefile.
MANDIR  = /usr/man
BINDIR  = /usr/bin
DATADIR = /usr/lib/kbd
# If you change the names of any of the following subdirs,
# also change paths.h.
KEYMAPDIR = keytables
FONTDIR   = consolefonts
TRANSDIR  = consoletrans
SUBDIRS = $(KEYMAPDIR) $(FONTDIR) $(TRANSDIR)

DIR	= kbd-0.94

.EXPORT_ALL_VARIABLES:

all:
	cd src && make all
	case `arch` in *86*) \
		cd src && make i386 ;; \
	esac

install:
	cd src && make install
	case `arch` in *86*) \
		cd src && make install386 ;; \
	esac
	for i in man?; do \
		install -d -m 755 $(MANDIR)/$$i; \
		install -m 644 $$i/* $(MANDIR)/$$i; \
	done
	install -d $(DATADIR)
	for i in $(SUBDIRS); do \
		install -d -m 755 $(DATADIR)/$$i ;\
		install -m 644 $$i/* $(DATADIR)/$$i ;\
	done
# compress data files
	cd $(DATADIR) && gzip -f $(KEYMAPDIR)/*.map
# (not yet fonts and maps - setfont and mapscr look at the size)

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

clean:
	cd src && make clean

reallyclean distclean spotless: clean
	find . -name "*~" -exec rm {} ";"
	cd src && make reallyclean

