summaryrefslogtreecommitdiffstats
path: root/crypto/Makefile.in
blob: c8184e5a5c07d907d9c9af247fb64fdbfeb05e51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#
# 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;

PLIB_LDFLAG=
EX_LIBS=

CFLAGS= $(INCLUDE) $(CFLAG) $(SHARED_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 \
	ebcdic.c uid.c o_time.c o_str.c o_dir.c thr_id.c lock.c \
	o_init.c o_fips.c mem_sec.c init.c
LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o \
	ebcdic.o uid.o o_time.o o_str.o o_dir.o thr_id.o lock.o \
	o_init.o o_fips.o mem_sec.o init.o $(CPUID_OBJ)

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_Q)" "$(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)

depend:
	@[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
	@[ -z "$(THIS)" ] || $(TOP)/util/domd $(CFLAG) $(INCLUDE) -- $(PROGS) $(LIBSRC)
	@[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
	@[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
	@if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
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.