mirror of
https://github.com/openssl/openssl.git
synced 2025-02-11 14:22:43 +08:00
This takes us away from the idea that we know exactly how our static libraries are going to get used. Instead, we make them available to build shareable things with, be it other shared libraries or DSOs. On the other hand, we also have greater control of when the shared library cflags. They will never be used with object files meant got binaries, such as apps/openssl or test/test*. With unified, we take this a bit further and prepare for having to deal with extra cflags specifically to be used with DSOs (dynamic engines), libraries and binaries (applications). Reviewed-by: Rich Salz <rsalz@openssl.org>
117 lines
2.7 KiB
Makefile
117 lines
2.7 KiB
Makefile
#
|
|
# OpenSSL/engines/Makefile
|
|
#
|
|
|
|
#The following engines have been disabled as they currently do not build
|
|
# sureware ubsec
|
|
|
|
DIR= engines
|
|
TOP= ..
|
|
CC= cc
|
|
INCLUDES= -I../include
|
|
CFLAG=-g
|
|
MAKEFILE= Makefile
|
|
AR= ar r
|
|
|
|
PADLOCK_ASM_OBJ=
|
|
|
|
PLIB_LDFLAG=
|
|
EX_LIBS=
|
|
|
|
CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
|
|
ASFLAGS= $(INCLUDES) $(ASFLAG)
|
|
AFLAGS= $(ASFLAGS)
|
|
|
|
GENERAL=Makefile engines.com install.com engine_vector.mar
|
|
|
|
LIB=$(TOP)/libcrypto.a
|
|
LIBNAMES= padlock capi dasync
|
|
LIBSRC= \
|
|
e_padlock.c \
|
|
e_capi.c \
|
|
e_dasync.c
|
|
LIBOBJ= \
|
|
e_padlock.o \
|
|
e_capi.o \
|
|
e_dasync.o \
|
|
$(PADLOCK_ASM_OBJ)
|
|
|
|
TESTLIBNAMES= ossltest
|
|
TESTLIBSRC= e_ossltest.c
|
|
TESTLIBOBJ= e_ossltest.o
|
|
|
|
SRC= $(LIBSRC)
|
|
|
|
HEADER= \
|
|
e_chil_err.c e_chil_err.h \
|
|
e_ubsec_err.c e_ubsec_err.h \
|
|
e_capi_err.c e_capi_err.h \
|
|
e_ossltest_err.c e_ossltest_err.h \
|
|
e_dasync_err.c e_dasync_err.h
|
|
|
|
ALL= $(GENERAL) $(SRC) $(HEADER)
|
|
|
|
top:
|
|
(cd ..; $(MAKE) DIRS=$(DIR) all)
|
|
|
|
all: lib
|
|
|
|
lib: $(LIBOBJ) $(TESTLIBOBJ)
|
|
@if [ -n "$(SHARED_LIBS)" ]; then \
|
|
set -e; \
|
|
for l in $(LIBNAMES) $(TESTLIBNAMES); do \
|
|
$(MAKE) -f ../Makefile.shared -e \
|
|
LIBNAME=$$l LIBEXTRAS="e_$$l*.o" \
|
|
LIBDEPS='$(PLIB_LDFLAG) -L.. -lcrypto $(EX_LIBS)' \
|
|
link_dso.$(SHLIB_TARGET); \
|
|
done; \
|
|
else \
|
|
$(AR) $(LIB) $(LIBOBJ); \
|
|
$(RANLIB) $(LIB) || echo Never mind.; \
|
|
fi; \
|
|
touch lib
|
|
|
|
e_padlock-x86.s: asm/e_padlock-x86.pl
|
|
$(PERL) asm/e_padlock-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
|
|
e_padlock-x86_64.s: asm/e_padlock-x86_64.pl
|
|
$(PERL) asm/e_padlock-x86_64.pl $(PERLASM_SCHEME) > $@
|
|
|
|
files:
|
|
$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
|
|
|
|
install:
|
|
@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
|
|
@if [ -n "$(SHARED_LIBS)" ]; then \
|
|
set -e; \
|
|
$(PERL) $(TOP)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines; \
|
|
for l in $(LIBNAMES); do \
|
|
cp $${l}$(DSO_EXT) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$${l}$(DSO_EXT).new; \
|
|
chmod 555 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$${l}$(DSO_EXT).new; \
|
|
mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$${l}$(DSO_EXT).new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$${l}$(DSO_EXT); \
|
|
done; \
|
|
fi
|
|
|
|
uninstall:
|
|
@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
|
|
@if [ -n "$(SHARED_LIBS)" ]; then \
|
|
set -e; \
|
|
for l in $(LIBNAMES); do \
|
|
$(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$${l}$(DSO_EXT); \
|
|
done; \
|
|
fi
|
|
|
|
errors:
|
|
set -e; for l in $(LIBNAMES); do \
|
|
$(PERL) ../util/mkerr.pl -conf e_$$l.ec \
|
|
-nostatic -staticloader -write e_$$l.c; \
|
|
done
|
|
|
|
depend:
|
|
@[ -z "$(THIS)" ] || $(TOP)/util/domd $(CFLAG) $(INCLUDES) -- $(PROGS) $(LIBSRC) $(TESTLIBSRC)
|
|
@[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
|
|
|
|
clean:
|
|
rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
|
|
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|