From 167942c6a930fe02184e2cc02c6e48e187565b4f Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 2 Oct 2007 01:20:49 +0200 Subject: 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. --- Makefile | 13 ++++++++----- 1 file 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 \ -- cgit v1.2.3