Subversion Repositories

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

Rev 9 | Rev 15 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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