# iidll Makefile
# dev@fx.dk
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#
# 1999/05/14

CC = gcc

#.INCLUDE: /emx/src/lib/lib0.mak

FREESWANINCLS= -I.. -I../../gmp -I../../lib -I.

# -O on Linux makes gcc coredump when compiling sha1.c
CFLAGS = -g -Wall #-Wmissing-prototypes #-O

# where to find klips headers and FreeS/WAN headers
HDRDIRS = $(FREESWANINCLS)

# On non-LINUX systems, these one of these may be needed (see endian.h)
# BYTE_ORDER = -DBIG_ENDIAN=4321 -DLITTLE_ENDIAN=1234 -DBYTE_ORDER=BIG_ENDIAN
# BYTE_ORDER = -DBIG_ENDIAN=4321 -DLITTLE_ENDIAN=1234 -DBYTE_ORDER=LITTLE_ENDIAN

# -DKLIPS enables interface to Kernel LINUX IPsec code (see also the
#    definition of KERNELKLIPS below)
# -DDEBUG enables debugging code, allowing for debugging output
#    (note that output must also be selected at runtime, so it is
#    reasonable to always define this)
# -DGCC_LINT uses gcc-specific declarations to improve compile-time
#    diagnostics.  Some "zero-length format string" warnings are expected.

# -DLEAK_DETECTIVE enables crude code to find memory allocation leaks.

# The following are best left undefined -- each can be overridden at runtime
# if need be.
# -DPORT=n sets the default UDP port for IKE messages (otherwise 500)
# -DSHARED_SECRETS_FILE=string overrides /etc/ipsec.secrets as the
#    default name of the file containing secrets used to authenticate other
#    IKE daemons.  In the Makefile, two levels of quoting are needed:
#    -DSHARED_SECRETS_FILE='"/etc/ipsec.secrets"'
# -DLOCK_DIR=string overrides /var/run as default directory where pluto
#    creates its pluto.pid lock file.  Double quoting may be needed.
# -DROAD_WARRIOR_FUDGE enables support for initiators with IP addresses
#    previously unknown to the responder.

CPPFLAGS = $(HDRDIRS) -DDEBUG $(BYTE_ORDER) -DTCPIPV4 -D__OS2__ -DROAD_WARRIOR_FUDGE

LDFLAGS = -Zdll -Zomf -Zcrtdll

ALLFLAGS = $(CPPFLAGS) $(CFLAGS) $(LDFLAGS)

# libefence is a free memory allocation debugger
# Solaris 2 needs -lsocket -lnsl
LIBSIIDLL = -lsocket -lbsd
# -lefence


BINNAMEIIDLL = iidll.dll

#your actual ipsec implementation lib
IPSECLIB = 

RM = /bin/rm
RMFLAGS = -f

.SUFFIXES:
.SUFFIXES: .c .obj

# files for a (source) distribution

DISTSRC = \
  iidll.c iidll.h 

DIST = $(DISTMISC) $(DISTSRC)


OBJSIIDLL = iidll.obj

all: $(BINNAMEIIDLL) 


$(BINNAMEIIDLL): $(OBJSIIDLL) iidll.def $(IPSECLIB)
	$(CC) -o $(BINNAMEIIDLL) $(OBJSIIDLL) iidll.def $(IPSECLIB) $(LDFLAGS) $(LIBSIIDLL)
	emximp -o iidll.a iidll.def
.c.obj:
	$(CC) $(COPTS) $(ALLFLAGS) -c $<

# Dependencies generated by "make gatherdeps":

iidll.obj: iidll.c
iidll.obj: iidll.h
iidll.obj: ..\state.h
