Implement new multi-threading API
[openssl.git] / crypto / Makefile.in
1 #
2 # OpenSSL/crypto/Makefile
3 #
4
5 DIR=            crypto
6 TOP=            ..
7 CC=             cc
8 INCLUDE=        -I. -I$(TOP) -I../include -Iinclude $(ZLIB_INCLUDE)
9 # INCLUDES targets sudbirs!
10 INCLUDES=       -I.. -I../.. -I../modes -I../include -I../../include $(ZLIB_INCLUDE)
11 CFLAG=          -g
12 MAKEFILE=       Makefile
13 RM=             rm -f
14 AR=             ar r
15
16 RECURSIVE_MAKE= [ -n "$(SDIRS)" ] && for i in $(SDIRS) ; do \
17                     (cd $$i && echo "making $$target in $(DIR)/$$i..." && \
18                     $(MAKE) -e TOP=../.. DIR=$$i INCLUDES='$(INCLUDES)' $$target ) || exit 1; \
19                 done;
20
21 PLIB_LDFLAG=
22 EX_LIBS=
23
24 CFLAGS= $(INCLUDE) $(CFLAG) $(SHARED_CFLAG)
25 ASFLAGS= $(INCLUDE) $(ASFLAG)
26 AFLAGS=$(ASFLAGS)
27 CPUID_OBJ=mem_clr.o
28
29 LIBS=
30
31 GENERAL=Makefile README crypto-lib.com install.com
32
33 LIB= $(TOP)/libcrypto.a
34 SHARED_LIB= libcrypto$(SHLIB_EXT)
35 LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \
36         ebcdic.c uid.c o_time.c o_str.c o_dir.c thr_id.c lock.c \
37         threads_pthread.c threads_win.c threads_none.c \
38         o_init.c o_fips.c mem_sec.c init.c
39 LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o \
40         ebcdic.o uid.o o_time.o o_str.o o_dir.o thr_id.o lock.o \
41         threads_pthread.o threads_win.o threads_none.o \
42         o_init.o o_fips.o mem_sec.o init.o $(CPUID_OBJ)
43
44 SRC= $(LIBSRC)
45
46 HEADER= buildinf.h arm_arch.h ppc_arch.h sparc_arch.h
47
48 ALL=    $(GENERAL) $(SRC) $(HEADER)
49
50 top:
51         @(cd ..; $(MAKE) DIRS=$(DIR) all)
52
53 all: shared
54
55 fips: cryptlib.o thr_id.o uid.o $(CPUID_OBJ)
56         [ -n "$(SDIRS)" ] && for i in $(SDIRS) ; do \
57                     ( obj=`$(PERL) $(TOP)/util/fipsobj.pl $$i` && \
58                         cd $$i && echo "making fips in $(DIR)/$$i..." && \
59                     $(MAKE) -e TOP=../.. DIR=$$i INCLUDES='$(INCLUDES)' $$obj ) || exit 1; \
60                 done;
61
62 buildinf.h: ../Makefile
63         $(PERL) $(TOP)/util/mkbuildinf.pl "$(CC) $(CFLAGS_Q)" "$(PLATFORM)" >buildinf.h
64
65 x86cpuid.s:     x86cpuid.pl perlasm/x86asm.pl
66         $(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
67
68 applink.o:      $(TOP)/ms/applink.c
69         $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/applink.c
70
71 uplink.o:       $(TOP)/ms/uplink.c applink.o
72         $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c
73
74 uplink-x86.s:   $(TOP)/ms/uplink-x86.pl
75         $(PERL) $(TOP)/ms/uplink-x86.pl $(PERLASM_SCHEME) > $@
76
77 x86_64cpuid.s:  x86_64cpuid.pl; $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
78 ia64cpuid.s:    ia64cpuid.S;    $(CC) $(CFLAGS) -E ia64cpuid.S > $@
79 ppccpuid.s:     ppccpuid.pl;    $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
80 pariscid.s:     pariscid.pl;    $(PERL) pariscid.pl $(PERLASM_SCHEME) $@
81 alphacpuid.s:   alphacpuid.pl
82         (preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
83         $(PERL) alphacpuid.pl > $$preproc && \
84         $(CC) -E -P $$preproc > $@ && rm $$preproc)
85 arm64cpuid.S:   arm64cpuid.pl;  $(PERL) arm64cpuid.pl $(PERLASM_SCHEME) > $@
86 armv4cpuid.S:   armv4cpuid.pl;  $(PERL) armv4cpuid.pl $(PERLASM_SCHEME) > $@
87
88 subdirs:
89         @target=all; $(RECURSIVE_MAKE)
90
91 files:
92         $(PERL) $(TOP)/util/files.pl "CPUID_OBJ=$(CPUID_OBJ)" Makefile >> $(TOP)/MINFO
93         @target=files; $(RECURSIVE_MAKE)
94
95 # lib: $(LIB): are splitted to avoid end-less loop
96 lib:    $(LIB)
97         @touch lib
98 $(LIB): $(LIBOBJ)
99         $(AR) $(LIB) $(LIBOBJ)
100         $(RANLIB) $(LIB) || echo Never mind.
101
102 shared: buildinf.h lib subdirs
103         if [ -n "$(SHARED_LIBS)" ]; then \
104                 (cd ..; $(MAKE) $(SHARED_LIB)); \
105         fi
106
107 libs:
108         @target=lib; $(RECURSIVE_MAKE)
109
110 depend:
111         @[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
112         @[ -z "$(THIS)" ] || $(TOP)/util/domd $(CFLAG) $(INCLUDE) -- $(PROGS) $(LIBSRC)
113         @[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
114         @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
115         @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
116 clean:
117         rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
118         @target=clean; $(RECURSIVE_MAKE)
119
120 # DO NOT DELETE THIS LINE -- make depend depends on it.