summaryrefslogtreecommitdiffstats
path: root/engines/Makefile.in
blob: e37c4e2be98b3ebf551e892a92ca0b49514c6b32 (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
119
#
# OpenSSL/engines/Makefile
#

DIR=	engines
TOP=	..
CC=	cc
INCLUDES= -I../include
CFLAG=-g
MAKEFILE=	Makefile
AR=		ar r

RECURSIVE_MAKE= for i in $${ENGDIRS:-$(ENGDIRS)} ; do \
		    (cd $$i && echo "making $$target in $(DIR)/$$i..." && \
		    $(MAKE) -e TOP=../.. DIR=$$i $$target ) || exit 1; \
		done;

PADLOCK_ASM_OBJ=

PLIB_LDFLAG=
EX_LIBS=

CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
ASFLAGS= $(INCLUDES) $(ASFLAG) $(SHARED_CFLAG)
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_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 subdirs

lib:	$(LIBOBJ) $(TESTLIBOBJ)
	@if [ "$(DYNAMIC_ENGINES)" = 1 ]; 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) $@

subdirs:
	@target=all; $(RECURSIVE_MAKE)

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
	@target=install; $(RECURSIVE_MAKE)

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
	@target=install; $(RECURSIVE_MAKE)

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
	@target=clean; $(RECURSIVE_MAKE)

# DO NOT DELETE THIS LINE -- make depend depends on it.