2016-01-12 21:25:30 +00:00
|
|
|
#
|
|
|
|
# OpenSSL/crypto/Makefile
|
|
|
|
#
|
|
|
|
|
|
|
|
DIR= crypto
|
|
|
|
TOP= ..
|
|
|
|
CC= cc
|
|
|
|
INCLUDE= -I. -I$(TOP) -I../include -Iinclude $(ZLIB_INCLUDE)
|
|
|
|
# INCLUDES targets sudbirs!
|
|
|
|
INCLUDES= -I.. -I../.. -I../modes -I../include -I../../include $(ZLIB_INCLUDE)
|
|
|
|
CFLAG= -g
|
|
|
|
MAKEFILE= Makefile
|
|
|
|
RM= rm -f
|
|
|
|
AR= ar r
|
|
|
|
|
|
|
|
RECURSIVE_MAKE= [ -n "$(SDIRS)" ] && for i in $(SDIRS) ; do \
|
|
|
|
(cd $$i && echo "making $$target in $(DIR)/$$i..." && \
|
|
|
|
$(MAKE) -e TOP=../.. DIR=$$i INCLUDES='$(INCLUDES)' $$target ) || exit 1; \
|
|
|
|
done;
|
|
|
|
|
Enhance and clear the support of linker flags
Some time ago, we had a ex_libs configuration setting that could be
divided into lflags and ex_libs. These got divided in two settings,
lflags and ex_libs, and the former was interpreted to be general
linking flags.
Unfortunately, that conclusion wasn't entirely accurate. Most of
those linking were meant to end up in a very precise position on the
linking command line, just before the spec of libraries the linking
depends on.
Back to the drawing board, we're diving things further, now having
lflags, which are linking flags that aren't depending on command line
position, plib_lflags, which are linking flags that should show up just
before the spec of libraries to depend on, and finally ex_libs, which
is the spec of extra libraries to depend on.
Also, documentation is changed in Configurations/README. This was
previously forgotten.
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-05 10:47:14 +00:00
|
|
|
PLIB_LDFLAG=
|
2016-01-12 21:25:30 +00:00
|
|
|
EX_LIBS=
|
2016-01-29 17:07:37 +00:00
|
|
|
|
2016-01-12 21:25:30 +00:00
|
|
|
CFLAGS= $(INCLUDE) $(CFLAG)
|
|
|
|
ASFLAGS= $(INCLUDE) $(ASFLAG)
|
|
|
|
AFLAGS=$(ASFLAGS)
|
|
|
|
CPUID_OBJ=mem_clr.o
|
|
|
|
|
|
|
|
LIBS=
|
|
|
|
|
|
|
|
GENERAL=Makefile README crypto-lib.com install.com
|
|
|
|
|
|
|
|
LIB= $(TOP)/libcrypto.a
|
|
|
|
SHARED_LIB= libcrypto$(SHLIB_EXT)
|
|
|
|
LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \
|
2016-01-31 18:08:23 +00:00
|
|
|
ebcdic.c uid.c o_time.c o_str.c o_dir.c thr_id.c lock.c \
|
2016-02-09 11:26:14 +00:00
|
|
|
o_init.c o_fips.c mem_sec.c init.c
|
2016-01-12 21:25:30 +00:00
|
|
|
LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o \
|
2016-01-31 18:08:23 +00:00
|
|
|
ebcdic.o uid.o o_time.o o_str.o o_dir.o thr_id.o lock.o \
|
2016-02-09 11:26:14 +00:00
|
|
|
o_init.o o_fips.o mem_sec.o init.o $(CPUID_OBJ)
|
2016-01-12 21:25:30 +00:00
|
|
|
|
|
|
|
SRC= $(LIBSRC)
|
|
|
|
|
|
|
|
HEADER= buildinf.h arm_arch.h ppc_arch.h sparc_arch.h
|
|
|
|
|
|
|
|
ALL= $(GENERAL) $(SRC) $(HEADER)
|
|
|
|
|
|
|
|
top:
|
|
|
|
@(cd ..; $(MAKE) DIRS=$(DIR) all)
|
|
|
|
|
|
|
|
all: shared
|
|
|
|
|
|
|
|
fips: cryptlib.o thr_id.o uid.o $(CPUID_OBJ)
|
|
|
|
[ -n "$(SDIRS)" ] && for i in $(SDIRS) ; do \
|
|
|
|
( obj=`$(PERL) $(TOP)/util/fipsobj.pl $$i` && \
|
|
|
|
cd $$i && echo "making fips in $(DIR)/$$i..." && \
|
|
|
|
$(MAKE) -e TOP=../.. DIR=$$i INCLUDES='$(INCLUDES)' $$obj ) || exit 1; \
|
|
|
|
done;
|
|
|
|
|
|
|
|
buildinf.h: ../Makefile
|
|
|
|
$(PERL) $(TOP)/util/mkbuildinf.pl "$(CC) $(CFLAGS)" "$(PLATFORM)" >buildinf.h
|
|
|
|
|
|
|
|
x86cpuid.s: x86cpuid.pl perlasm/x86asm.pl
|
|
|
|
$(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
|
|
|
|
|
|
|
|
applink.o: $(TOP)/ms/applink.c
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/applink.c
|
|
|
|
|
|
|
|
uplink.o: $(TOP)/ms/uplink.c applink.o
|
|
|
|
$(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c
|
|
|
|
|
|
|
|
uplink-x86.s: $(TOP)/ms/uplink-x86.pl
|
|
|
|
$(PERL) $(TOP)/ms/uplink-x86.pl $(PERLASM_SCHEME) > $@
|
|
|
|
|
|
|
|
x86_64cpuid.s: x86_64cpuid.pl; $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
|
|
|
|
ia64cpuid.s: ia64cpuid.S; $(CC) $(CFLAGS) -E ia64cpuid.S > $@
|
|
|
|
ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
|
|
|
|
pariscid.s: pariscid.pl; $(PERL) pariscid.pl $(PERLASM_SCHEME) $@
|
|
|
|
alphacpuid.s: alphacpuid.pl
|
|
|
|
(preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
|
|
|
|
$(PERL) alphacpuid.pl > $$preproc && \
|
|
|
|
$(CC) -E -P $$preproc > $@ && rm $$preproc)
|
|
|
|
arm64cpuid.S: arm64cpuid.pl; $(PERL) arm64cpuid.pl $(PERLASM_SCHEME) > $@
|
|
|
|
armv4cpuid.S: armv4cpuid.pl; $(PERL) armv4cpuid.pl $(PERLASM_SCHEME) > $@
|
|
|
|
|
|
|
|
subdirs:
|
|
|
|
@target=all; $(RECURSIVE_MAKE)
|
|
|
|
|
|
|
|
files:
|
|
|
|
$(PERL) $(TOP)/util/files.pl "CPUID_OBJ=$(CPUID_OBJ)" Makefile >> $(TOP)/MINFO
|
|
|
|
@target=files; $(RECURSIVE_MAKE)
|
|
|
|
|
|
|
|
# lib: $(LIB): are splitted to avoid end-less loop
|
|
|
|
lib: $(LIB)
|
|
|
|
@touch lib
|
|
|
|
$(LIB): $(LIBOBJ)
|
|
|
|
$(AR) $(LIB) $(LIBOBJ)
|
|
|
|
$(RANLIB) $(LIB) || echo Never mind.
|
|
|
|
|
|
|
|
shared: buildinf.h lib subdirs
|
|
|
|
if [ -n "$(SHARED_LIBS)" ]; then \
|
|
|
|
(cd ..; $(MAKE) $(SHARED_LIB)); \
|
|
|
|
fi
|
|
|
|
|
|
|
|
libs:
|
|
|
|
@target=lib; $(RECURSIVE_MAKE)
|
|
|
|
|
2016-01-18 16:50:36 +00:00
|
|
|
depend:
|
2016-01-12 21:25:30 +00:00
|
|
|
@[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
|
2016-01-29 18:29:45 +00:00
|
|
|
@[ -z "$(THIS)" ] || $(TOP)/util/domd $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
|
2016-01-12 21:25:30 +00:00
|
|
|
@[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
|
2016-01-18 16:50:36 +00:00
|
|
|
@[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
|
|
|
|
@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
|
2016-01-12 21:25:30 +00:00
|
|
|
clean:
|
|
|
|
rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
|
|
|
|
@target=clean; $(RECURSIVE_MAKE)
|
|
|
|
|
|
|
|
# DO NOT DELETE THIS LINE -- make depend depends on it.
|