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