Makefile 6.3 KB
Newer Older
1
#
2
# OpenSSL/crypto/sha/Makefile
3 4
#

5 6 7
DIR=    sha
TOP=    ../..
CC=     cc
8
CPP=    $(CC) -E
9 10
INCLUDES=
CFLAG=-g
B
Ben Laurie 已提交
11
MAKEFILE=       Makefile
12 13 14
AR=             ar r

SHA1_ASM_OBJ=
15 16

CFLAGS= $(INCLUDES) $(CFLAG)
17
ASFLAGS= $(INCLUDES) $(ASFLAG)
18
AFLAGS= $(ASFLAGS)
19 20

GENERAL=Makefile
21
TEST=shatest.c sha1test.c sha256t.c sha512t.c
22 23 24
APPS=

LIB=$(TOP)/libcrypto.a
25 26
LIBSRC=sha_dgst.c sha1dgst.c sha_one.c sha1_one.c sha256.c sha512.c
LIBOBJ=sha_dgst.o sha1dgst.o sha_one.o sha1_one.o sha256.o sha512.o $(SHA1_ASM_OBJ)
27 28 29 30

SRC= $(LIBSRC)

EXHEADER= sha.h
31
HEADER= sha_locl.h $(EXHEADER)
32 33 34 35 36 37

ALL=    $(GENERAL) $(SRC) $(HEADER)

top:
	(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)

38
all:    lib
39

40
lib:    $(LIBOBJ)
41
	$(AR) $(LIB) $(LIBOBJ)
42
	$(RANLIB) $(LIB) || echo Never mind.
43 44
	@touch lib

45
# ELF
46
sx86-elf.s: asm/sha1-586.pl ../perlasm/x86asm.pl
47
	(cd asm; $(PERL) sha1-586.pl elf $(CFLAGS) $(PROCESSOR) > ../$@)
48 49 50 51
sha256x86-elf.s:	asm/sha256-586.pl ../perlasm/x86asm.pl
	(cd asm; $(PERL) sha256-586.pl elf $(CFLAGS) $(PROCESSOR) > ../$@)
sha512x86-elf.s:	asm/sha512-586.pl ../perlasm/x86asm.pl
	(cd asm; $(PERL) sha512-586.pl elf $(CFLAGS) $(PROCESSOR) > ../$@)
52
# COFF
53
sx86-cof.s: asm/sha1-586.pl ../perlasm/x86asm.pl
54
	(cd asm; $(PERL) sha1-586.pl coff $(CFLAGS) $(PROCESSOR) > ../$@)
55 56 57 58
sha256x86-cof.s:	asm/sha256-586.pl ../perlasm/x86asm.pl
	(cd asm; $(PERL) sha256-586.pl coff $(CFLAGS) $(PROCESSOR) > ../$@)
sha512x86-cof.s:	asm/sha512-586.pl ../perlasm/x86asm.pl
	(cd asm; $(PERL) sha512-586.pl coff $(CFLAGS) $(PROCESSOR) > ../$@)
59
# a.out
60 61
sx86-out.s: asm/sha1-586.pl ../perlasm/x86asm.pl
	(cd asm; $(PERL) sha1-586.pl a.out $(CFLAGS) $(PROCESSOR) > ../$@)
62 63 64 65
sha256x86-out.s:	asm/sha256-586.pl ../perlasm/x86asm.pl
	(cd asm; $(PERL) sha256-586.pl a.out $(CFLAGS) $(PROCESSOR) > ../$@)
sha512x86-out.s:	asm/sha512-586.pl ../perlasm/x86asm.pl
	(cd asm; $(PERL) sha512-586.pl a.out $(CFLAGS) $(PROCESSOR) > ../$@)
66

67
sha1-ia64.s:   asm/sha1-ia64.pl
68
	(cd asm; $(PERL) sha1-ia64.pl $(CFLAGS) ) > $@
69
sha256-ia64.s: asm/sha512-ia64.pl
A
Andy Polyakov 已提交
70
	(cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS))
71
sha512-ia64.s: asm/sha512-ia64.pl
A
Andy Polyakov 已提交
72
	(cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS))
73

A
Andy Polyakov 已提交
74 75 76
sha256-armv4.s: asm/sha256-armv4.pl
	$(PERL) $< $@

