File: Makefile

package info (click to toggle)
sa-exim 4.2-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 356 kB
  • ctags: 154
  • sloc: ansic: 1,296; perl: 200; makefile: 108; sh: 77
file content (107 lines) | stat: -rw-r--r-- 3,524 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# SA-Exim can be built standalone as a loadable module with this Makefile
# or you can copy sa-exim.c over exim's local_scan.c file if you want to
# statically build it into exim
#

VERSION=$(shell cat version)

# The idea is that you don't have to edit these values, you can override
# them on the command line:
# make SACONF=/etc/exim/sa-exim.conf LDFLAGS="-shared -fPIC" CC=cc
CC=gcc
CFLAGS=-O2 -Wall
LDFLAGS=-shared
SACONF=/etc/exim4/sa-exim.conf
SPAMC=/usr/bin/spamc


# I place the directory in exim/debian/local_scan. Adjust the path as needed
# Actually, we will also look for the versions supplied with this source
# if we can't find the exim source
EXIM_SRC= ../../src
EXIM_SRC_LOCAL = ./eximinc
SUFF=-$(VERSION)

SAFLAGS=-DSPAMASSASSIN_CONF=\"$(SACONF)\" -DSPAMC_LOCATION=\"$(SPAMC)\"
BUILDCFLAGS=-I$(EXIM_SRC) -I$(EXIM_SRC_LOCAL) -DDLOPEN_LOCAL_SCAN $(SAFLAGS) $(CFLAGS)

SONAME=$(subst .so,$(SUFF).so,sa-exim.so)

DOCS=sa.html CHANGELOG ACKNOWLEDGEMENTS
OBJECTS=$(SONAME) accept.so sa-exim_short.conf $(DOCS)
OTHERTARGETS=sa-exim.h

all: $(OBJECTS)

docs: $(DOCS)
	

$(SONAME) : sa-exim.c sa-exim.h
	@echo "Building $@"
	$(CC) $(BUILDCFLAGS) $(LDFLAGS) -o $@ $<
	chmod a+rx $(SONAME)

accept.so: accept.c
	@echo "Building $@"
	$(CC) $(BUILDCFLAGS) $(LDFLAGS) -o $@ $<
	chmod a+rx $@

ACKNOWLEDGEMENTS: Acknowledgements.html
	@echo "Generating $@"
	@lynx -dump -nolist $< > $@

CHANGELOG: Changelog.html
	@echo "Generating $@"
	@lynx -dump -nolist $< > $@

sa.html: Changelog.html Acknowledgements.html sa.html.template
	@echo "Generating $@"
	@bash -c 'sed "/<Changelog>/,$$ d" < sa.html.template; cat Changelog.html; sed "1,/<\/Changelog>/ d; /<Acknowledgements>/,$$ d" < sa.html.template; cat Acknowledgements.html; sed "1,/<\/Acknowledgements>/ d" < sa.html.template' > sa.html

sa-exim_short.conf: sa-exim.conf
	@cat sa-exim.conf | sed "/# --- snip ---/,$$ d" > sa-exim_short.conf
	@cat sa-exim.conf | grep -v "^#" | tr '\012' '�' | sed "s/���*/��/g" | tr '�' '\012' >> sa-exim_short.conf

sa-exim.h: sa-exim.c version
	echo "char *version=\"`cat version` (built `date -R 2>/dev/null || date`)\";" > sa-exim.h

clean:	
	@-rm -rf $(OBJECTS) $(DOCS) $(OTHERTARGETS) build-stamp configure-stamp debian/sa-exim debian/sa-exim.postrm.debhelper debian/sa-exim.substvars debian/files 2>/dev/null

deb:	../sa-exim_$(VERSION).orig.tar.gz debian/*
	@make clean
	@dpkg-buildpackage -uc -us -sd -rfakeroot
	@make clean

../sa-exim_$(VERSION).orig.tar.gz: * */*
	@make clean
	@( cd ..; tar chvzf sa-exim_$(VERSION).orig.tar.gz sa-exim-$(VERSION) )

# This didn't work too well, I'll just ship the source with the debian tree
#deb:	../sa-exim_$(VERSION).orig.tar.gz debian/rules
#	@make clean
#	@dpkg-buildpackage -uc -us -sd -rfakeroot
#
#
#../sa-exim_$(VERSION).tar.gz: * */*
#	@make clean
#	@if [ -d debian ]; then echo "Can't rebuild $@ with debian tree unpacked, please remove it"; exit 1; fi
#	@( cd ..; tar chvzf sa-exim_$(VERSION).tar.gz sa-exim-$(VERSION) )
#
#
#../sa-exim_$(VERSION).orig.tar.gz: ../sa-exim_$(VERSION).tar.gz
#	if [ -e ../sa-exim-$(VERSION).tar.gz ] ; then \
#	    cp -a ../sa-exim-$(VERSION).tar.gz ../sa-exim_$(VERSION).orig.tar.gz ; \
#        else \
#	    wget http://marc.merlins.org/linux/sa-exim-$(VERSION).tar.gz; \
#	    mv sa-exim-$(VERSION).tar.gz ../sa-exim_$(VERSION).orig.tar.gz; \
#        fi
#
#
#debian/rules:
#	@wget http://marc.merlins.org/linux/exim/files/debian/sa-exim_diff.gz
#	@zcat sa-exim_diff.gz | patch -s -p1
#	@/bin/rm sa-exim_diff.gz
#	@chmod 755 debian/rules
#