# The contents of this file are subject to the Mozilla Public
# License Version 1.1 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of
# the License at http://www.mozilla.org/MPL/
# 
# Software distributed under the License is distributed on an "AS
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
# implied. See the License for the specific language governing
# rights and limitations under the License.
# 
# The Original Code is Freedom code.
# 
# The Initial Developer of the Original Code is Zero-Knowledge Systems,
# Inc.  Portions created by Zero-Knowledge are Copyright (C) 2000
# Zero-Knowledge Systems, Inc.  All Rights Reserved.
# 
# Contributor(s):

# 
# Default target
#

default:: exes

# Get the variables definition
include $(ZK_ROOT)/freedom/makefiles/Makefile.vars

# Override and define new variables
ZK_INCS := \
	-I$(ZK_FREEDOM_ROOT)libs$(/)frcrypt$(/)include \
	-I$(ZK_ROOT)libzkrand$(/)include \
	-I$(ZK_CWDDIR)/..$(/)src_client \
	-I$(ZK_CWDDIR)/..$(/)src_server \
	-I$(ZK_ROOT)libzk$(/)include \
	$(ZK_INCS) \
	$(END_OF_LIST)

ZK_LDFLAGS += -L$(ZK_FREEDOM_ROOT)/popmail$(/)cdb

ZK_ALL_SRCFILES := \
	checkblocklist.c \
	list2hashlist.c \
	txt2cdbmake.cpp \
	$(END_OF_LIST)

ZK_CPUBEXES_ERROR := \
	$(END_OF_LIST)

ZK_CXXPUBEXES := \
	txt2cdbmake \
	$(END_OF_LIST)

ZK_CPUBEXES1 = \
	checkblocklist \
	list2hashlist \
	$(END_OF_LIST)

ZK_CPUBEXES = \
	$(ZK_CPUBEXES1) \
	$(END_OF_LIST)

PKG_EXES = $(ZK_CXXPUBEXES) $(ZK_CPUBEXES)

# Get the target rules
include $(ZK_ROOT)/freedom/makefiles/Makefile.targs

# Add new targets or complement default target using :: rules
package:: default
	@$(ZK_SCRIPTDIR)/promoteFiles.pl $(ZK_BUILDDIR_PUBBIN) $(ZK_PKG_QMAIL_ROOT)/bin $(PKG_EXES) 
	@$(ZK_SCRIPTDIR)/promoteFiles.pl $(ZK_FREEDOM_ROOT)/popmail/cdb $(ZK_PKG_QMAIL_ROOT)/bin cdbmake

$(ZK_BUILDDIR_PUBLIB)/libfrmailblocklist_client.a: force
	cd $(ZK_CWDDIR)/..$(/)src_client && $(MAKE)

$(ZK_BUILDDIR_PUBLIB)/libfrmailblocklist_server.a: force
	cd $(ZK_CWDDIR)/..$(/)src_server && $(MAKE)

# Specify dependencies
$(addprefix $(ZK_BUILDDIR_PUBBIN)/,$(ZK_CPUBEXES1)): $(ZK_BUILDDIR_PUBBIN)/%: $(ZK_BUILDDIR_PROJ)/%.o -lfrmailblocklist_server -lfrmailblocklist_client -lcdb -lcdbbuffer -lcdballoc -lcdbbyte -lcdbunix -lfrcrypt -lzkrand -lzk -lcrypto

$(addprefix $(ZK_BUILDDIR_PUBBIN)/,$(ZK_CXXPUBEXES)): $(ZK_BUILDDIR_PUBBIN)/%: $(ZK_BUILDDIR_PROJ)/%.o

force: ;
.PHONY: force

