aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2011-03-12 13:03:45 +0100
committerJohannes Berg <johannes@sipsolutions.net>2011-03-12 13:03:51 +0100
commit808eaa49efe2dc2438ef98ddf4bac4cfd2898a3d (patch)
tree9ecbd6ba906d8d0a41a71e665657b5d89144d239 /Makefile
parent27d016eeb4536fdebd89882133fc5daa614ecf17 (diff)
downloaddovecot-antispam-808eaa49efe2dc2438ef98ddf4bac4cfd2898a3d.tar.gz
dovecot-antispam-808eaa49efe2dc2438ef98ddf4bac4cfd2898a3d.tar.xz
dovecot-antispam-808eaa49efe2dc2438ef98ddf4bac4cfd2898a3d.zip
remove need for .config file
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile25
1 files changed, 13 insertions, 12 deletions
diff --git a/Makefile b/Makefile
index 68c30a3..5b4b00a 100644
--- a/Makefile
+++ b/Makefile
@@ -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