# Standard installation:
INCLUDES=	
LIBS=		-lsectok -lcrypto

# For building locally (libsectok not installed)
#INCLUDES=	-I../libsectok
#LIBS=		../libsectok/libsectok.a -lcrypto

# If crypto is included with openssl you might need this
#INCLUDES=	-I/usr/include/openssl

# You shouldn't have to change anything below this line

TARGETS=	sectok
SRC=		main.c cmds.c cyberflex.c
OBJ=		$(SRC:.c=.o)
CC=		gcc
CFLAGS=		-g -Wall
INSTALL=	install
PREFIX=		/usr/local
RELEASE=	sectok-`date "+%Y%m%d"`

all :	$(TARGETS)

sectok : $(OBJ)
	$(CC) -o $@ $(OBJ) $(LIBS)

.c.o :
	$(CC) $(CFLAGS) $(INCLUDES) -c $*.c

install :
	$(INSTALL) $(TARGETS) $(PREFIX)/bin

release :
	rm -rf $(RELEASE)
	mkdir -p $(RELEASE)/palm
	cp -p LICENSE Makefile *.[ch] sectok.1 $(RELEASE)
	cp -pR palm/Makefile palm/*.[ch] palm/*.pbm palm/*.rcp $(RELEASE)/palm
	find $(RELEASE) -type f -exec chmod 644 \{\} \;
	tar zcvf $(RELEASE).tgz $(RELEASE)
	rm -rf $(RELEASE)

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

