Commit 084ef969 authored by Niels Möller's avatar Niels Möller
Browse files

Split nettle library into two files, libnettle.a

and libhogweed.a, and similarly for the shared libraries.

Rev: nettle/Makefile.in:1.2
parent c40f0aa2
...@@ -19,9 +19,11 @@ SUBDIRS = tools testsuite examples ...@@ -19,9 +19,11 @@ SUBDIRS = tools testsuite examples
include config.make include config.make
PRE_CPPFLAGS = -I. PRE_CPPFLAGS = -I.
LIBTARGETS = libnettle.a @IF_HOGWEED@ libhogweed.a
SHLIBTARGETS = $(LIBNETTLE_FORLINK) @IF_HOGWEED@ $(LIBHOGWEED_FORLINK)
TARGETS = aesdata$(EXEEXT) desdata$(EXEEXT) shadata$(EXEEXT) \ TARGETS = aesdata$(EXEEXT) desdata$(EXEEXT) shadata$(EXEEXT) \
libnettle.a $(SHLIBTARGET) $(LIBTARGETS) @IF_SHARED@ $(SHLIBTARGETS)
DOCTARGETS = nettle.info nettle.html nettle.pdf DOCTARGETS = nettle.info nettle.html nettle.pdf
...@@ -65,24 +67,25 @@ nettle_SOURCES = aes-decrypt-internal.c aes-decrypt.c \ ...@@ -65,24 +67,25 @@ nettle_SOURCES = aes-decrypt-internal.c aes-decrypt.c \
serpent.c serpent-meta.c \ serpent.c serpent-meta.c \
twofish.c twofish-meta.c \ twofish.c twofish-meta.c \
yarrow256.c yarrow_key_event.c \ yarrow256.c yarrow_key_event.c \
sexp.c sexp-format.c \
sexp-transport.c sexp-transport-format.c \
bignum.c bignum-random.c sexp2bignum.c \
pkcs1.c pkcs1-rsa-md5.c pkcs1-rsa-sha1.c pkcs1-rsa-sha256.c \
rsa.c rsa-sign.c rsa-verify.c \
rsa-md5-sign.c rsa-md5-verify.c \
rsa-sha1-sign.c rsa-sha1-verify.c \
rsa-sha256-sign.c rsa-sha256-verify.c \
rsa-encrypt.c rsa-decrypt.c \
rsa-keygen.c rsa-compat.c \
rsa2sexp.c sexp2rsa.c \
dsa.c dsa-sign.c dsa-verify.c dsa-keygen.c \
sexp2dsa.c \
pgp-encode.c rsa2openpgp.c \
der-iterator.c der2rsa.c \
buffer.c buffer-init.c realloc.c \ buffer.c buffer-init.c realloc.c \
nettle-internal.c nettle-internal.c
hogweed_SOURCES = sexp.c sexp-format.c \
sexp-transport.c sexp-transport-format.c \
bignum.c bignum-random.c sexp2bignum.c \
pkcs1.c pkcs1-rsa-md5.c pkcs1-rsa-sha1.c pkcs1-rsa-sha256.c \
rsa.c rsa-sign.c rsa-verify.c \
rsa-md5-sign.c rsa-md5-verify.c \
rsa-sha1-sign.c rsa-sha1-verify.c \
rsa-sha256-sign.c rsa-sha256-verify.c \
rsa-encrypt.c rsa-decrypt.c \
rsa-keygen.c rsa-compat.c \
rsa2sexp.c sexp2rsa.c \
dsa.c dsa-sign.c dsa-verify.c dsa-keygen.c \
sexp2dsa.c \
pgp-encode.c rsa2openpgp.c \
der-iterator.c der2rsa.c \
HEADERS = aes.h arcfour.h arctwo.h asn1.h bignum.h blowfish.h \ HEADERS = aes.h arcfour.h arctwo.h asn1.h bignum.h blowfish.h \
base16.h base64.h buffer.h cast128.h \ base16.h base64.h buffer.h cast128.h \
cbc.h ctr.h \ cbc.h ctr.h \
...@@ -101,7 +104,7 @@ HEADERS = aes.h arcfour.h arctwo.h asn1.h bignum.h blowfish.h \ ...@@ -101,7 +104,7 @@ HEADERS = aes.h arcfour.h arctwo.h asn1.h bignum.h blowfish.h \
INSTALL_HEADERS = $(HEADERS) nettle-stdint.h INSTALL_HEADERS = $(HEADERS) nettle-stdint.h
SOURCES = $(nettle_SOURCES) aesdata.c desdata.c shadata.c SOURCES = $(nettle_SOURCES) $(hogweed_SOURCES) aesdata.c desdata.c shadata.c
DISTFILES = $(SOURCES) $(HEADERS) .bootstrap aclocal.m4 configure.ac \ DISTFILES = $(SOURCES) $(HEADERS) .bootstrap aclocal.m4 configure.ac \
configure stamp-h.in \ configure stamp-h.in \
...@@ -114,26 +117,41 @@ DISTFILES = $(SOURCES) $(HEADERS) .bootstrap aclocal.m4 configure.ac \ ...@@ -114,26 +117,41 @@ DISTFILES = $(SOURCES) $(HEADERS) .bootstrap aclocal.m4 configure.ac \
asm.m4 \ asm.m4 \
nettle.texinfo nettle.info nettle.html nettle.pdf sha-example.c nettle.texinfo nettle.info nettle.html nettle.pdf sha-example.c
# Rules building libnettle.a # Rules building static libraries
# FIXME: Do we really need to delete the archive first?
nettle_OBJS = $(nettle_SOURCES:.c=.$(OBJEXT)) $(LIBOBJS) nettle_OBJS = $(nettle_SOURCES:.c=.$(OBJEXT)) $(LIBOBJS)
nettle_PURE_OBJS = $(nettle_OBJS:.$(OBJEXT)=.p$(OBJEXT)) nettle_PURE_OBJS = $(nettle_OBJS:.$(OBJEXT)=.p$(OBJEXT))
hogweed_OBJS = $(hogweed_SOURCES:.c=.$(OBJEXT)) $(LIBOBJS)
hogweed_PURE_OBJS = $(hogweed_OBJS:.$(OBJEXT)=.p$(OBJEXT))
# FIXME: Do we really need to delete the archive first?
libnettle.a: $(nettle_OBJS) libnettle.a: $(nettle_OBJS)
-rm -f $@ -rm -f $@
$(AR) $(ARFLAGS) $@ $(nettle_OBJS) $(AR) $(ARFLAGS) $@ $(nettle_OBJS)
$(RANLIB) $@ $(RANLIB) $@
# FIXME: Do we really need to delete the archive first?
libhogweed.a: $(hogweed_OBJS)
-rm -f $@
$(AR) $(ARFLAGS) $@ $(hogweed_OBJS)
$(RANLIB) $@
.c.$(OBJEXT): .c.$(OBJEXT):
$(COMPILE) $(CCPIC_MAYBE) -c $< \ $(COMPILE) $(CCPIC_MAYBE) -c $< \
&& $(DEP_PROCESS) && $(DEP_PROCESS)
# Rules building libnettle.so # Rules building shared libraries
$(SHLIBFORLINK): $(nettle_PURE_OBJS) $(LIBNETTLE_FORLINK): $(nettle_PURE_OBJS)
$(SHLIBLINK) $(nettle_PURE_OBJS) -o $@ $(SHLIBLIBS) $(SHLIBLINK) $(nettle_PURE_OBJS) -o $@ $(LIBNETTLE_LIBS)
-mkdir .lib 2>/dev/null
[ -z "$(LIBNETTLE_SONAME)" ] || (cd .lib \
&& ln -sf ../$(LIBNETTLE_FORLINK) $(LIBNETTLE_SONAME))
$(LIBHOGWEED_FORLINK): $(hogweed_PURE_OBJS)
$(SHLIBLINK) $(hogweed_PURE_OBJS) -o $@ $(LIBHOGWEED_LIBS)
-mkdir .lib 2>/dev/null -mkdir .lib 2>/dev/null
[ -z "$(SHLIBSONAME)" ] || (cd .lib \ [ -z "$(LIBHOGWEED_SONAME)" ] || (cd .lib \
&& ln -sf ../$(SHLIBFORLINK) $(SHLIBSONAME)) && ln -sf ../$(LIBHOGWEED_FORLINK) $(LIBHOGWEED_SONAME))
.c.p$(OBJEXT): .c.p$(OBJEXT):
$(COMPILE) $(SHLIBCFLAGS) -c $< -o $@ \ $(COMPILE) $(SHLIBCFLAGS) -c $< -o $@ \
...@@ -229,18 +247,30 @@ config.m4: config.m4.in config.status ...@@ -229,18 +247,30 @@ config.m4: config.m4.in config.status
./config.status $@ ./config.status $@
# Installation # Installation
# FIXME: Use mkinstalldirs. install-here: install-info install-headers install-static \
install-here: install-info install-headers libnettle.a $(SHLIBINSTALL) @IF_SHARED$ install-shared-nettle @IF_HOGWEED@ install-shared-hogweed
install-static: $(LIBTARGETS)
$(MKDIR_P) $(DESTDIR)$(libdir) $(MKDIR_P) $(DESTDIR)$(libdir)
$(INSTALL_DATA) libnettle.a $(DESTDIR)$(libdir) for f in $(LIBTARGETS); do \
$(INSTALL_DATA) $$f $(DESTDIR)$(libdir) ; \
done
install-shared-nettle: $(LIBNETTLE_FORLINK)
$(MKDIR_P) $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) $(LIBNETTLE_FORLINK) $(DESTDIR)$(libdir)/$(LIBNETTLE_FILE)
[ -z "$(LIBNETTLE_SONAME)" ] \
|| (cd $(DESTDIR)$(libdir) \
&& ln -sf $(LIBNETTLE_FILE) $(LIBNETTLE_SONAME) \
&& ln -sf $(LIBNETTLE_FILE) $(LIBNETTLE_FORLINK)
install-shared: $(SHLIBFORLINK) install-shared-hogweed: $(LIBHOGWEED_FORLINK)
$(MKDIR_P) $(DESTDIR)$(libdir) $(MKDIR_P) $(DESTDIR)$(libdir)
$(INSTALL_PROGRAM) $(SHLIBFORLINK) $(DESTDIR)$(libdir)/$(SHLIBFILE) $(INSTALL_PROGRAM) $(LIBHOGWEED_FORLINK) $(DESTDIR)$(libdir)/$(LIBHOGWEED_FILE)
[ -z "$(SHLIBSONAME)" ] \ [ -z "$(LIBHOGWEED_SONAME)" ] \
|| (cd $(DESTDIR)$(libdir) \ || (cd $(DESTDIR)$(libdir) \
&& ln -sf $(SHLIBFILE) $(SHLIBSONAME) \ && ln -sf $(LIBHOGWEED_FILE) $(LIBHOGWEED_SONAME) \
&& ln -sf $(SHLIBFILE) $(SHLIBFORLINK) ) && ln -sf $(LIBHOGWEED_FILE) $(LIBHOGWEED_FORLINK)
# I'd like to use makes VPATH search to locate the files to be # I'd like to use makes VPATH search to locate the files to be
# installed. But it seems most make programs don't set $<, $^, $? and # installed. But it seems most make programs don't set $<, $^, $? and
...@@ -268,8 +298,13 @@ install-headers: $(INSTALL_HEADERS) ...@@ -268,8 +298,13 @@ install-headers: $(INSTALL_HEADERS)
fi ; done fi ; done
# Uninstall # Uninstall
uninstall-here: uninstall-info uninstall-headers uninstall-shared uninstall-here: uninstall-info uninstall-headers uninstall-static \
rm -f $(DESTDIR)$(libdir)/libnettle.a @IF_SHARED@ uninstall-shared
uninstall-static:
for f in $(STATIC_LIBS) ; do \
rm -f $(DESTDIR)$(libdir)/$$f ; \
done
uninstall-headers: uninstall-headers:
for f in $(INSTALL_HEADERS) ; do \ for f in $(INSTALL_HEADERS) ; do \
...@@ -284,8 +319,17 @@ uninstall-info: ...@@ -284,8 +319,17 @@ uninstall-info:
-rm -f $(DESTDIR)$(infodir)/nettle.info -rm -f $(DESTDIR)$(infodir)/nettle.info
# FIXME: Leaves the links around # FIXME: Leaves the links around
uninstall-shared: uninstall-shared: uninstall-shared-nettle @IF_HOGWEED@ uninstall-shared-hogweed
test -z "$(SHLIBINSTALL)" || rm -f $(DESTDIR)$(libdir)/$(SHLIBFILE)
uninstall-shared-nettle:
rm -f $(DESTDIR)$(libdir)/$(LIBNETTLE_FILE)
[ -z "$(LIBNETTLE_SONAME)" ] \
|| rm -f $(LIBNETTLE_SONAME) $(LIBNETTLE_FORLINK)
uninstall-shared-hogweed:
rm -f $(DESTDIR)$(libdir)/$(LIBHOGWEED_FILE)
[ -z "$(LIBHOGWEED_SONAME)" ] \
|| rm -f $(LIBHOGWEED_SONAME) $(LIBHOGWEED_FORLINK)
# Distribution # Distribution
distdir = $(PACKAGE_NAME)-$(PACKAGE_VERSION) distdir = $(PACKAGE_NAME)-$(PACKAGE_VERSION)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment