Add a shared_target to the VC-common config
[openssl.git] / engines / Makefile.in
1 #
2 # OpenSSL/engines/Makefile
3 #
4
5 DIR=    engines
6 TOP=    ..
7 CC=     cc
8 INCLUDES= -I../include
9 CFLAG=-g
10 MAKEFILE=       Makefile
11 AR=             ar r
12
13 PADLOCK_ASM_OBJ=
14
15 PLIB_LDFLAG=
16 EX_LIBS=
17
18 CFLAGS= $(INCLUDES) $(CFLAG) $(SHARED_CFLAG)
19 ASFLAGS= $(INCLUDES) $(ASFLAG)
20 AFLAGS= $(ASFLAGS)
21
22 GENERAL=Makefile engines.com install.com engine_vector.mar
23
24 LIB=$(TOP)/libcrypto.a
25 LIBNAMES= padlock capi dasync
26 LIBSRC= \
27         e_padlock.c \
28         e_capi.c \
29         e_dasync.c
30 LIBOBJ= \
31         e_padlock.o \
32         e_capi.o \
33         e_dasync.o \
34         $(PADLOCK_ASM_OBJ)
35
36 TESTLIBNAMES= ossltest
37 TESTLIBSRC= e_ossltest.c
38 TESTLIBOBJ= e_ossltest.o
39
40 SRC= $(LIBSRC)
41
42 HEADER= \
43         e_capi_err.c e_capi_err.h \
44         e_ossltest_err.c e_ossltest_err.h \
45         e_dasync_err.c e_dasync_err.h
46
47 ALL=    $(GENERAL) $(SRC) $(HEADER)
48
49 top:
50         (cd ..; $(MAKE) DIRS=$(DIR) all)
51
52 all:    lib
53
54 lib:    $(LIBOBJ) $(TESTLIBOBJ)
55         @if [ "$(DYNAMIC_ENGINES)" = 1 ]; then \
56                 set -e; \
57                 for l in $(LIBNAMES) $(TESTLIBNAMES); do \
58                         $(MAKE) -f ../Makefile.shared -e \
59                                 LIBNAME=$$l LIBEXTRAS="e_$$l*.o" \
60                                 LIBDEPS='$(PLIB_LDFLAG) -L.. -lcrypto $(EX_LIBS)' \
61                                 link_dso.$(SHLIB_TARGET); \
62                 done; \
63         else \
64                 $(AR) $(LIB) $(LIBOBJ); \
65                 $(RANLIB) $(LIB) || echo Never mind.; \
66         fi; \
67         touch lib
68
69 e_padlock-x86.s:        asm/e_padlock-x86.pl
70         $(PERL) asm/e_padlock-x86.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
71 e_padlock-x86_64.s:     asm/e_padlock-x86_64.pl
72         $(PERL) asm/e_padlock-x86_64.pl $(PERLASM_SCHEME) > $@
73
74 files:
75         $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
76
77 install:
78         @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
79         @if [ -n "$(SHARED_LIBS)" ]; then \
80                 set -e; \
81                 $(PERL) $(TOP)/util/mkdir-p.pl $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines; \
82                 for l in $(LIBNAMES); do \
83                         cp $${l}$(DSO_EXT) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$${l}$(DSO_EXT).new; \
84                         chmod 555 $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$${l}$(DSO_EXT).new; \
85                         mv -f $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$${l}$(DSO_EXT).new $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$${l}$(DSO_EXT); \
86                 done; \
87         fi
88
89 uninstall:
90         @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
91         @if [ -n "$(SHARED_LIBS)" ]; then \
92                 set -e; \
93                 for l in $(LIBNAMES); do \
94                         $(RM) $(DESTDIR)$(INSTALLTOP)/$(LIBDIR)/engines/$${l}$(DSO_EXT); \
95                 done; \
96         fi
97
98 errors:
99         set -e; for l in $(LIBNAMES); do \
100                 $(PERL) ../util/mkerr.pl -conf e_$$l.ec \
101                         -nostatic -staticloader -write e_$$l.c; \
102         done
103
104 depend:
105         @[ -z "$(THIS)" ] || $(TOP)/util/domd $(CFLAG) $(INCLUDES) -- $(PROGS) $(LIBSRC) $(TESTLIBSRC)
106         @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
107
108 clean:
109         rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
110
111 # DO NOT DELETE THIS LINE -- make depend depends on it.