A
Andy Polyakov 已提交
77 78 79 80
# Solaris make has to be explicitly told
sha1-x86_64.s:	asm/sha1-x86_64.pl;	$(PERL) asm/sha1-x86_64.pl $@
sha256-x86_64.s:asm/sha512-x86_64.pl;	$(PERL) asm/sha512-x86_64.pl $@
sha512-x86_64.s:asm/sha512-x86_64.pl;	$(PERL) asm/sha512-x86_64.pl $@
A
Andy Polyakov 已提交
81 82 83
sha1-sparcv9.s:	asm/sha1-sparcv9.pl;	$(PERL) asm/sha1-sparcv9.pl $@ $(CFLAGS)
sha256-sparcv9.s:asm/sha512-sparcv9.pl;	$(PERL) asm/sha512-sparcv9.pl $@ $(CFLAGS)
sha512-sparcv9.s:asm/sha512-sparcv9.pl;	$(PERL) asm/sha512-sparcv9.pl $@ $(CFLAGS)
A
Andy Polyakov 已提交
84 85

# AIX make has to be explicitly told
A
Andy Polyakov 已提交
86 87
sha1-ppc_aix32.s: asm/sha1-ppc.pl;	$(PERL) asm/sha1-ppc.pl $@
sha1-ppc_aix64.s: asm/sha1-ppc.pl;	$(PERL) asm/sha1-ppc.pl $@
A
Andy Polyakov 已提交
88 89 90 91
sha256-ppc_aix32.s: asm/sha512-ppc.pl;	$(PERL) asm/sha512-ppc.pl $@
sha256-ppc_aix64.s: asm/sha512-ppc.pl;	$(PERL) asm/sha512-ppc.pl $@
sha512-ppc_aix32.s: asm/sha512-ppc.pl;	$(PERL) asm/sha512-ppc.pl $@
sha512-ppc_aix64.s: asm/sha512-ppc.pl;	$(PERL) asm/sha512-ppc.pl $@
A
Andy Polyakov 已提交
92 93

# non-AIX ppc targets are believed to be armed with GNU make
A
Andy Polyakov 已提交
94 95 96
sha1-ppc_%.s:	asm/sha1-ppc.pl;	$(PERL) $< $@
sha256-ppc_%.s:	asm/sha512-ppc.pl;	$(PERL) $< $@
sha512-ppc_%.s:	asm/sha512-ppc.pl;	$(PERL) $< $@
A
Andy Polyakov 已提交
97 98 99 100
# GNU make "catch all"
sha1-%.s:	asm/sha1-%.pl;		$(PERL) $< $@
sha256-%.s:	asm/sha512-%.pl;	$(PERL) $< $@
sha512-%.s:	asm/sha512-%.pl;	$(PERL) $< $@
A
Andy Polyakov 已提交
101

102
files:
B
Ben Laurie 已提交
103
	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
104 105

links:
106 107 108
	@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
	@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
109 110

install:
A
Andy Polyakov 已提交
111
	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
112
	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
113
	do  \
114 115
	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
	chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
116 117 118 119 120 121 122 123 124 125 126
	done;

tags:
	ctags $(SRC)

tests:

lint:
	lint -DLINT $(INCLUDES) $(SRC)>fluff

depend:
127
	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
128
	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
129 130

dclean:
131
	$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
132 133 134
	mv -f Makefile.new $(MAKEFILE)

clean:
135
	rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
136 137

# DO NOT DELETE THIS LINE -- make depend depends on it.
B
Ben Laurie 已提交
138

139 140 141 142 143
sha1_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
sha1_one.o: ../../include/openssl/opensslconf.h
sha1_one.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
sha1_one.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
sha1_one.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
144
sha1_one.o: sha1_one.c
145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168
sha1dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
sha1dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h
sha1dgst.o: ../md32_common.h sha1dgst.c sha_locl.h
sha256.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
sha256.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
sha256.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
sha256.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
sha256.o: ../../include/openssl/symhacks.h ../md32_common.h sha256.c
sha512.o: ../../e_os.h ../../include/openssl/bio.h
sha512.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
sha512.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
sha512.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
sha512.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
sha512.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
sha512.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
sha512.o: ../cryptlib.h sha512.c
sha_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
sha_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h
sha_dgst.o: ../md32_common.h sha_dgst.c sha_locl.h
sha_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
sha_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
sha_one.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
sha_one.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
sha_one.o: ../../include/openssl/symhacks.h sha_one.c