Subversion Repositories

?revision_form?Rev ?revision_input??revision_submit??revision_endform?

Rev 32 | Rev 41 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 32 Rev 33
1
# libdkim makefile for UNIX
1
# libdkim makefile for UNIX
2
#
2
#
3
srcdir = @srcdir@
3
srcdir = @srcdir@
4
VPATH = @srcdir@
4
VPATH = @srcdir@
5
5
6
prefix	=	@prefix@
6
prefix	=	@prefix@
7
exec_prefix =	@exec_prefix@
7
exec_prefix =	@exec_prefix@
8
bindir =	@bindir@
8
bindir =	@bindir@
9
libdir =	@libdir@
9
libdir =	@libdir@
10
includedir =	@includedir@
10
includedir =	@includedir@
11
11
12
OBJEXT = @OBJEXT@
12
OBJEXT = @OBJEXT@
13
LIBS    = @LIBS@ @libcrypto_LIBS@
13
LIBS    = @LIBS@ @libcrypto_LIBS@
14
14
15
CC = @CC@
15
CC = @CC@
16
CXX = @CXX@
16
CXX = @CXX@
17
17
18
CFLAGS = @CFLAGS@
18
CFLAGS = @CFLAGS@
19
CXXFLAGS = @CXXFLAGS@
19
CXXFLAGS = @CXXFLAGS@
20
CPPFLAGS = @CPPFLAGS@
20
CPPFLAGS = @CPPFLAGS@
21
21
22
INCL	= 
22
INCL	= 
23
LDFLAGS = @LDFLAGS@
23
LDFLAGS = @LDFLAGS@
24
24
25
libdkim_SOURCES = dkim.cpp dns.cpp dkimbase.cpp dkimsign.cpp dkimverify.cpp
25
libdkim_SOURCES = dkim.cpp dns.cpp dkimbase.cpp dkimsign.cpp dkimverify.cpp
26
HEADERS = dkim.h dns.h dkimbase.h dkimsign.h dkimverify.h
26
HEADERS = dkim.h dns.h dkimbase.h dkimsign.h dkimverify.h
27
27
28
libdkim_OBJS = $(libdkim_SOURCES:.cpp=.$(OBJEXT))
28
libdkim_OBJS = $(libdkim_SOURCES:.cpp=.$(OBJEXT))
29
libdkim_PURE_OBJS = $(libdkim_SOURCES:.cpp=.p$(OBJEXT))
29
libdkim_PURE_OBJS = $(libdkim_SOURCES:.cpp=.p$(OBJEXT))
30
30
31
libdkimtest_SOURCES = libdkimtest.cpp
31
libdkimtest_SOURCES = libdkimtest.cpp
32
libdkimtest_OBJS = libdkimtest.$(OBJEXT)
32
libdkimtest_OBJS = libdkimtest.$(OBJEXT)
33
33
34
SHLIBFORLINK = libdkim.so
34
SHLIBFORLINK = libdkim.so
35
SHLIBSONAME = $(SHLIBFORLINK).$(SHLIBMAJOR)
35
SHLIBSONAME = $(SHLIBFORLINK).$(SHLIBMAJOR)
36
SHLIBTARGET = $(SHLIBFORLINK)
36
SHLIBTARGET = $(SHLIBFORLINK)
37
SHLIBLINK = $(CXX) $(LDFLAGS) -shared -Wl,-soname=$(SHLIBSONAME)
37
SHLIBLINK = $(CXX) $(LDFLAGS) -shared -Wl,-soname=$(SHLIBSONAME) -Wl,-version-script=debian/libdkim.ver
38
SHLIBMAJOR = 0d
38
SHLIBMAJOR = 0d
39
SHLIBMINOR = 1
39
SHLIBMINOR = 1
40
SHLIBFILE = $(SHLIBSONAME).$(SHLIBMINOR)
40
SHLIBFILE = $(SHLIBSONAME).$(SHLIBMINOR)
41
SHLIBCFLAGS = -fPIC
41
SHLIBCFLAGS = -fPIC
42
42
43
ARFLAGS = crs
43
ARFLAGS = crs
44
44
45
TARGETS = libdkim.a $(SHLIBTARGET) libdkimtest
45
TARGETS = libdkim.a $(SHLIBTARGET) libdkimtest
46
46
47
all: $(TARGETS)
47
all: $(TARGETS)
48
48
49
libdkim.a: $(libdkim_OBJS)
49
libdkim.a: $(libdkim_OBJS)
50
	-rm -f $@
50
	-rm -f $@
51
	$(AR) $(ARFLAGS) $@ $(libdkim_OBJS)
51
	$(AR) $(ARFLAGS) $@ $(libdkim_OBJS)
