# $Id: Makefile,v 1.16 2002/07/24 09:25:20 bertrik Exp $

# Compiler and compiler flags
CC		= gcc
CFLAGS		= -Wall -g -I/home/kleptog/debian/sane-backends-1.0.10/include -DV_MAJOR=0 -DV_MINOR=1 -fPIC
LDFLAGS		= -lm

# Other utilities
RM 		= rm -f

# Package definitions
PKG_NAME	= hp5470
DATE		= $$(date +%Y%m%d)
EXEC		= hp5400

OBJECTS	= hp5400_scanner.o hp5400.o

all: $(EXEC) sane-hp5400.so

$(EXEC): $(OBJECTS)
	$(CC) $(LDFLAGS) -o $(EXEC) $(OBJECTS)

hp5400.o: hp5400.c
	$(CC) $(CFLAGS) -c -DSTANDALONE -o $@ $<

hp5400_scanner.o: hp5400_scanner.c
	$(CC) $(CFLAGS) -c -DSTANDALONE -o $@ $<

sane-hp5400.so: sane-hp5400.o
	$(CC) $(LDFLAGS) -shared -fPIC -o $@ $<
.PHONY: clean

dist: clean
	cd .. && tar --exclude={CVS,cvs} -czvf $(PKG_NAME)-$(DATE).tar.gz $(PKG_NAME)

# Cleans object files, executable and emacs backup archives
clean:
	$(RM) *.o $(EXEC) *~ core *.dat


hp5400.o: hp5400.c hp5400.h hp5400_xfer.h
hp5400_scanner.o: hp5400_scanner.c hp5400_xfer.h
sane-hp5400.o: sane-hp5400.c \
 /home/kleptog/debian/sane-backends-1.0.10/include/sane/sane.h \
 /home/kleptog/debian/sane-backends-1.0.10/include/sane/sanei.h \
 /home/kleptog/debian/sane-backends-1.0.10/include/sane/sanei_backend.h \
 /home/kleptog/debian/sane-backends-1.0.10/include/sane/sanei_config.h \
 /home/kleptog/debian/sane-backends-1.0.10/include/sane/saneopts.h \
 hp5400.h hp5400_xfer.h hp5400.c hp5400_scanner.c





