
CC = gcc
CFLAGS = `libusb-config --cflags` -W -Wall -g
LDFLAGS = `libusb-config --libs`
OBJS = gpfs.o gp32cmds.o usb_drv.o 

all: gpfs

%.o: %.c
	gcc -I. -I/include -I/usr/include -c -o $@ $<

gpfs: ${OBJS}
	${CC} -o gpfs ${OBJS} /usr/lib/libfuse.a -lpthread ${LDFLAGS}

static: ${OBJS}
	${CC} -static -o gpfs ${OBJS} /usr/lib/libfuse.a -lpthread ${LDFLAGS}

clean:
	rm -f *~ *.o gpfs

dist: clean
	tar -czvf ../gpfs-0.1.tar.gz *

install:
	cp -p gpfs /usr/bin/gpfs
	rm -f /sbin/mount.gpfs
	ln -s /usr/bin/gpfs /sbin/mount.gpfs

uninstall:
	rm -f /sbin/mount.gpfs
	rm -f /usr/bin/gpfs
