1#
2# OpenSSL/fips/sha/Makefile
3#
4
5DIR=	sha
6TOP=	../..
7CC=	cc
8INCLUDES=
9CFLAG=-g
10INSTALL_PREFIX=
11OPENSSLDIR=     /usr/local/ssl
12INSTALLTOP=/usr/local/ssl
13MAKEDEPPROG=	makedepend
14MAKEDEPEND=	$(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
15MAKEFILE=	Makefile
16AR=		ar r
17EXE_EXT=
18
19ASFLAGS= $(INCLUDES) $(ASFLAG)
20AFLAGS= $(ASFLAGS)
21
22CFLAGS= $(INCLUDES) $(CFLAG)
23
24GENERAL=Makefile
25TEST= fips_shatest.c
26APPS=
27EXE= fips_standalone_sha1$(EXE_EXT)
28
29LIB=$(TOP)/libcrypto.a
30LIBSRC=fips_sha1_selftest.c
31LIBOBJ=fips_sha1_selftest.o
32
33SRC= $(LIBSRC) fips_standalone_sha1.c
34
35EXHEADER=
36HEADER=	
37
38ALL=    $(GENERAL) $(SRC) $(HEADER)
39
40top:
41	(cd $(TOP); $(MAKE) DIRS=fips SDIRS=$(DIR) sub_all)
42
43all:	../fips_standalone_sha1$(EXE_EXT) lib
44
45lib:	$(LIBOBJ)
46	@echo $(LIBOBJ) > lib
47
48../fips_standalone_sha1$(EXE_EXT): fips_standalone_sha1.o
49	if [ -z "$(HOSTCC)" ] ; then \
50	FIPS_SHA_ASM=""; for i in $(SHA1_ASM_OBJ) sha1dgst.o ; do FIPS_SHA_ASM="$$FIPS_SHA_ASM ../../crypto/sha/$$i" ; done; \
51	$(CC) -o $@ $(CFLAGS) fips_standalone_sha1.o $$FIPS_SHA_ASM ; \
52	else \
53		$(HOSTCC) $(HOSTCFLAGS) -o $ $@ -I../../include -I../../crypto fips_standalone_sha1.c ../../crypto/sha/sha1dgst.c ; \
54	fi
55
56files:
57	$(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
58
59links:
60	@$(PERL) $(TOP)/util/mklink.pl $(TOP)/include/openssl $(EXHEADER)
61	@$(PERL) $(TOP)/util/mklink.pl $(TOP)/test $(TEST)
62	@$(PERL) $(TOP)/util/mklink.pl $(TOP)/apps $(APPS)
63
64install:
65	@headerlist="$(EXHEADER)"; for i in $$headerlist; \
66	do  \
67	  (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
68	  chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
69	done
70
71tags:
72	ctags $(SRC)
73
74tests:
75
76Q=../testvectors/sha/req
77A=../testvectors/sha/rsp
78
79VECTORS = SHA1LongMsg \
80	SHA1Monte \
81	SHA1ShortMsg \
82	SHA224LongMsg \
83	SHA224Monte \
84	SHA224ShortMsg \
85	SHA256LongMsg \
86	SHA256Monte \
87	SHA256ShortMsg \
88	SHA384LongMsg \
89	SHA384Monte \
90	SHA384ShortMsg \
91	SHA512LongMsg \
92	SHA512Monte \
93	SHA512ShortMsg
94
95fips_test:
96	-rm -rf $(A)
97	mkdir $(A)
98	for file in $(VECTORS); do \
99	    if [ -f $(Q)/$$file.req ]; then \
100		$(TOP)/util/shlib_wrap.sh $(TOP)/test/fips_shatest $(Q)/$$file.req $(A)/$$file.rsp; \
101	    fi; \
102	done
103
104lint:
105	lint -DLINT $(INCLUDES) $(SRC)>fluff
106
107depend:
108	$(MAKEDEPEND) -- $(CFLAG) $(INCLUDES) $(DEPFLAG) -- $(SRC) $(TEST)
109
110dclean:
111	$(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
112	mv -f Makefile.new $(MAKEFILE)
113
114clean:
115	rm -f *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff $(EXE)
116
117# DO NOT DELETE THIS LINE -- make depend depends on it.
118
119fips_sha1_selftest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
120fips_sha1_selftest.o: ../../include/openssl/crypto.h
121fips_sha1_selftest.o: ../../include/openssl/e_os2.h ../../include/openssl/err.h
122fips_sha1_selftest.o: ../../include/openssl/evp.h ../../include/openssl/fips.h
123fips_sha1_selftest.o: ../../include/openssl/lhash.h
124fips_sha1_selftest.o: ../../include/openssl/obj_mac.h
125fips_sha1_selftest.o: ../../include/openssl/objects.h
126fips_sha1_selftest.o: ../../include/openssl/opensslconf.h
127fips_sha1_selftest.o: ../../include/openssl/opensslv.h
128fips_sha1_selftest.o: ../../include/openssl/ossl_typ.h
129fips_sha1_selftest.o: ../../include/openssl/safestack.h
130fips_sha1_selftest.o: ../../include/openssl/sha.h ../../include/openssl/stack.h
131fips_sha1_selftest.o: ../../include/openssl/symhacks.h fips_sha1_selftest.c
132fips_shatest.o: ../../include/openssl/asn1.h ../../include/openssl/bio.h
133fips_shatest.o: ../../include/openssl/bn.h ../../include/openssl/buffer.h
134fips_shatest.o: ../../include/openssl/conf.h ../../include/openssl/crypto.h
135fips_shatest.o: ../../include/openssl/e_os2.h ../../include/openssl/ec.h
136fips_shatest.o: ../../include/openssl/ecdh.h ../../include/openssl/ecdsa.h
137fips_shatest.o: ../../include/openssl/err.h ../../include/openssl/evp.h
138fips_shatest.o: ../../include/openssl/fips.h ../../include/openssl/lhash.h
139fips_shatest.o: ../../include/openssl/obj_mac.h ../../include/openssl/objects.h
140fips_shatest.o: ../../include/openssl/opensslconf.h
141fips_shatest.o: ../../include/openssl/opensslv.h
142fips_shatest.o: ../../include/openssl/ossl_typ.h ../../include/openssl/pkcs7.h
143fips_shatest.o: ../../include/openssl/safestack.h ../../include/openssl/sha.h
144fips_shatest.o: ../../include/openssl/stack.h ../../include/openssl/symhacks.h
145fips_shatest.o: ../../include/openssl/x509.h ../../include/openssl/x509_vfy.h
146fips_shatest.o: ../../include/openssl/x509v3.h ../fips_utl.h fips_shatest.c
147fips_standalone_sha1.o: ../../include/openssl/asn1.h
148fips_standalone_sha1.o: ../../include/openssl/bio.h
149fips_standalone_sha1.o: ../../include/openssl/crypto.h
150fips_standalone_sha1.o: ../../include/openssl/e_os2.h
151fips_standalone_sha1.o: ../../include/openssl/evp.h
152fips_standalone_sha1.o: ../../include/openssl/fips.h
153fips_standalone_sha1.o: ../../include/openssl/hmac.h
154fips_standalone_sha1.o: ../../include/openssl/obj_mac.h
155fips_standalone_sha1.o: ../../include/openssl/objects.h
156fips_standalone_sha1.o: ../../include/openssl/opensslconf.h
157fips_standalone_sha1.o: ../../include/openssl/opensslv.h
158fips_standalone_sha1.o: ../../include/openssl/ossl_typ.h
159fips_standalone_sha1.o: ../../include/openssl/safestack.h
160fips_standalone_sha1.o: ../../include/openssl/sha.h
161fips_standalone_sha1.o: ../../include/openssl/stack.h
162fips_standalone_sha1.o: ../../include/openssl/symhacks.h fips_standalone_sha1.c
163