#
#   muscan - scanner driver for Mustek Paragon 6000CX scanner
#   Copyright (C) 1995 Torsten Eichner
#
#   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.
#
#   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.
#
#   email: 	eichner@rhrk.uni-kl.de
#   papermail:	Torsten Eichner, Kampshardtweg 1, D-57587 Birken-Honigsessen, Germany
#

#   Modify this to your needs

DEVICE     = /dev/scanner

XAWLIB     = Xaw3d

INSTXBINDIR= /usr/local/bin/X11
INSTBINDIR = /usr/local/bin
INSTMANDIR = /usr/local/man/man1
INSTAPPDIR = /usr/lib/X11/app-defaults

#   Don't modify below this line

SRC1 = muscan.c
OBJ1 = muscan.o

SRC2 = xmuscan.c
OBJ2 = xmuscan.o

CFLAGS = -O2 -Wall\
	 -DDEVICE="\"$(DEVICE)\""\
         -DUSER="\"`whoami`\"" -DHOST="\"`hostname`\"" -DVERSION="\"1.1\""

all:	muscan xmuscan

muscan: $(OBJ1)
	$(CC) $(CFLAGS) -o muscan $(OBJ1)
	strip muscan

xmuscan:$(OBJ2)
	$(CC) $(CFLAGS) -o xmuscan $(OBJ2) -l$(XAWLIB) -lXt -lX11
	-xrdb -merge Xmuscan.ad
	strip xmuscan

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

depend:
	makedepend $(SRC1) $(SRC2)

clean:
	makedepend
	rm -f $(OBJ) core muscan.tar muscan.tar.gz muscan.tar.z Makefile.bak *.o

allclean: clean
	rm -f muscan xmuscan

install: allclean depend muscan xmuscan
	install -g root -o root -m 644 muscan.1 $(INSTMANDIR)/muscan.1
	install -g root -o root -m 644 xmuscan.1 $(INSTMANDIR)/xmuscan.1
	install -g bin -o bin -m 755 muscan $(INSTBINDIR)/muscan
	install -g bin -o bin -m 755 xmuscan $(INSTXBINDIR)/xmuscan
	install -g root -o root -m 644 Xmuscan.ad $(INSTAPPDIR)/Xmuscan

indent:
	indent $(SRC1) $(SRC2)
	rm -f *~

dist:	 indent allclean
	cd ..; tar -cvf muscan.tar muscan
	mv ../muscan.tar .
	gzip muscan.tar


# DO NOT DELETE THIS LINE -- make depend depends on it.
