VERSION=0.2
SHELL=/bin/sh
CC=gcc
BINDIR=/usr/local/bin
INSTALL=install
MACHINE=`uname -m`-`uname -p`-`uname -s`
CFLAGS=-Wall -ansi -g -D_REENTRANT -D_GNU_SOURCE `gtk-config --cflags`
LIBS=-lpthread `gtk-config --libs`
EXE=gftp
OBJS=connect_dialog.o delete_dialog.o file_transfer.o ftp.o gftp.o misc.o \
     mkdir_dialog.o rename_dialog.o

all: $(OBJS)
	$(CC) $(OBJS) $(CFLAGS) $(LIBS) -o $(EXE)

static: $(OBJS)
	$(CC) $(OBJS) -static $(CFLAGS) $(LIBS) -o $(EXE)

dist: clean
	mkdir ../$(EXE)-$(VERSION) ; cp -r * ../$(EXE)-$(VERSION)
	cd .. ; tar cvf - $(EXE)-$(VERSION) | gzip > $(EXE)-$(VERSION).tar.gz

staticdist: static
	rm -f core *.o
	mkdir ../$(EXE)-$(VERSION).$(MACHINE)
	strip $(EXE)
	cp -r * ../$(EXE)-$(VERSION).$(MACHINE)
	cd .. ; tar cvf - $(EXE)-$(VERSION).$(MACHINE) | gzip > $(EXE)-$(VERSION).$(MACHINE).tar.gz

install: all
	$(INSTALL) -s $(EXE) $(BINDIR)/$(EXE)

clean:
	rm -f core *.o $(EXE)
