Subversion Repositories

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

Rev 2 | Rev 5 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

# libdkim makefile for UNIX
#
srcdir = @srcdir@
VPATH = @srcdir@

prefix  =       @prefix@
exec_prefix =   @exec_prefix@
bindir =        @bindir@
libdir =        @libdir@
includedir =    @includedir@

OBJEXT = @OBJEXT@
LIBS    = @LIBS@ @libcrypto_LIBS@

CFLAGS = @CFLAGS@
CXXFLAGS = @CXXFLAGS@
CPPFLAGS = @CPPFLAGS@

INCL    = 
LDFLAGS = @LDFLAGS@

libdkim_SOURCES = dkim.cpp dns.cpp dkimbase.cpp dkimsign.cpp dkimverify.cpp
HEADERS = dkim.h dns.h dkimbase.h dkimsign.h dkimverify.h

libdkim_OBJS = $(libdkim_SOURCES:.cpp=.$(OBJEXT))
libdkim_PURE_OBJS = $(libdkim_SOURCES:.cpp=.p$(OBJEXT))

libdkimtest_SOURCES = libdkimtest.cpp
libdkimtest_OBJS = libdkimtest.$(OBJEXT)

SHLIBFORLINK = libdkim.so
SHLIBVERSCRIPT = debian/libdkim.ver
SHLIBSONAME = $(SHLIBFORLINK).$(SHLIBMAJOR)
SHLIBTARGET = $(SHLIBFORLINK)
SHLIBLINK = $(CXX) $(LDFLAGS) -shared -Wl,-soname=$(SHLIBSONAME) -Wl,-version-script=$(SHLIBVERSCRIPT)
SHLIBMAJOR = 0
SHLIBMINOR = 0
SHLIBFILE = $(SHLIBSONAME).$(SHLIBMINOR)
SHLIBCFLAGS = -fPIC

ARFLAGS = crs

TARGETS = libdkim.a $(SHLIBTARGET) libdkimtest

all: $(TARGETS)

libdkim.a: $(libdkim_OBJS)
        -rm -f $@
        $(AR) $(ARFLAGS) $@ $(libdkim_OBJS)

$(SHLIBFORLINK): $(libdkim_PURE_OBJS) $(SHLIBVERSCRIPT)
        $(SHLIBLINK) -o $@ $(LIBS) $(libdkim_PURE_OBJS)
        -mkdir .lib 2>/dev/null
        [ -z "$(SHLIBSONAME)" ] || (cd .lib \
          && ln -sf ../$(SHLIBFORLINK) $(SHLIBSONAME))

libdkimtest: $(libdkimtest_OBJS) libdkim.a
        $(CXX) -static -o $@ libdkimtest.o libdkim.a $(LIBS)

libdkimtest.o: $(libdkimtest_SOURCES) $(HDRS)
        $(CXX) $(CXXFLAGS) -o $@ -c $<

%.$(OBJEXT): %.cpp $(HDRS)
        $(CXX) $(CXXFLAGS) -o $@ -c $<

%.p$(OBJEXT): %.cpp $(HDRS)
        $(CXX) $(SHLIBCFLAGS) $(CXXFLAGS) -o $@ -c $<

clean:
        -rm -f *.$(OBJEXT) *.p$(OBJEXT) $(TARGETS)
        -rm -rf .lib

distclean: clean
        -rm -f config.status config.log Makefile libdkim.pc

install: all
        install -m 755 -d $(DESTDIR)$(libdir)
        install -m 755 -d $(DESTDIR)$(libdir)/pkgconfig
        install -m 755 -d $(DESTDIR)$(includedir)
        install -m 644 libdkim.a $(DESTDIR)$(libdir)
        install -m 755 $(SHLIBFORLINK) $(DESTDIR)$(libdir)/$(SHLIBFILE)
        [ -z "$(SHLIBSONAME)" ] \
                || (cd $(DESTDIR)$(libdir) \
                && ln -sf $(SHLIBFILE) $(SHLIBSONAME) \
                && ln -sf $(SHLIBFILE) $(SHLIBFORLINK) )
        install -m 644 $(srcdir)/dkim.h $(DESTDIR)$(includedir)
        install -m 644 libdkim.pc $(DESTDIR)$(libdir)/pkgconfig

.PHONY: all install clean distclean