##
#  Makefile for the zApi library
#  
#  The Zen API 
#  Copyright (C) 2008-2010 by LMI Technologies Inc.
#  
#  Redistributions of files must retain the above copyright notice.
##

cp = cp -f
rm = rm -f
mkdir = mkdir -p
CC = gcc -fPIC -fno-stack-protector -fvisibility=hidden
DEFS = -DZAPI_INTERNAL -DZAPI_STATIC -DZAPI_LINUX
LIBNAME = ../lib/libzApi.a
INCLUDES =  -I../include
AR = ar -cq
INSTALLPATH = /lib
CFLAGS = -std=gnu99 -pedantic -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers $(INCLUDES) $(DEFS)

SRCS = src/zApi.c src/zFile.c src/zFireSync.c src/zIndicators.c src/zList.c src/zLock.c src/zMemory.c src/zNetwork.c src/zReceiver.c src/zResult.c src/zSemaphore.c src/zSerializer.c src/zSocket.c src/zStopwatch.c src/zSyncQueue.c src/zTcpClient.c src/zTcpServer.c src/zThread.c src/zTimer.c src/zUdpClient.c src/zXml.c 

OBJS = src/zApi.o src/zFile.o src/zFireSync.o src/zIndicators.o src/zList.o src/zLock.o src/zMemory.o src/zNetwork.o src/zReceiver.o src/zResult.o src/zSemaphore.o src/zSerializer.o src/zSocket.o src/zStopwatch.o src/zSyncQueue.o src/zTcpClient.o src/zTcpServer.o src/zThread.o src/zTimer.o src/zUdpClient.o src/zXml.o 

.c.o:
	$(rm) -f $@
	$(CC) $(CFLAGS) -c $*.c -o $@

all: $(LIBNAME)

$(LIBNAME) : $(OBJS)
	$(rm) $@
	$(AR) $(LIBNAME) $(OBJS)

clean:
	$(rm) $(OBJS) $(LIBNAME) core *~

install: 
	$(cp) $(LIBNAME) $(INSTALLPATH)
