Subversion Repositories

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

Rev 15 | 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
SHLIBSONAME = $(SHLIBFORLINK).$(SHLIBMAJOR)
36
SHLIBTARGET = $(SHLIBFORLINK)
15 magnus 37
SHLIBLINK = $(CXX) $(LDFLAGS) -shared -Wl,-soname=$(SHLIBSONAME)
9 magnus 38
SHLIBMAJOR = 1
2 magnus 39
SHLIBMINOR = 0
40
SHLIBFILE = $(SHLIBSONAME).$(SHLIBMINOR)
41
SHLIBCFLAGS = -fPIC
42
 
43
ARFLAGS = crs
44
 
45
TARGETS = libdkim.a $(SHLIBTARGET) libdkimtest
46
 
47
all: $(TARGETS)
48
 
49
libdkim.a: $(libdkim_OBJS)
50
	-rm -f $@
51
	$(AR) $(ARFLAGS) $@ $(libdkim_OBJS)
52
 
15 magnus 53
$(SHLIBFORLINK): $(libdkim_PURE_OBJS)
2 magnus 54
	$(SHLIBLINK) -o $@ $(LIBS) $(libdkim_PURE_OBJS)
55
	-mkdir .lib 2>/dev/null
56
	[ -z "$(SHLIBSONAME)" ] || (cd .lib \
57
          && ln -sf ../$(SHLIBFORLINK) $(SHLIBSONAME))
58
 
59
libdkimtest: $(libdkimtest_OBJS) libdkim.a
60
	$(CXX) -static -o $@ libdkimtest.o libdkim.a $(LIBS)
61
 
62
libdkimtest.o: $(libdkimtest_SOURCES) $(HDRS)
63
	$(CXX) $(CXXFLAGS) -o $@ -c $<
64
 
65
%.$(OBJEXT): %.cpp $(HDRS)
66
	$(CXX) $(CXXFLAGS) -o $@ -c $<
67
 
68
%.p$(OBJEXT): %.cpp $(HDRS)
69
	$(CXX) $(SHLIBCFLAGS) $(CXXFLAGS) -o $@ -c $<
70
 
71
clean:
72
	-rm -f *.$(OBJEXT) *.p$(OBJEXT) $(TARGETS)
73
	-rm -rf .lib
74
 
75
distclean: clean
76
	-rm -f config.status config.log Makefile libdkim.pc
77
 
78
install: all
79
	install -m 755 -d $(DESTDIR)$(libdir)
80
	install -m 755 -d $(DESTDIR)$(libdir)/pkgconfig
81
	install -m 755 -d $(DESTDIR)$(includedir)
82
	install -m 644 libdkim.a $(DESTDIR)$(libdir)
83
	install -m 755 $(SHLIBFORLINK) $(DESTDIR)$(libdir)/$(SHLIBFILE)
84
	[ -z "$(SHLIBSONAME)" ] \
85
                || (cd $(DESTDIR)$(libdir) \
86
		&& ln -sf $(SHLIBFILE) $(SHLIBSONAME) \
87
		&& ln -sf $(SHLIBFILE) $(SHLIBFORLINK) )
88
	install -m 644 $(srcdir)/dkim.h $(DESTDIR)$(includedir)
89
	install -m 644 libdkim.pc $(DESTDIR)$(libdir)/pkgconfig
90
 
91
.PHONY: all install clean distclean