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