2011-03-06 07:32:33 -05:00
|
|
|
DESTDIR =
|
2011-04-04 17:19:35 -04:00
|
|
|
PREFIX = /usr/local
|
|
|
|
BINDIR = $(PREFIX)/bin
|
|
|
|
SHAREDIR = $(PREFIX)/share/imapfilter
|
|
|
|
MANDIR = $(PREFIX)/man
|
2011-03-06 07:32:33 -05:00
|
|
|
|
2012-02-19 06:36:44 -05:00
|
|
|
MYCFLAGS =
|
|
|
|
MYLDFLAGS =
|
|
|
|
MYLIBS =
|
|
|
|
|
|
|
|
INCDIRS =
|
|
|
|
LIBDIRS =
|
|
|
|
|
|
|
|
LIBLUA = -llua
|
|
|
|
LIBPCRE = -lpcre
|
|
|
|
LIBSSL = -lssl
|
|
|
|
LIBCRYPTO = -lcrypto
|
|
|
|
|
|
|
|
CFLAGS = -Wall -O -DCONFIG_SHAREDIR='"$(SHAREDIR)"' $(INCDIRS) $(MYCFLAGS)
|
|
|
|
LDFLAGS = $(LIBDIRS) $(MYLDFLAGS)
|
|
|
|
LIBS = -lm $(LIBLUA) $(LIBPCRE) $(LIBSSL) $(LIBCRYPTO) $(MYLIBS)
|
2011-03-06 07:32:33 -05:00
|
|
|
|
2011-04-04 17:19:35 -04:00
|
|
|
MAN1 = imapfilter.1
|
|
|
|
MAN5 = imapfilter_config.5
|
2011-03-06 07:32:33 -05:00
|
|
|
|
2011-04-04 17:19:35 -04:00
|
|
|
LUA = common.lua set.lua regex.lua account.lua mailbox.lua message.lua \
|
2012-02-14 16:13:15 -05:00
|
|
|
options.lua auxiliary.lua
|
2011-03-06 07:32:33 -05:00
|
|
|
|
|
|
|
BIN = imapfilter
|
2012-02-12 15:57:18 -05:00
|
|
|
OBJ = auth.o buffer.o cert.o core.o file.o imapfilter.o list.o log.o lua.o \
|
|
|
|
memory.o misc.o namespace.o pcre.o regexp.o request.o response.o \
|
2011-04-04 17:19:35 -04:00
|
|
|
session.o signal.o socket.o system.o
|
2011-03-06 07:32:33 -05:00
|
|
|
|
|
|
|
all: $(BIN)
|
|
|
|
|
|
|
|
$(BIN): $(OBJ)
|
|
|
|
$(CC) -o $(BIN) $(LDFLAGS) $(OBJ) $(LIBS)
|
|
|
|
|
|
|
|
$(OBJ): imapfilter.h
|
2011-04-04 17:19:35 -04:00
|
|
|
buffer.o: buffer.h
|
|
|
|
cert.o: pathnames.h session.h
|
|
|
|
file.o: pathnames.h
|
|
|
|
imapfilter.o: buffer.h list.h pathnames.h regexp.h session.h version.h
|
|
|
|
list.o: list.h
|
|
|
|
log.o: list.h pathnames.h session.h
|
|
|
|
lua.o: pathnames.h
|
|
|
|
namespace.o: buffer.h
|
|
|
|
regexp.o: regexp.h
|
|
|
|
request.o: buffer.h session.h
|
|
|
|
response.o: buffer.h regexp.h session.h
|
|
|
|
session.o: list.h session.h
|
|
|
|
socket.o: session.h
|
2011-03-06 07:32:33 -05:00
|
|
|
|
|
|
|
install: $(BIN)
|
2011-04-04 17:19:35 -04:00
|
|
|
mkdir -p $(DESTDIR)$(BINDIR) && \
|
2011-03-06 07:32:33 -05:00
|
|
|
cp -f $(BIN) $(DESTDIR)$(BINDIR) && \
|
2011-04-04 17:19:35 -04:00
|
|
|
chmod 0755 $(DESTDIR)$(BINDIR)/$(BIN)
|
|
|
|
mkdir -p $(DESTDIR)$(SHAREDIR) && \
|
|
|
|
cp -f $(LUA) $(DESTDIR)$(SHAREDIR) && \
|
|
|
|
chmod 0644 $(DESTDIR)$(SHAREDIR)/$(LUA)
|
|
|
|
mkdir -p $(DESTDIR)$(MANDIR)/man1 && \
|
|
|
|
cp -f ../doc/$(MAN1) $(DESTDIR)$(MANDIR)/man1 && \
|
|
|
|
chmod 0644 $(DESTDIR)$(MANDIR)/man1/$(MAN1)
|
|
|
|
mkdir -p $(DESTDIR)$(MANDIR)/man5 && \
|
|
|
|
cp -f ../doc/$(MAN5) $(DESTDIR)$(MANDIR)/man5 && \
|
|
|
|
chmod 0644 $(DESTDIR)$(MANDIR)/man5/$(MAN5)
|
|
|
|
|
|
|
|
uninstall:
|
|
|
|
rm -f $(DESTDIR)$(BINDIR)/$(BIN)
|
|
|
|
cd $(DESTDIR)$(SHAREDIR) && rm -f $(LUA)
|
|
|
|
rm -f $(DESTDIR)$(MANDIR)/man1/$(MAN1)
|
|
|
|
rm -f $(DESTDIR)$(MANDIR)/man5/$(MAN5)
|
2011-03-06 07:32:33 -05:00
|
|
|
|
|
|
|
clean:
|
2011-04-04 17:19:35 -04:00
|
|
|
rm -f $(OBJ) $(BIN) *~
|