Looking for Makefile advice if applicable

Will Fiveash will.fiveash at oracle.com
Tue Feb 28 14:54:36 EST 2017


I'm wondering if there is a better way to achieve the following: I'm
creating a new crypto provider for krb5 and in doing that I've created
the src/lib/crypto/ucrypto/ subdirectory.  The contents of that
directory are similar to what is in the src/lib/crypto/openssl directory
except that some of the cipher support is coming from source under
src/lib/crypto/builtin like des.  What I got working was to create 
src/lib/crypto/ucrypto/des and in that dir I created symlinks like

des_int.h -> ../../builtin/des/des_int.h
des_keys.c -> ../../builtin/des/des_keys.c
destest.c -> ../../builtin/des/destest.c
...

I am able to build the ucrypto provider this way but I'm wondering if
there is a more refined way of doing this via the Makefile?  I did play
around with modifying the src/lib/crypto/ucrypto/des/Makefile.in
like so:

--- Makefile.in 2017-02-08 17:48:37.000000000 +0000
+++ ../des/Makefile.in  2017-02-28 12:34:15.464204753 +0000
@@ -1,6 +1,9 @@
 mydir=lib$(S)crypto$(S)ucrypto$(S)des
 BUILDTOP=$(REL)..$(S)..$(S)..$(S)..
-LOCALINCLUDES = -I$(srcdir)/.. -I$(srcdir)/../../krb -I $(srcdir)/../../builtin
+builtinsrc=$(top_srcdir)/lib/crypto/builtin
+dessrc=$(builtinsrc)/des
+LOCALINCLUDES = -I $(dessrc) -I$(srcdir)/.. -I$(srcdir)/../../krb -I $(builtinsrc)

 ##DOS##BUILDTOP = ..\..\..\..
 ##DOS##PREFIXDIR = builtin\des
@@ -29,18 +32,18 @@
        $(OUTPRE)key_sched.$(OBJEXT)    \
        $(OUTPRE)weak_key.$(OBJEXT)

-SRCS=  $(srcdir)/d3_aead.c     \
-       $(srcdir)/d3_kysched.c  \
-       $(srcdir)/des_keys.c    \
-       $(srcdir)/f_aead.c      \
-       $(srcdir)/f_cksum.c     \
-       $(srcdir)/f_parity.c    \
-       $(srcdir)/f_sched.c     \
-       $(srcdir)/f_tables.c    \
-       $(srcdir)/key_sched.c   \
-       $(srcdir)/weak_key.c
+SRCS=  $(dessrc)/d3_aead.c     \
+       $(dessrc)/d3_kysched.c  \
+       $(dessrc)/des_keys.c    \
+       $(dessrc)/f_aead.c      \
+       $(dessrc)/f_cksum.c     \
+       $(dessrc)/f_parity.c    \
+       $(dessrc)/f_sched.c     \
+       $(dessrc)/f_tables.c    \
+       $(dessrc)/key_sched.c   \
+       $(dessrc)/weak_key.c

-EXTRADEPSRCS = $(srcdir)/destest.c $(srcdir)/f_cbc.c $(srcdir)/t_verify.c
+EXTRADEPSRCS = $(dessrc)/destest.c $(dessrc)/f_cbc.c $(dessrc)/t_verify.c

without any symlinks in the des dir but when I try to build I see:

making all in lib/crypto/ucrypto/des...
gmake[4]: Entering directory '/export/home/wfiveash/hg/i386/mit-krb5-1.14o-bld/lib/crypto/ucrypto/des'
gmake[4]: *** No rule to make target 'd3_aead.c', needed by 'd3_aead.so'.  Stop.

Suggestions welcome.

-- 
Will Fiveash
Oracle Solaris Software Engineer


More information about the krbdev mailing list