1#
2# OpenSSL/crypto/sha/Makefile
3#
4
5DIR=    sha
6TOP=    ../..
7CC=     cc
8CPP=    $(CC) -E
9INCLUDES=
10CFLAG=-g
11MAKEFILE=       Makefile
12AR=             ar r
13
14SHA1_ASM_OBJ=
15
16CFLAGS= $(INCLUDES) $(CFLAG)
17ASFLAGS= $(INCLUDES) $(ASFLAG)
18AFLAGS= $(ASFLAGS)
19
20GENERAL=Makefile
21TEST=shatest.c sha1test.c sha256t.c sha512t.c
22APPS=
23
24LIB=$(TOP)/libcrypto-1.0.0q.a
25LIBSRC=sha_dgst.c sha1dgst.c sha_one.c sha1_one.c sha256.c sha512.c
26LIBOBJ=sha_dgst.o sha1dgst.o sha_one.o sha1_one.o sha256.o sha512.o $(SHA1_ASM_OBJ)
27
28SRC= $(LIBSRC)
29
30EXHEADER= sha.h
31HEADER= sha_locl.h $(EXHEADER)
32
33ALL=    $(GENERAL) $(SRC) $(HEADER)
34
35top:
36	(cd ../..; $(MAKE) DIRS=crypto SDIRS=$(DIR) sub_all)
37
38all:    lib
39
40lib:    $(LIBOBJ)
41	$(AR) $(LIB) $(LIBOBJ)
42	$(RANLIB) $(LIB) || echo Never mind.
43	@touch lib
44
45sha1-586.s:	asm/sha1-586.pl ../perlasm/x86asm.pl
46	$(PERL) asm/sha1-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
47sha256-586.s:	asm/sha256-586.pl ../perlasm/x86asm.pl
48	$(PERL) asm/sha256-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
49sha512-586.s:	asm/sha512-586.pl ../perlasm/x86asm.pl
50	$(PERL) asm/sha512-586.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
51
52sha1-ia64.s:   asm/sha1-ia64.pl
53	(cd asm; $(PERL) sha1-ia64.pl ../$@ $(CFLAGS))
54sha256-ia64.s: asm/sha512-ia64.pl
55	(cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS))
56sha512-ia64.s: asm/sha512-ia64.pl
57	(cd asm; $(PERL) sha512-ia64.pl ../$@ $(CFLAGS))
58
59sha256-armv4.s: asm/sha256-armv4.pl
60	$(PERL) $< $@
61
62# Solaris make has to be explicitly told
63sha1-x86_64.s:	asm/sha1-x86_64.pl;	$(PERL) asm/sha1-x86_64.pl $(PERLASM_SCHEME) > $@
64sha256-x86_64.s:asm/sha512-x86_64.pl;	$(PERL) asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
65sha512-x86_64.s:asm/sha512-x86_64.pl;	$(PERL) asm/sha512-x86_64.pl $(PERLASM_SCHEME) $@
66sha1-sparcv9.s:	asm/sha1-sparcv9.pl;	$(PERL) asm/sha1-sparcv9.pl $@ $(CFLAGS)
67sha256-sparcv9.s:asm/sha512-sparcv9.pl;	$(PERL) asm/sha512-sparcv9.pl $@ $(CFLAGS)
68sha512-sparcv9.s:asm/sha512-sparcv9.pl;	$(PERL) asm/sha512-sparcv9.pl $@ $(CFLAGS)
69
70sha1-ppc.s:	asm/sha1-ppc.pl;	$(PERL) asm/sha1-ppc.pl $(PERLASM_SCHEME) $@
71sha256-ppc.s:	asm/sha512-ppc.pl;	$(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@
72sha512-ppc.s:	asm/sha512-ppc.pl;	$(PERL) asm/sha512-ppc.pl $(PERLASM_SCHEME) $@
73
74# GNU make "catch all"
75sha1-%.s:	asm/sha1-%.pl;		$(PERL) $< $@
76sha256-%.s:	asm/sha512-%.pl;	$(PERL) $< $@
77sha512-%.s:	asm/sha512-%.pl;	$(PERL) $< $@
78
79files:
80	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
81
82links:
83	@$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
84	@$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
85	@$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
86
87install:
88	@[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
89	@headerlist="$(EXHEADER)"; for i in $$headerlist ; \
90	do  \
91	(cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
92	chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
93	done;
94
95tags:
96	ctags $(SRC)
97
98tests:
99
100lint:
101	lint -DLINT $(INCLUDES) $(SRC)>fluff
102
103depend:
104	@[ -n "$(MAKEDEPEND)" ] # should be set by upper Makefile...
105	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
106
107dclean:
108	$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
109	mv -f Makefile.new $(MAKEFILE)
110
111clean:
112	rm -f *.s *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
113
114# DO NOT DELETE THIS LINE -- make depend depends on it.
115
116sha1_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
117sha1_one.o: ../../include/openssl/opensslconf.h
118sha1_one.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
119sha1_one.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
120sha1_one.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
121sha1_one.o: sha1_one.c
122sha1dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
123sha1dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h
124sha1dgst.o: ../md32_common.h sha1dgst.c sha_locl.h
125sha256.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
126sha256.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
127sha256.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
128sha256.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
129sha256.o: ../../include/openssl/symhacks.h ../md32_common.h sha256.c
130sha512.o: ../../e_os.h ../../include/openssl/bio.h
131sha512.o: ../../include/openssl/buffer.h ../../include/openssl/crypto.h
132sha512.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
133sha512.o: ../../include/openssl/lhash.h ../../include/openssl/opensslconf.h
134sha512.o: ../../include/openssl/opensslv.h ../../include/openssl/ossl_typ.h
135sha512.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
136sha512.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
137sha512.o: ../cryptlib.h sha512.c
138sha_dgst.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
139sha_dgst.o: ../../include/openssl/opensslv.h ../../include/openssl/sha.h
140sha_dgst.o: ../md32_common.h sha_dgst.c sha_locl.h
141sha_one.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h
142sha_one.o: ../../include/openssl/opensslconf.h ../../include/openssl/opensslv.h
143sha_one.o: ../../include/openssl/ossl_typ.h ../../include/openssl/safestack.h
144sha_one.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
145sha_one.o: ../../include/openssl/symhacks.h sha_one.c
146