aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-09-30 13:34:59 +0200
committerJohannes Berg <johannes@sipsolutions.net>2007-09-30 13:34:59 +0200
commitd30cef3c11f07889c2f8e86340b013174d28fc5c (patch)
treeb4c935edff52f9829e1e8fd927a681596e26b4a8 /Makefile
parent96730567e4a1fc835ed8a2c93988c2cacd1f914c (diff)
downloaddovecot-antispam-d30cef3c11f07889c2f8e86340b013174d28fc5c.tar.gz
dovecot-antispam-d30cef3c11f07889c2f8e86340b013174d28fc5c.tar.xz
dovecot-antispam-d30cef3c11f07889c2f8e86340b013174d28fc5c.zip
start of rewrite
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile53
1 files changed, 53 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..717c58d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,53 @@
+# include config file
+-include .config
+
+# includes/flags we need for building a dovecot plugin
+CFLAGS += -DHAVE_CONFIG_H
+CFLAGS += -I$(DOVECOT)/
+CFLAGS += -I$(DOVECOT)/src/
+CFLAGS += -I$(DOVECOT)/src/lib/
+CFLAGS += -I$(DOVECOT)/src/lib-storage/
+CFLAGS += -I$(DOVECOT)/src/lib-mail/
+CFLAGS += -I$(DOVECOT)/src/lib-imap/
+CFLAGS += -I$(DOVECOT)/src/imap/
+
+# per-backend configuration
+ifeq ("$(BACKEND)", "dspam-exec")
+CFLAGS += -DCONFIG_PLUGIN_WANT_SIGNATURE=1
+# can take a while, check more often
+CFLAGS += -DCOPY_CHECK_INTERVAL=10
+endif
+
+
+# debug rules
+ifeq ("$(DEBUG)", "stderr")
+CFLAGS += -DCONFIG_DEBUG -DDEBUG_STDERR
+objs += debug.o
+else ifeq ("$(DEBUG)", "syslog")
+CFLAGS += -DCONFIG_DEBUG -DDEBUG_SYSLOG
+objs += debug.o
+endif
+
+
+# main make rules
+CFLAGS += -fPIC -shared -Wall
+CC ?= "gcc"
+
+objs += plugin.o $(BACKEND).o
+ALL = antispam
+
+all: verify_config $(ALL)
+
+antispam: $(objs)
+ $(CC) $(CFLAGS) $(INCLUDES) $(objs) -o $@.so $(LDFLAGS)
+
+clean:
+ rm -f *.so *.o *~
+
+verify_config:
+ @if [ ! -r .config ]; then \
+ echo -e "\nBuilding the plugin requires a configuration file"; \
+ echo -e '(.config). Copy defconfig ("cp defconfig .config")' ; \
+ echo -e "to create an example configuration.\n"; \
+ exit 1; \
+ fi