# $Id: Makefile,v 1.9 2004/11/19 07:08:02 yamajun Exp $

CFLAGS	= `libusb-config --cflags` -Wall -g
LDFLAGS	= `libusb-config --libs`
PREFIX	?= /usr/local
BINDIR	?= ${PREFIX}/bin
MANDIR	?= ${PREFIX}/man/man1
INSTALL	?= /usr/bin/install

OBJS = ifp.o ifp_routines.o unicodehack.o

all: ifp
ifp: $(OBJS)
	$(CC) -o ifp $(OBJS) $(LDFLAGS)

$(BINDIR):
	mkdir -p $(BINDIR)

$(MANDIR):
	mkdir -p $(MANDIR)

install: ifp $(BINDIR) $(MANDIR)
	$(INSTALL) -c ifp $(BINDIR)
	$(INSTALL) -c -m 644 ifp.1 $(MANDIR)

ifp.o: ifp_routines.h
ifp_routines.o: ifp_routines.h unicodehack.h
unicodehack.o: unicodehack.h

clean:
	-rm -f core *.core *.o ifp
