Engage AES x86 assembler module for COFF and a.out targets.
[openssl.git] / crypto / aes / Makefile.ssl
index 364d05bbfe012a9d60644c03ca371807660a1c0f..2bf743ec30daa3ebe6065dea6aaa03223c628ad0 100644 (file)
@@ -17,8 +17,10 @@ MAKEDEPEND=  $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
 MAKEFILE=      Makefile.ssl
 AR=            ar r
 
-# CFLAGS= -mpentiumpro $(INCLUDES) $(CFLAG) -O3 -fexpensive-optimizations -funroll-loops -fforce-addr
+AES_ASM_OBJ=
+
 CFLAGS= $(INCLUDES) $(CFLAG)
+ASFLAGS= $(INCLUDES) $(ASFLAG)
 
 GENERAL=Makefile
 #TEST=aestest.c
@@ -27,7 +29,7 @@ APPS=
 
 LIB=$(TOP)/libcrypto.a
 LIBSRC=aes_core.c aes_misc.c aes_ecb.c aes_cbc.c aes_cfb.c aes_ofb.c aes_ctr.c
-LIBOBJ=aes_core.o aes_misc.o aes_ecb.o aes_cbc.o aes_cfb.o aes_ofb.o aes_ctr.o
+LIBOBJ=aes_core.o aes_misc.o aes_ecb.o aes_cbc.o aes_cfb.o aes_ofb.o aes_ctr.o $(AES_ASM_OBJ)
 
 SRC= $(LIBSRC)
 
@@ -48,11 +50,21 @@ lib:        $(LIBOBJ)
 
 $(LIBOBJ): $(LIBSRC)
 
+asm/aes-ia64.s: asm/aes-ia64.S
+       $(CC) $(CFLAGS) -E asm/aes-ia64.S > $@
+
+asm/ax86-elf.s: asm/aes-586.pl ../perlasm/x86asm.pl
+       (cd asm; $(PERL) aes-586.pl elf $(CFLAGS) $(PROCESSOR) > ../$@)
+asm/ax86-cof.s: asm/aes-586.pl ../perlasm/x86asm.pl
+       (cd asm; $(PERL) aes-586.pl coff $(CFLAGS) $(PROCESSOR) > ../$@)
+ax86-out.s: asm/aes-586.pl ../perlasm/x86asm.pl
+       (cd asm; $(PERL) aes-586.pl a.out $(CFLAGS) $(PROCESSOR) > ../$@)
+
 files:
        $(PERL) $(TOP)/util/files.pl Makefile.ssl >> $(TOP)/MINFO
 
 links:
-       @$(TOP)/util/point.sh Makefile.ssl Makefile
+       @sh $(TOP)/util/point.sh Makefile.ssl Makefile
        @$(PERL) $(TOP)/util/mklink.pl ../../include/openssl $(EXHEADER)
        @$(PERL) $(TOP)/util/mklink.pl ../../test $(TEST)
        @$(PERL) $(TOP)/util/mklink.pl ../../apps $(APPS)
@@ -60,7 +72,7 @@ links:
 install: installs
 
 installs:
-       @for i in $(EXHEADER) ; \
+       @headerlist="$(EXHEADER)"; for i in $$headerlist ; \
        do  \
        (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
        chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
@@ -82,14 +94,15 @@ dclean:
        mv -f Makefile.new $(MAKEFILE)
 
 clean:
-       rm -f *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+       rm -f asm/*.[so] *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
 aes_cbc.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
 aes_cbc.o: ../../include/openssl/opensslconf.h aes_cbc.c aes_locl.h
-aes_cfb.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
-aes_cfb.o: ../../include/openssl/opensslconf.h aes_cfb.c aes_locl.h
+aes_cfb.o: ../../e_os.h ../../include/openssl/aes.h
+aes_cfb.o: ../../include/openssl/e_os2.h ../../include/openssl/opensslconf.h
+aes_cfb.o: aes_cfb.c aes_locl.h
 aes_core.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h
 aes_core.o: ../../include/openssl/opensslconf.h aes_core.c aes_locl.h
 aes_ctr.o: ../../include/openssl/aes.h ../../include/openssl/e_os2.h