
CC = @CC@
CFLAGS = @CFLAGS@
CCDLFLAGS = @CCDLFLAGS@

LIBS = @LIBS@
SSLLIBS = @SSLLIBS@
LDFLAGS = @LDFLAGS@
LDDLFLAGS = @LDDLFLAGS@

EXE_EXT = @EXEEXT@
SHLIBEXT = .so

SSLCFLAGS = @SSLCFLAGS@

SPAMC_FILES = spamd/spamc.c

QMAIL_SPAMC_FILES = qmail/qmail-spamc.c

LIBSPAMC_FILES = spamd/libspamc.c spamd/utils.c

all: spamd/spamc$(EXE_EXT) qmail/qmail-spamc
	true

libspamc: spamd/libspamc$(SHLIBEXT)
	true

spamd/libspamc$(SHLIBEXT): $(LIBSPAMC_FILES)
	$(CC) $(CCDLFLAGS) $(LIBSPAMC_FILES) -o $@ $(LDDLFLAGS) $(LIBS)

spamd/spamc$(EXE_EXT): $(SPAMC_FILES) $(LIBSPAMC_FILES)
	$(CC) $(SSLCFLAGS) $(CFLAGS) $(SPAMC_FILES) $(LIBSPAMC_FILES) \
		-o $@ $(LDFLAGS) $(SSLLIBS) $(LIBS)

spamd/libsslspamc$(SHLIBEXT): $(LIBSPAMC_FILES)
	$(CC) $(SSLCFLAGS) $(CCDLFLAGS) $(LIBSPAMC_FILES) \
		-o $@ $(LDDLFLAGS) $(SSLLIBS) $(LIBS)

qmail/qmail-spamc: $(QMAIL_SPAMC_FILES)
	$(CC) $(CFLAGS) $(QMAIL_SPAMC_FILES) \
		-o $@ $(LDFLAGS) $(LIBS)

