diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2011-03-12 13:03:45 +0100 |
---|---|---|
committer | Johannes Berg <johannes@sipsolutions.net> | 2011-03-12 13:03:51 +0100 |
commit | 808eaa49efe2dc2438ef98ddf4bac4cfd2898a3d (patch) | |
tree | 9ecbd6ba906d8d0a41a71e665657b5d89144d239 | |
parent | 27d016eeb4536fdebd89882133fc5daa614ecf17 (diff) | |
download | dovecot-antispam-808eaa49efe2dc2438ef98ddf4bac4cfd2898a3d.tar.gz dovecot-antispam-808eaa49efe2dc2438ef98ddf4bac4cfd2898a3d.tar.xz dovecot-antispam-808eaa49efe2dc2438ef98ddf4bac4cfd2898a3d.zip |
remove need for .config file
-rw-r--r-- | Makefile | 25 | ||||
-rw-r--r-- | defconfig | 11 |
2 files changed, 20 insertions, 16 deletions
@@ -1,7 +1,9 @@ -# include config file +# include config file if present CONFIG ?= .config -include $(CONFIG) CFLAGSORIG := $(CFLAGS) +DOVECOT ?= /usr/include/dovecot +PLUGINNAME ?= antispam -include $(DOVECOT)/dovecot-config INSTALLDIR ?= $(moduledir)/imap # Kill CFLAGS from dovecot-config @@ -29,18 +31,18 @@ LOCALCFLAGS += -fPIC -shared -Wall -Wextra -DPLUGINNAME=$(PLUGINNAME) CC ?= cc HOSTCC ?= cc -all: verify_config $(LIBRARY_NAME) +all: $(LIBRARY_NAME) -antispam-storage.o: antispam-storage.c antispam-storage-*.c $(CONFIG) antispam-plugin.h dovecot-version.h +antispam-storage.o: antispam-storage.c antispam-storage-*.c antispam-plugin.h dovecot-version.h $(CC) -c $(CFLAGS) $(LOCALCFLAGS) $(INCS) -o $@ $< -%.o: %.c $(CONFIG) antispam-plugin.h dovecot-version.h antispam-version.h +%.o: %.c antispam-plugin.h dovecot-version.h antispam-version.h $(CC) -c $(CFLAGS) $(LOCALCFLAGS) $(INCS) -o $@ $< $(LIBRARY_NAME): $(objs) $(CC) $(CFLAGS) $(LOCALCFLAGS) $(INCS) $(objs) -o $(LIBRARY_NAME) $(LDFLAGS) -dovecot-version: dovecot-version.c $(CONFIG) +dovecot-version: dovecot-version.c $(HOSTCC) $(INCS) -o dovecot-version dovecot-version.c dovecot-version.h: dovecot-version @@ -53,13 +55,12 @@ antispam-version.h: version.sh clean: rm -f *.so *.o *~ dovecot-version dovecot-version.h antispam-version.h -install: all +install: all checkinstalldir install -p -m 0755 $(LIBRARY_NAME) $(DESTDIR)$(INSTALLDIR)/ -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; \ +checkinstalldir: + @if [ ! -d "$(DESTDIR)$(INSTALLDIR)/" ] ; then \ + echo "Installation directory $(DESTDIR)$(INSTALLDIR)/ doesn't exist," ; \ + echo "run make install INSTALLDIR=..." ; \ + exit 2 ; \ fi @@ -13,18 +13,21 @@ # Building the plugin requires configured dovecot sources or having # configured it with --enable-header-install in which case you can # point DOVECOT= to the installed headers too. +# If unset, it defaults to /usr/include/dovecot which typically is the +# right place so you don't have to worry about it. #DOVECOT=../dovecot-1.0.5 #DOVECOT=../dovecot-1.1 -DOVECOT=/usr/include/dovecot +#DOVECOT=/usr/include/dovecot # install directory for 'make install' # NB no need for a final '/' INSTALLDIR=/usr/lib/dovecot/modules/imap # plugin name, change only if you need to rename the plugin -# (because, for example, you need two instances for different -# spam filters installed) -PLUGINNAME=antispam +# (for backward compatibility reasons, there no longer is a +# need for this since backends can be configured dynamically). +# If unset, defaults to "antispam" which is what you want. +# PLUGINNAME=antispam # extra CFLAGS # CFLAGS += -g3 |