aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2007-10-02 01:20:49 +0200
committerJohannes Berg <johannes@sipsolutions.net>2007-10-02 01:20:49 +0200
commit167942c6a930fe02184e2cc02c6e48e187565b4f (patch)
tree2f65a7d68f6ede485c2beb9031126356946070bc /Makefile
parent9f67005c3ce2d58a160163709acaec17cdc19d03 (diff)
downloaddovecot-antispam-167942c6a930fe02184e2cc02c6e48e187565b4f.tar.gz
dovecot-antispam-167942c6a930fe02184e2cc02c6e48e187565b4f.tar.xz
dovecot-antispam-167942c6a930fe02184e2cc02c6e48e187565b4f.zip
change build system a bit
Before this change it used to rm $objs after building, also this change introduces a new PLUGIN_NAME variable so you can override the plugin name from the make command line.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 8 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index 89b8611..5f1e362 100644
--- a/Makefile
+++ b/Makefile
@@ -12,6 +12,9 @@ CFLAGS += -I$(DOVECOT)/src/lib-imap/
CFLAGS += -I$(DOVECOT)/src/lib-dict/
CFLAGS += -I$(DOVECOT)/src/imap/
+# output name
+PLUGIN_NAME ?= lib90_antispam_plugin.so
+
# debug rules
ifeq ("$(DEBUG)", "stderr")
CFLAGS += -DCONFIG_DEBUG -DDEBUG_STDERR
@@ -53,21 +56,21 @@ CFLAGS += -fPIC -shared -Wall
CC ?= "gcc"
objs += antispam-plugin.o $(BACKEND).o
-ALL = lib90_antispam_plugin.so
+ALL = plugin
all: verify_config $(ALL)
%.o: %.c .config antispam-plugin.h
$(CC) -c $(CFLAGS) -o $@ $<
-%.so: $(objs)
- $(CC) $(CFLAGS) $(objs) -o $@ $(LDFLAGS)
+plugin: $(objs)
+ $(CC) $(CFLAGS) $(objs) -o $(PLUGIN_NAME) $(LDFLAGS)
clean:
- rm -f *.so *.o *~
+ rm -f $(PLUGIN_NAME) *.o *~
install: all
- install -o root -g root -m 0660 lib90_antispam_plugin.so $(INSTALLDIR)/
+ install -o root -g root -m 0660 $(PLUGIN_NAME) $(INSTALLDIR)/
verify_config:
@if [ ! -r .config ]; then \