Unified targets for ELF assembler modules. Tested on Linux, Solaris and
authorAndy Polyakov <appro@openssl.org>
Fri, 3 Jan 2003 17:37:53 +0000 (17:37 +0000)
committerAndy Polyakov <appro@openssl.org>
Fri, 3 Jan 2003 17:37:53 +0000 (17:37 +0000)
FreeBSD. Goal is to extend support even to SCO5, UnixWare/OpenUnix...

15 files changed:
Configure
Makefile.org
crypto/bf/Makefile.ssl
crypto/bn/Makefile.ssl
crypto/cast/Makefile.ssl
crypto/des/Makefile.ssl
crypto/des/asm/crypt586.pl
crypto/des/asm/des-586.pl
crypto/md5/Makefile.ssl
crypto/perlasm/x86asm.pl
crypto/perlasm/x86unix.pl
crypto/rc4/Makefile.ssl
crypto/rc5/Makefile.ssl
crypto/ripemd/Makefile.ssl
crypto/sha/Makefile.ssl

index 27ca073c555a1fb9aebf857dbd11922d626b69c3..2a7342d4439b5c7e067dfde539b75859b359f617 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -161,7 +161,7 @@ my %table=(
 # surrounds it with #APP #NO_APP comment pair which (at least Solaris
 # 7_x86) /usr/ccs/bin/as fails to assemble with "Illegal mnemonic"
 # error message.
-"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_sol_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
+"solaris-x86-gcc","gcc:-O3 -fomit-frame-pointer -m486 -Wall -DL_ENDIAN -DOPENSSL_NO_INLINE_ASM::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG ${x86_gcc_des} ${x86_gcc_opts}:${x86_elf_asm}:dlfcn:solaris-shared:-fPIC:-shared:.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
 
 #### Solaris x86 with Sun C setups
 "solaris-x86-cc","cc:-fast -O -Xa::-D_REENTRANT::-lsocket -lnsl -ldl:BN_LLONG RC4_CHAR RC4_CHUNK DES_PTR DES_UNROLL BF_PTR::::::::::dlfcn:solaris-shared:-KPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
index ec602faa7dfeb04b76bb5610a0dd1dd4fa15e00b..48dc3a98fdc47177d4b0bca0a2cae47042464119 100644 (file)
@@ -72,6 +72,14 @@ TAR= tar
 TARFLAGS= --no-recursion
 MAKEDEPPROG=makedepend
 
+# We let the C compiler driver to take care of .s files. This is done in
+# order to be excused from maintaining a separate set of architecture
+# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
+# gcc, then the driver will automatically translate it to -xarch=v8plus
+# and pass it down to assembler.
+AS=$(CC) -c
+ASFLAGS=$(CFLAG)
+
 # Set BN_ASM to bn_asm.o if you want to use the C version
 BN_ASM= bn_asm.o
 #BN_ASM= bn_asm.o
@@ -208,7 +216,7 @@ all: Makefile.ssl build_all openssl.pc
 BUILD_CMD=if echo " $(DIRS) " | grep " $$i " >/dev/null 2>/dev/null; then \
        if [ -d "$$i" ]; then \
                (cd $$i && echo "making all in $$i..." && \
-               $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
+               $(MAKE) CC='${CC}' PLATFORM='${PLATFORM}' CFLAG='${CFLAG}' AS='${AS}' ASFLAGS='${ASFLAGS}' SDIRS='$(SDIRS)' INSTALLTOP='${INSTALLTOP}' PEX_LIBS='${PEX_LIBS}' EX_LIBS='${EX_LIBS}' BN_ASM='${BN_ASM}' DES_ENC='${DES_ENC}' BF_ENC='${BF_ENC}' CAST_ENC='${CAST_ENC}' RC4_ENC='${RC4_ENC}' RC5_ENC='${RC5_ENC}' SHA1_ASM_OBJ='${SHA1_ASM_OBJ}' MD5_ASM_OBJ='${MD5_ASM_OBJ}' RMD160_ASM_OBJ='${RMD160_ASM_OBJ}' AR='${AR}' PROCESSOR='${PROCESSOR}' PERL='${PERL}' RANLIB='${RANLIB}' KRB5_INCLUDES='${KRB5_INCLUDES}' LIBKRB5='${LIBKRB5}' EXE_EXT='${EXE_EXT}' SHARED_LIBS='${SHARED_LIBS}' SHLIB_EXT='${SHLIB_EXT}' SHLIB_TARGET='${SHLIB_TARGET}' all ) || exit 1; \
        else \
                $(MAKE) $$i; \
        fi; fi
index bd3cedc4f88a5ae4d86bc0cb057000d56c54be4e..bb14a0ee8250de73e9bc01ce25e83fcea3984fa9 100644 (file)
@@ -49,14 +49,8 @@ lib: $(LIBOBJ)
        @touch lib
 
 # elf
-asm/bx86-elf.o: asm/bx86unix.cpp
-       $(CPP) -DELF -x c asm/bx86unix.cpp | as -o asm/bx86-elf.o
-
-# solaris
-asm/bx86-sol.o: asm/bx86unix.cpp
-       $(CC) -E -DSOL asm/bx86unix.cpp | sed 's/^#.*//' > asm/bx86-sol.s
-       as -o asm/bx86-sol.o asm/bx86-sol.s
-       rm -f asm/bx86-sol.s
+asm/bx86-elf.s: asm/bf-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
+       (cd asm; $(PERL) bf-586.pl elf $(CFLAGS) $(PROCESSOR) > bx86-elf.s)
 
 # a.out
 asm/bx86-out.o: asm/bx86unix.cpp
@@ -103,7 +97,7 @@ dclean:
        mv -f Makefile.new $(MAKEFILE)
 
 clean:
-       rm -f asm/bx86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+       rm -f asm/bx86unix.cpp asm/*-elf.* *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
index b709c84adc9fd0ff07ae454571eee64025708c2d..c109411d4b11f6058027a083b905230bddd22ce0 100644 (file)
@@ -23,14 +23,6 @@ BN_ASM=              bn_asm.o
 
 CFLAGS= $(INCLUDES) $(CFLAG)
 
-# We let the C compiler driver to take care of .s files. This is done in
-# order to be excused from maintaining a separate set of architecture
-# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
-# gcc, then the driver will automatically translate it to -xarch=v8plus
-# and pass it down to assembler.
-AS=$(CC) -c
-ASFLAGS=$(CFLAGS)
-
 GENERAL=Makefile
 TEST=bntest.c exptest.c
 APPS=
@@ -75,22 +67,11 @@ lib:        $(LIBOBJ)
        @touch lib
 
 # elf
-asm/bn86-elf.o: asm/bn86unix.cpp
-       $(CPP) -DELF -x c asm/bn86unix.cpp | as -o asm/bn86-elf.o
-
-asm/co86-elf.o: asm/co86unix.cpp
-       $(CPP) -DELF -x c asm/co86unix.cpp | as -o asm/co86-elf.o
-
-# solaris
-asm/bn86-sol.o: asm/bn86unix.cpp
-       $(CC) -E -DSOL asm/bn86unix.cpp | sed 's/^#.*//' > asm/bn86-sol.s
-       as -o asm/bn86-sol.o asm/bn86-sol.s
-       rm -f asm/bn86-sol.s
+asm/bn86-elf.s:        asm/bn-586.pl ../perlasm/x86asm.pl
+       (cd asm; $(PERL) bn-586.pl elf $(CFLAGS) > bn86-elf.s)
 
-asm/co86-sol.o: asm/co86unix.cpp
-       $(CC) -E -DSOL asm/co86unix.cpp | sed 's/^#.*//' > asm/co86-sol.s
-       as -o asm/co86-sol.o asm/co86-sol.s
-       rm -f asm/co86-sol.s
+asm/co86-elf.s:        asm/co-586.pl ../perlasm/x86asm.pl
+       (cd asm; $(PERL) co-586.pl elf $(CFLAGS) > co86-elf.s)
 
 # a.out
 asm/bn86-out.o: asm/bn86unix.cpp
@@ -180,7 +161,7 @@ dclean:
        mv -f Makefile.new $(MAKEFILE)
 
 clean:
-       rm -f asm/co86unix.cpp asm/bn86unix.cpp *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff bn_asm.s
+       rm -f asm/co86unix.cpp asm/bn86unix.cpp asm/*-elf.* *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff bn_asm.s
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
index c18d86845e1e9bb5fab6bba677c053f152c780a6..70c47bf8e6954ace619e9adb856aa9a2827f8724 100644 (file)
@@ -52,14 +52,8 @@ lib: $(LIBOBJ)
        @touch lib
 
 # elf
-asm/cx86-elf.o: asm/cx86unix.cpp
-       $(CPP) -DELF -x c asm/cx86unix.cpp | as -o asm/cx86-elf.o
-
-# solaris
-asm/cx86-sol.o: asm/cx86unix.cpp
-       $(CC) -E -DSOL asm/cx86unix.cpp | sed 's/^#.*//' > asm/cx86-sol.s
-       as -o asm/cx86-sol.o asm/cx86-sol.s
-       rm -f asm/cx86-sol.s
+asm/cx86-elf.s: asm/cast-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
+       (cd asm; $(PERL) cast-586.pl elf $(CLAGS) $(PROCESSOR) > cx86-elf.s)
 
 # a.out
 asm/cx86-out.o: asm/cx86unix.cpp
@@ -104,7 +98,7 @@ dclean:
        mv -f Makefile.new $(MAKEFILE)
 
 clean:
-       rm -f asm/cx86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+       rm -f asm/cx86unix.cpp asm/*-elf.* *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
index 93979d497ae341f5c0ea50317c80a2357b2b25eb..149d5a81ec42de6282b2eb3d0599c2e7c4bf955e 100644 (file)
@@ -77,30 +77,11 @@ asm/des_enc-sparc.S:        asm/des_enc.m4
        m4 -B 8192 asm/des_enc.m4 > asm/des_enc-sparc.S
 
 # elf
-asm/dx86-elf.o: asm/dx86unix.cpp
-       $(CPP) -DELF    \
-               `(echo $(CFLAGS) | egrep -ie '-[fK]PIC') > /dev/null 2>&1 && echo -DPIC; exit 0`\
-               -x c asm/dx86unix.cpp | as -o asm/dx86-elf.o
-
-asm/yx86-elf.o: asm/yx86unix.cpp
-       $(CPP) -DELF    \
-               `(echo $(CFLAGS) | egrep -ie '-[fK]PIC') > /dev/null 2>&1 && echo -DPIC; exit 0`\
-               -x c asm/yx86unix.cpp | as -o asm/yx86-elf.o
-
-# solaris
-asm/dx86-sol.o: asm/dx86unix.cpp
-       $(CC) -E -DSOL  \
-               `(echo $(CFLAGS) | egrep -ie '-[fK]PIC') > /dev/null 2>&1 && echo -DPIC; exit 0`\
-               asm/dx86unix.cpp | sed 's/^#.*//' > asm/dx86-sol.s
-       as -o asm/dx86-sol.o asm/dx86-sol.s
-       rm -f asm/dx86-sol.s
-
-asm/yx86-sol.o: asm/yx86unix.cpp
-       $(CC) -E -DSOL  \
-               `(echo $(CFLAGS) | egrep -ie '-[fK]PIC') > /dev/null 2>&1 && echo -DPIC; exit 0`\
-               asm/yx86unix.cpp | sed 's/^#.*//' > asm/yx86-sol.s
-       as -o asm/yx86-sol.o asm/yx86-sol.s
-       rm -f asm/yx86-sol.s
+asm/dx86-elf.s:        asm/des-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
+       (cd asm; $(PERL) des-586.pl elf $(CFLAGS) > dx86-elf.s)
+
+asm/yx86-elf.s:        asm/crypt586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
+       (cd asm; $(PERL) crypt586.pl elf $(CFLAGS) > yx86-elf.s)
 
 # a.out
 asm/dx86-out.o: asm/dx86unix.cpp
@@ -156,7 +137,7 @@ dclean:
        mv -f Makefile.new $(MAKEFILE)
 
 clean:
-       rm -f asm/dx86unix.cpp asm/yx86unix.cpp *.o asm/*.o *.obj des lib tags core .pure .nfs* *.old *.bak fluff
+       rm -f asm/dx86unix.cpp asm/yx86unix.cpp asm/*-elf.* *.o asm/*.o *.obj des lib tags core .pure .nfs* *.old *.bak fluff
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
index 51fb3ddf26e4a00d34d97484209c95e30db506fe..1d04ed6def10f91f1c79bbd6f4443146ab453ebb 100644 (file)
@@ -32,8 +32,9 @@ sub fcrypt_body
        &xor(   $R,     $R);
 
        # PIC-ification:-)
-       if ($cpp)       { &picmeup("edx","DES_SPtrans");   }
-       else            { &lea("edx",&DWP("DES_SPtrans")); }
+       &picmeup("edx","DES_SPtrans");
+       #if ($cpp)      { &picmeup("edx","DES_SPtrans");   }
+       #else           { &lea("edx",&DWP("DES_SPtrans")); }
        &push("edx");   # becomes &swtmp(1)
        #
        &mov($trans,&wparam(1)); # reloaded with DES_SPtrans in D_ENCRYPT
index 7a5886928995bb06a08c8de26b418874fee530e2..b75d3c6b3a44b8eed2d4b6e46a19c1d3f3936ecc 100644 (file)
@@ -73,8 +73,9 @@ sub DES_encrypt
                }
 
        # PIC-ification:-)
-       if ($cpp)       { &picmeup($trans,"DES_SPtrans");   }
-       else            { &lea($trans,&DWP("DES_SPtrans")); }
+       &picmeup($trans,"DES_SPtrans");
+       #if ($cpp)      { &picmeup($trans,"DES_SPtrans");   }
+       #else           { &lea($trans,&DWP("DES_SPtrans")); }
 
        &mov(   "ecx",  &wparam(1)      );
        &cmp("ebx","0");
index e28bb924517e124d661a0d8a74cd624dd692ac4c..56cab5d882ba5cf56053941a766254fbe13d3789 100644 (file)
@@ -21,14 +21,6 @@ MD5_ASM_OBJ=
 
 CFLAGS= $(INCLUDES) $(CFLAG)
 
-# We let the C compiler driver to take care of .s files. This is done in
-# order to be excused from maintaining a separate set of architecture
-# dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
-# gcc, then the driver will automatically translate it to -xarch=v8plus
-# and pass it down to assembler.
-AS=$(CC) -c
-ASFLAGS=$(CFLAGS)
-
 GENERAL=Makefile
 TEST=md5test.c
 APPS=
@@ -55,14 +47,8 @@ lib:    $(LIBOBJ)
        @touch lib
 
 # elf
-asm/mx86-elf.o: asm/mx86unix.cpp
-       $(CPP) -DELF -x c asm/mx86unix.cpp | as -o asm/mx86-elf.o
-
-# solaris
-asm/mx86-sol.o: asm/mx86unix.cpp
-       $(CC) -E -DSOL asm/mx86unix.cpp | sed 's/^#.*//' > asm/mx86-sol.s
-       as -o asm/mx86-sol.o asm/mx86-sol.s
-       rm -f asm/mx86-sol.s
+asm/mx86-elf.s: asm/md5-586.pl ../perlasm/x86asm.pl
+       (cd asm; $(PERL) md5-586.pl elf $(CFLAGS) > mx86-elf.s)
 
 # a.out
 asm/mx86-out.o: asm/mx86unix.cpp
@@ -125,7 +111,7 @@ dclean:
        mv -f Makefile.new $(MAKEFILE)
 
 clean:
-       rm -f asm/mx86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+       rm -f asm/mx86unix.cpp asm/*-elf.* *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
index 9a3d85b0984b2e3448154c97e0f081e76db06c9a..888c656f931a7cd3bdd2f828b333af1f461dadcf 100644 (file)
@@ -18,9 +18,9 @@ sub main'asm_init
        ($type,$fn,$i386)=@_;
        $filename=$fn;
 
-       $cpp=$sol=$aout=$win32=$gaswin=0;
+       $elf=$cpp=$sol=$aout=$win32=$gaswin=0;
        if (    ($type eq "elf"))
-               { require "x86unix.pl"; }
+               { $elf=1; require "x86unix.pl"; }
        elsif ( ($type eq "a.out"))
                { $aout=1; require "x86unix.pl"; }
        elsif ( ($type eq "gaswin"))
@@ -47,6 +47,9 @@ EOF
                exit(1);
                }
 
+       $pic=0;
+       for (@ARGV) {   $pic=1 if (/\-[fK]PIC/i);       }
+
        &asm_init_output();
 
 &comment("Don't even think of reading this code");
index 3ad889ffd60dd75165e5f2acb990b291babed2b9..b1c87037dde6b740665957c48d9bfcbe5f652840 100644 (file)
@@ -426,6 +426,11 @@ sub main'swtmp
 
 sub main'comment
        {
+       if ($main'elf)  # GNU and SVR4 as'es use different comment delimiters,
+               {       # so we just skip comments...
+               push(@out,"\n");
+               return;
+               }
        foreach (@_)
                {
                if (/^\s*$/)
@@ -546,7 +551,9 @@ sub popvars
 sub main'picmeup
        {
        local($dst,$sym)=@_;
-       local($tmp)=<<___;
+       if ($main'cpp)
+               {
+               local($tmp)=<<___;
 #if (defined(ELF) || defined(SOL)) && defined(PIC)
        .align  8
        call    1f
@@ -557,7 +564,22 @@ sub main'picmeup
        leal    $sym,$regs{$dst}
 #endif
 ___
-       push(@out,$tmp);
+               push(@out,$tmp);
+               }
+       elsif ($main'pic && $main'elf)
+               {
+               push(@out,"\t.align\t8\n");
+               &main'call(&main'label("PIC_me_up"));
+               &main'set_label("PIC_me_up");
+               &main'blindpop($dst);
+               &main'add($dst,"\$_GLOBAL_OFFSET_TABLE_+[.-" .
+                               &main'label("PIC_me_up") . "]");
+               &main'mov($dst,&main'DWP("$under$sym\@GOT",$dst));
+               }
+       else
+               {
+               &main'lea($dst,&main'DWP("$under$sym"));
+               }
        }
 
 sub main'blindpop { &out1("popl",@_); }
index a1eb79fd08cdcf2391afdebc350f6784939138ca..b210b42f8f4b1b3a387bf50e9a5662a2a03e98bd 100644 (file)
@@ -52,14 +52,8 @@ lib: $(LIBOBJ)
        @touch lib
 
 # elf
-asm/rx86-elf.o: asm/rx86unix.cpp
-       $(CPP) -DELF -x c asm/rx86unix.cpp | as -o asm/rx86-elf.o
-
-# solaris
-asm/rx86-sol.o: asm/rx86unix.cpp
-       $(CC) -E -DSOL asm/rx86unix.cpp | sed 's/^#.*//' > asm/rx86-sol.s
-       as -o asm/rx86-sol.o asm/rx86-sol.s
-       rm -f asm/rx86-sol.s
+asm/rx86-elf.s: asm/rc4-586.pl ../perlasm/x86asm.pl
+       (cd asm; $(PERL) rc4-586.pl elf $(CFLAGS) > rx86-elf.s)
 
 # a.out
 asm/rx86-out.o: asm/rx86unix.cpp
@@ -104,7 +98,7 @@ dclean:
        mv -f Makefile.new $(MAKEFILE)
 
 clean:
-       rm -f asm/rx86unix.cpp *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff asm/*.o
+       rm -f asm/rx86unix.cpp asm/*-elf.* *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff asm/*.o
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
index bb4704d5f542cc5620fc05694395862d6420b12a..3ad665594686f617580521fd176495edb7bbfc3d 100644 (file)
@@ -49,14 +49,8 @@ lib: $(LIBOBJ)
        @touch lib
 
 # elf
-asm/r586-elf.o: asm/r586unix.cpp
-       $(CPP) -DELF -x c asm/r586unix.cpp | as -o asm/r586-elf.o
-
-# solaris
-asm/r586-sol.o: asm/r586unix.cpp
-       $(CC) -E -DSOL asm/r586unix.cpp | sed 's/^#.*//' > asm/r586-sol.s
-       as -o asm/r586-sol.o asm/r586-sol.s
-       rm -f asm/r586-sol.s
+asm/r586-elf.s: asm/rc5-586.pl ../perlasm/x86asm.pl ../perlasm/cbc.pl
+       (cd asm; $(PERL) rc5-586.pl elf $(CFLAGS) > r586-elf.s)
 
 # a.out
 asm/r586-out.o: asm/r586unix.cpp
@@ -101,7 +95,7 @@ dclean:
        mv -f Makefile.new $(MAKEFILE)
 
 clean:
-       rm -f asm/r586unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+       rm -f asm/r586unix.cpp asm/*-elf.* *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
index 6f1a9c59a2ffdafb047d426499ae17bfd5cc624f..3583dfdcaf325c3ac1eafd60d0e8f95a0e0b59c6 100644 (file)
@@ -47,14 +47,8 @@ lib:    $(LIBOBJ)
        @touch lib
 
 # elf
-asm/rm86-elf.o: asm/rm86unix.cpp
-       $(CPP) -DELF -x c asm/rm86unix.cpp | as -o asm/rm86-elf.o
-
-# solaris
-asm/rm86-sol.o: asm/rm86unix.cpp
-       $(CC) -E -DSOL asm/rm86unix.cpp | sed 's/^#.*//' > asm/rm86-sol.s
-       as -o asm/rm86-sol.o asm/rm86-sol.s
-       rm -f asm/rm86-sol.s
+asm/rm86-elf.s: asm/rmd-586.pl ../perlasm/x86asm.pl
+       (cd asm; $(PERL) rmd-586.pl elf $(CFLAGS) > rm86-elf.s)
 
 # a.out
 asm/rm86-out.o: asm/rm86unix.cpp
@@ -99,7 +93,7 @@ dclean:
        mv -f Makefile.new $(MAKEFILE)
 
 clean:
-       rm -f asm/rm86unix.cpp *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
+       rm -f asm/rm86unix.cpp asm/*-elf.* *.o asm/*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.
 
index 64873976a4c8558b420b6badb408204e266d78b7..864645c8b547af8347515e0bf2d01c133ad7b613 100644 (file)
@@ -47,14 +47,8 @@ lib:    $(LIBOBJ)
        @touch lib
 
 # elf
-asm/sx86-elf.o: asm/sx86unix.cpp
-       $(CPP) -DELF -x c asm/sx86unix.cpp | as -o asm/sx86-elf.o
-
-# solaris
-asm/sx86-sol.o: asm/sx86unix.cpp
-       $(CC) -E -DSOL asm/sx86unix.cpp | sed 's/^#.*//' > asm/sx86-sol.s
-       as -o asm/sx86-sol.o asm/sx86-sol.s
-       rm -f asm/sx86-sol.s
+asm/sx86-elf.s: asm/sha1-586.pl ../perlasm/x86asm.pl
+       (cd asm; $(PERL) sha1-586.pl elf $(CFLAGS) $(PROCESSOR) > sx86-elf.s)
 
 # a.out
 asm/sx86-out.o: asm/sx86unix.cpp
@@ -99,7 +93,7 @@ dclean:
        mv -f Makefile.new $(MAKEFILE)
 
 clean:
-       rm -f asm/sx86unix.cpp *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff asm/*.o
+       rm -f asm/sx86unix.cpp asm/*-elf.* *.o *.obj lib tags core .pure .nfs* *.old *.bak fluff asm/*.o
 
 # DO NOT DELETE THIS LINE -- make depend depends on it.