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