#
# System specific settings
# 

# GNU/Linux and GNU/Hurd
CC = gcc
CFLAGS = -DHAVE_VASPRINTF -DHAVE_GETOPT_LONG -D_GNU_SOURCE -Wall -O2
LFLAGS = -lssl -lcrypto -s
EXTRAOBJS = 

# FreeBSD, NetBSD, OpenBSD
#CC = gcc
#CFLAGS = -DHAVE_VASPRINTF -DHAVE_GETOPT_LONG -Wall -O2
#LFLAGS = -lssl -lcrypto -s
#EXTRAOBJS = 

# SunOS
#CC = cc
#CFLAGS = -UHAVE_VASPRINTF -UHAVE_GETOPT_LONG
#LFLAGS = -lssl -lcrypto -lsocket -lnsl -s
#EXTRAOBJS = getopt.o getopt1.o

# If your system is not listed above, find out the settings yourself:
# - If your system has the getopt_long() function (try man 3 getopt_long),
#   use -DHAVE_GETOPT_LONG and set EXTRAOBJS to an empty string (see the
#   GNU/Linux section for an exmaple). If it doesn't have getopt_long, 
#   use -UHAVE_GETOPT_LONG and set EXTRAOBJS to getopt.o getopt1.o (see
#   the SunOS section).
# - If your system has the vasprintf() function (try man 3 vasprintf),
#   use -DHAVE_VASPRINTF (see GNU/Linux), else use -UHAVE_VASPRINTF (see 
#   SunOS).
# - Set LFLAGS to -ssl -lcrypto -s (see GNU/linux) and add system specific 
#   flags if necessary (see SunOS: -lsocket and -lnsl).

# If your compiler cannot find the OpenSSL header and library files, add
# -I/path/to/openssl/include to CFLAGS and -L/path/to/openssl/lib to LFLAGS.

###############################################################################

PROG = msmtp
OBJS = msmtp.o esmtp.o net.o tls.o base64.o cram_md5.o \
       merror.o list.o xmalloc.o $(EXTRAOBJS)

all:
		make $(PROG)

$(PROG):	$(OBJS)
		$(CC) -o $(PROG) $(OBJS) $(LFLAGS)

clean:
		rm -f *.o *~ core $(PROG)
clear:
		rm -f *.o *~ core