52
52
53
$(SHLIBFORLINK): $(libdkim_PURE_OBJS)
53
$(SHLIBFORLINK): $(libdkim_PURE_OBJS)
54
	$(SHLIBLINK) -o $@ $(LIBS) $(libdkim_PURE_OBJS)
54
	$(SHLIBLINK) -o $@ $(LIBS) $(libdkim_PURE_OBJS)
55
	-mkdir .lib 2>/dev/null
55
	-mkdir .lib 2>/dev/null
56
	[ -z "$(SHLIBSONAME)" ] || (cd .lib \
56
	[ -z "$(SHLIBSONAME)" ] || (cd .lib \
57
          && ln -sf ../$(SHLIBFORLINK) $(SHLIBSONAME))
57
          && ln -sf ../$(SHLIBFORLINK) $(SHLIBSONAME))
58
58
59
libdkimtest: $(libdkimtest_OBJS) libdkim.a
59
libdkimtest: $(libdkimtest_OBJS) libdkim.a
60
	$(CXX) -static -o $@ libdkimtest.o libdkim.a $(LIBS)
60
	$(CXX) -static -o $@ libdkimtest.o libdkim.a $(LIBS)
61
61
62
libdkimtest.o: $(libdkimtest_SOURCES) $(HDRS)
62
libdkimtest.o: $(libdkimtest_SOURCES) $(HDRS)
63
	$(CXX) $(CXXFLAGS) -o $@ -c $<
63
	$(CXX) $(CXXFLAGS) -o $@ -c $<
64
64
65
%.$(OBJEXT): %.cpp $(HDRS)
65
%.$(OBJEXT): %.cpp $(HDRS)
66
	$(CXX) $(CXXFLAGS) -o $@ -c $<
66
	$(CXX) $(CXXFLAGS) -o $@ -c $<
67
67
68
%.p$(OBJEXT): %.cpp $(HDRS)
68
%.p$(OBJEXT): %.cpp $(HDRS)
69
	$(CXX) $(SHLIBCFLAGS) $(CXXFLAGS) -o $@ -c $<
69
	$(CXX) $(SHLIBCFLAGS) $(CXXFLAGS) -o $@ -c $<
70
70
71
clean:
71
clean:
72
	-rm -f *.$(OBJEXT) *.p$(OBJEXT) $(TARGETS)
72
	-rm -f *.$(OBJEXT) *.p$(OBJEXT) $(TARGETS)
73
	-rm -rf .lib
73
	-rm -rf .lib
74
74
75
distclean: clean
75
distclean: clean
76
	-rm -f config.status config.log Makefile libdkim.pc
76
	-rm -f config.status config.log Makefile libdkim.pc
77
77
78
install: all
78
install: all
79
	install -m 755 -d $(DESTDIR)$(libdir)
79
	install -m 755 -d $(DESTDIR)$(libdir)
80
	install -m 755 -d $(DESTDIR)$(libdir)/pkgconfig
80
	install -m 755 -d $(DESTDIR)$(libdir)/pkgconfig
81
	install -m 755 -d $(DESTDIR)$(includedir)
81
	install -m 755 -d $(DESTDIR)$(includedir)
82
	install -m 644 libdkim.a $(DESTDIR)$(libdir)
82
	install -m 644 libdkim.a $(DESTDIR)$(libdir)
83
	install -m 755 $(SHLIBFORLINK) $(DESTDIR)$(libdir)/$(SHLIBFILE)
83
	install -m 755 $(SHLIBFORLINK) $(DESTDIR)$(libdir)/$(SHLIBFILE)
84
	[ -z "$(SHLIBSONAME)" ] \
84
	[ -z "$(SHLIBSONAME)" ] \
85
                || (cd $(DESTDIR)$(libdir) \
85
                || (cd $(DESTDIR)$(libdir) \
86
		&& ln -sf $(SHLIBFILE) $(SHLIBSONAME) \
86
		&& ln -sf $(SHLIBFILE) $(SHLIBSONAME) \
87
		&& ln -sf $(SHLIBFILE) $(SHLIBFORLINK) )
87
		&& ln -sf $(SHLIBFILE) $(SHLIBFORLINK) )
88
	install -m 644 $(srcdir)/dkim.h $(DESTDIR)$(includedir)
88
	install -m 644 $(srcdir)/dkim.h $(DESTDIR)$(includedir)
89
	install -m 644 libdkim.pc $(DESTDIR)$(libdir)/pkgconfig
89
	install -m 644 libdkim.pc $(DESTDIR)$(libdir)/pkgconfig
90
90
91
.PHONY: all install clean distclean
91
.PHONY: all install clean distclean