# Makefile -- makefile for hotkey 
#
# Copyright 1997,98  Jonathan A. Buzzard (jab@hex.prestel.co.uk)
#
# $Log: Makefile,v $
# Revision 1.2  1998/07/11 13:36:21  jab
# Updated the flags for the new locale support method
#
# Revision 1.1  1998/05/10 18:42:44  jab
# Initial revision
#
#
#
# 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, 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.
# 
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 675 Mass Ave, Cambridge, MA 02139, USA.
#
# $Id: Makefile,v 1.2 1998/07/11 13:36:21 jab Exp jab $
#

VERSION=1.1

CC = gcc
INSTALL = install
DESTDIR = /usr/local
LDFLAGS= -s

#
# if your X11R6 libraries don't need X_LOCALE, remove -DX_LOCALE
#
CFLAGS= -O3 -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 \
-fno-strength-reduce -fcaller-saves -Wall -DX_LOCALE

.c.o:
	$(CC) $(CFLAGS) -c $<

hotkey: hotkey.o
	$(CC) $(LDFLAGS) -o $@ hotkey.o -L/usr/X11R6/lib -lX11

install: hotkey
	$(INSTALL) -m 4755 hotkey    $(DESTDIR)/bin
	$(INSTALL) -m 0644 hotkey.1x $(DESTDIR)/man/man1

clean:
	rm -f *.o *.bak hotkey core

dist:
	(rm -f *.o *.bak hotkey core ChangeLog; \
	rcs2log > ChangeLog; \
	rm -rf /tmp/hotkey-$(VERSION); \
	mkdir /tmp/hotkey-$(VERSION); \
	cp * /tmp/hotkey-$(VERSION); \
	cd /tmp/hotkey-$(VERSION); \
	find -type d | xargs chmod 755; \
	find -type f | xargs chmod 644; \
	find -type d | xargs chown root:root; \
	find -type f | xargs chown root:root; \
	cd ..; \
	tar cvf hotkey-$(VERSION).tar hotkey-$(VERSION); \
	gzip -9f hotkey-$(VERSION).tar; \
	echo Done.)

