#
# unix makefile for ezFCPlib
#
# C Client library for Freenet using FCP
#

default:
	@echo "Target must be one of 'linux', 'cygwin' or 'clean'

linux: ezFCPlib.a

cygwin: ezFCPlib.a

clean:
	rm *.o *.a

CC=gcc
CFLAGS=-O2 -Wall -g -U_WIN32

COMPILE=$(CC) $(CFLAGS)


ezFCPlib.a: fcpStartup.o \
		fcpCreateHandle.o \
		fcpDestroyHandle.o \
		fcpRawMode.o \
		fcpSetHtl.o \
		fcpSetHost.o \
		fcpGetKeyToFile.o \
		fcpGetKeyToMem.o \
		fcpPutKeyFromFile.o \
		fcpPutKeyFromMem.o \
		fcpMakChkFromMem.o \
		fcpMakeChkFromFile.o \
		fcpMakeSvkKeypair.o \
		fcpOpenKeyIndex.o \
		fcpReadKeyIndex.o \
		fcpWriteKeyIndex.o \
		fcpOpenKey.o \
		fcpReadKey.o \
		fcpWriteKey.o \
		fcpCloseKey.o \
		meta_lex.o meta_parse.o \
		_fcpSock.o _fcpReadBlk.o _fcpRecvResponse.o _fcpGlobals.o
	ar -rc $@ $^

fcpOpenKey.o: fcpOpenKey.c meta_parse.c
	gcc -c -g $<

meta_lex.o: meta_lex.c meta_parse.c
	gcc -c -g $<

meta_parse.c: meta_parse.y
	bison -d -v -p meta_ -o $@ $<

%.o:%.c
	gcc -c -g $<
