--- Makefile	Wed Dec  2 19:29:50 1998
+++ Makefile_monkey	Sat Oct  5 01:49:00 2002
@@ -1,6 +1,6 @@
 #
 # This file is part of John the Ripper password cracker,
-# Copyright (c) 1996-98 by Solar Designer
+# Copyright (c) 1996-2002 by Solar Designer
 #
 
 CPP = gcc
@@ -10,6 +10,7 @@
 CP = cp
 LN = ln -sf
 RM = rm -f
+TR = tr
 SED = sed
 NULL = /dev/null
 CPPFLAGS = -E
@@ -25,12 +26,12 @@
 JOHN_DIST = \
 	$(JOHN_ARCHIVE)/src/*.{c,h,S,sh,asm,com,diff} \
 	$(JOHN_ARCHIVE)/src/Makefile{,.dep} \
-	$(JOHN_ARCHIVE)/run/{mailer,john.ini,*.chr,password.lst} \
+	$(JOHN_ARCHIVE)/run/{mailer,john.conf,*.chr,password.lst} \
 	$(JOHN_ARCHIVE)/doc/* \
 	$(JOHN_ARCHIVE)/README
 
-JOHN_OBJS_ORIG = \
-	DES_fmt.o DES_std.o \
+JOHN_OBJS_MINIMAL = \
+	DES_fmt.o DES_std.o DES_bs.o \
 	BSDI_fmt.o \
 	MD5_fmt.o MD5_std.o \
 	BF_fmt.o BF_std.o \
@@ -44,12 +45,13 @@
 	unafs.o \
 	unique.o
 
+JOHN_OBJS_ORIG = \
+	$(JOHN_OBJS_MINIMAL) \
+	DES_bs_b.o
+
 JOHN_OBJS = \
 	$(JOHN_OBJS_ORIG)
 
-BITSLICE_OBJS = \
-	DES_bs.o DES_bs_b.o
-
 BENCH_DES_OBJS_ORIG = \
 	DES_fmt.o DES_std.o
 
@@ -57,15 +59,15 @@
 	$(BENCH_DES_OBJS_ORIG)
 
 BENCH_MD5_OBJS_DEPEND = \
-	MD5_std.o
+	MD5_fmt.o MD5_std.o
 
 BENCH_BF_OBJS_DEPEND = \
 	BF_std.o
 
 BENCH_OBJS = \
-	$(BITSLICE_OBJS) \
 	$(BENCH_DES_OBJS_DEPEND) \
-	MD5_fmt.o $(BENCH_MD5_OBJS_DEPEND) \
+	DES_bs.o DES_bs_b.o \
+	$(BENCH_MD5_OBJS_DEPEND) \
 	BF_fmt.o $(BENCH_BF_OBJS_DEPEND) \
 	bench.o best.o common.o config.o formats.o memory.o misc.o params.o \
 	path.o signals.o tty.o
@@ -82,125 +84,132 @@
 	@echo "where SYSTEM can be one of the following:"
 	@echo "linux-x86-any-elf        Linux, x86, ELF binaries"
 	@echo "linux-x86-mmx-elf        Linux, x86 with MMX, ELF binaries"
-	@echo "linux-x86-k6-elf         Linux, AMD K6, ELF binaries"
 	@echo "linux-x86-any-a.out      Linux, x86, a.out binaries"
 	@echo "linux-alpha              Linux, Alpha"
 	@echo "linux-sparc              Linux, SPARC"
-	@echo "freebsd-x86-any-a.out    FreeBSD, x86, a.out binaries"
-	@echo "freebsd-x86-k6-a.out     FreeBSD, AMD K6, a.out binaries"
+	@echo "linux-ppc                Linux, PowerPC"
 	@echo "freebsd-x86-any-elf      FreeBSD, x86, ELF binaries"
 	@echo "freebsd-x86-mmx-elf      FreeBSD, x86 with MMX, ELF binaries"
-	@echo "freebsd-x86-k6-elf       FreeBSD, AMD K6, ELF binaries"
+	@echo "freebsd-x86-any-a.out    FreeBSD, x86, a.out binaries"
+	@echo "freebsd-alpha            FreeBSD, Alpha"
 	@echo "openbsd-x86-any          OpenBSD, x86"
-	@echo "openbsd-x86-k6           OpenBSD, AMD K6"
+	@echo "openbsd-sparc            OpenBSD, SPARC"
+	@echo "openbsd-vax              OpenBSD, VAX"
+	@echo "netbsd-vax               NetBSD, VAX"
 	@echo "solaris-sparc-gcc        Solaris, SPARC, gcc"
 	@echo "solaris-sparc-v8-cc      Solaris, SPARC V8, cc"
 	@echo "solaris-sparc-v9-cc      Solaris, SPARC V9, cc"
 	@echo "solaris-x86-any          Solaris, x86, gcc"
-	@echo "solaris-x86-k6           Solaris, AMD K6, gcc"
-	@echo "digital-alpha-cc         Digital UNIX, Alpha, cc"
+	@echo "sco-x86-any-gcc          SCO, x86, gcc, ELF binaries"
+	@echo "sco-x86-any-cc           SCO, x86, cc, ELF binaries"
+	@echo "tru64-alpha-cc           Tru64 (Digital UNIX, OSF/1), Alpha, cc"
 	@echo "aix-ppc-cc               AIX, PowerPC, cc"
+	@echo "macosx-ppc-cc            MacOS X, PowerPC, cc"
 	@echo "hpux-pa-risc-gcc         HP-UX, PA-RISC, gcc"
-	@echo "hpux-pa-risc-cc          HP-UX, PA-RISC, cc"
+	@echo "hpux-pa-risc-cc          HP-UX, PA-RISC, ANSI cc"
 	@echo "irix-mips32-cc           IRIX, MIPS 32-bit, cc"
 	@echo "irix-mips64-cc           IRIX, MIPS 64-bit, cc"
 	@echo "dos-djgpp-x86-any        DOS, DJGPP 2.x, x86"
 	@echo "dos-djgpp-x86-mmx        DOS, DJGPP 2.x, x86 with MMX"
-	@echo "dos-djgpp-x86-k6         DOS, DJGPP 2.x, AMD K6"
 	@echo "win32-cygwin-x86-any     Win32, Cygwin, x86"
 	@echo "win32-cygwin-x86-mmx     Win32, Cygwin, x86 with MMX"
-	@echo "win32-cygwin-x86-k6      Win32, Cygwin, AMD K6"
-	@echo "generic                  Any other UNIX system with gcc"
+	@echo "beos-x86-any             BeOS, x86"
+	@echo "beos-x86-mmx             BeOS, x86 with MMX"
+	@echo "generic                  Any other Unix system with gcc"
 
 linux-x86-any-elf:
 	$(LN) x86-any.h arch.h
 	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(JOHN_OBJS) x86.o" \
-		CFLAGS="$(CFLAGS) -m486"
+		JOHN_OBJS="$(JOHN_OBJS) x86.o"
 
 linux-x86-mmx-elf:
 	$(LN) x86-mmx.h arch.h
 	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(JOHN_OBJS) x86.o" \
-		CFLAGS="$(CFLAGS) -m486"
-
-linux-x86-k6-elf:
-	$(LN) x86-k6.h arch.h
-	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS) x86.o"
+		JOHN_OBJS="$(JOHN_OBJS_MINIMAL) x86.o x86-mmx.o"
 
 linux-x86-any-a.out:
 	$(LN) x86-any.h arch.h
 	$(MAKE) $(PROJ) \
 		JOHN_OBJS="$(JOHN_OBJS) x86.o" \
-		CFLAGS="$(CFLAGS) -m486" \
 		ASFLAGS="$(ASFLAGS) -DUNDERSCORES -DALIGN_LOG"
 
 linux-alpha:
 	$(LN) alpha.h arch.h
 	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS) alpha.o"
+		JOHN_OBJS="$(JOHN_OBJS) alpha.o"
 
-linux-alpha-very-slow-cache:
-	$(LN) alpha-4k.h arch.h
+# This target is currently "undocumented" as ccc generates much slower
+# code for the large unrolled loops in John; let's hope it gets fixed.
+linux-alpha-ccc:
+	$(LN) alpha.h arch.h
 	$(MAKE) $(PROJ) \
+		CPP=ccc CC=ccc AS=ccc LD=ccc \
+		CFLAGS="-c -Wf,-switch,noil_schedule" \
+		OPT_NORMAL="-fast" \
+		OPT_INLINE="-O2 -arch host" \
 		JOHN_OBJS="$(JOHN_OBJS) alpha.o"
 
 linux-sparc:
-	$(MAKE) HAMMER=use-linux-sparc sparc.h
-	ln -s sparc.h arch.h
+	$(MAKE) use-linux-sparc HAMMER=use-linux-sparc NAIL=sparc.h
+	$(LN) sparc.h arch.h
 	$(MAKE) use-linux-sparc NAIL="$(PROJ)"
 
 use-linux-sparc:
 	$(MAKE) $(NAIL) \
 		BENCH_DES_OBJS_DEPEND="$(BENCH_DES_OBJS_ORIG) sparc.o" \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS_ORIG) sparc.o"
-
-freebsd-x86-any-a.out:
-	$(LN) x86-any.h arch.h
-	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(JOHN_OBJS) x86.o" \
-		CFLAGS="$(CFLAGS) -m486" \
-		ASFLAGS="$(ASFLAGS) -DUNDERSCORES -DALIGN_LOG -DBSD"
+		JOHN_OBJS="$(JOHN_OBJS_ORIG) sparc.o"
 
-freebsd-x86-k6-a.out:
-	$(LN) x86-k6.h arch.h
-	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS) x86.o" \
-		ASFLAGS="$(ASFLAGS) -DUNDERSCORES -DALIGN_LOG -DBSD"
+linux-ppc:
+	$(LN) ppc.h arch.h
+	$(MAKE) $(PROJ)
 
 freebsd-x86-any-elf:
 	$(LN) x86-any.h arch.h
 	$(MAKE) $(PROJ) \
 		JOHN_OBJS="$(JOHN_OBJS) x86.o" \
-		CFLAGS="$(CFLAGS) -m486" \
 		ASFLAGS="$(ASFLAGS) -DBSD"
 
 freebsd-x86-mmx-elf:
 	$(LN) x86-mmx.h arch.h
 	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(JOHN_OBJS) x86.o" \
-		CFLAGS="$(CFLAGS) -m486" \
+		JOHN_OBJS="$(JOHN_OBJS_MINIMAL) x86.o x86-mmx.o" \
 		ASFLAGS="$(ASFLAGS) -DBSD"
 
-freebsd-x86-k6-elf:
-	$(LN) x86-k6.h arch.h
+freebsd-x86-any-a.out:
+	$(LN) x86-any.h arch.h
 	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS) x86.o" \
-		ASFLAGS="$(ASFLAGS) -DBSD"
+		JOHN_OBJS="$(JOHN_OBJS) x86.o" \
+		ASFLAGS="$(ASFLAGS) -DUNDERSCORES -DALIGN_LOG -DBSD"
+
+freebsd-alpha:
+	$(LN) alpha.h arch.h
+	$(MAKE) $(PROJ) \
+		JOHN_OBJS="$(JOHN_OBJS) alpha.o"
 
 openbsd-x86-any:
 	$(LN) x86-any.h arch.h
 	$(MAKE) $(PROJ) \
 		JOHN_OBJS="$(JOHN_OBJS) x86.o" \
-		CFLAGS="$(CFLAGS) -m486" \
 		ASFLAGS="$(ASFLAGS) -DUNDERSCORES -DALIGN_LOG -DBSD"
 
-openbsd-x86-k6:
-	$(LN) x86-k6.h arch.h
-	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS) x86.o" \
-		ASFLAGS="$(ASFLAGS) -DUNDERSCORES -DALIGN_LOG -DBSD"
+openbsd-sparc:
+	$(MAKE) use-openbsd-sparc HAMMER=use-openbsd-sparc NAIL=sparc.h
+	$(LN) sparc.h arch.h
+	$(MAKE) use-openbsd-sparc NAIL="$(PROJ)"
+
+use-openbsd-sparc:
+	$(MAKE) $(NAIL) \
+		BENCH_DES_OBJS_DEPEND="$(BENCH_DES_OBJS_ORIG) sparc.o" \
+		JOHN_OBJS="$(JOHN_OBJS_ORIG) sparc.o" \
+		ASFLAGS="-c -DUNDERSCORES -DBSD"
+
+openbsd-vax:
+	$(LN) vax.h arch.h
+	$(MAKE) $(PROJ)
+
+netbsd-vax:
+	$(LN) vax.h arch.h
+	$(MAKE) $(PROJ)
 
 solaris-sparc-any:
 	$(MAKE) $(HAMMER) NAIL=sparc.h
@@ -220,27 +229,28 @@
 use-solaris-sparc-gcc:
 	$(MAKE) $(NAIL) \
 		BENCH_DES_OBJS_DEPEND="$(BENCH_DES_OBJS_ORIG) sparc.o" \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS_ORIG) sparc.o"
+		JOHN_OBJS="$(JOHN_OBJS_ORIG) sparc.o" \
+		LDFLAGS="-s -lrt"
 
 use-solaris-sparc-v8-cc:
 	$(MAKE) $(NAIL) \
 		BENCH_DES_OBJS_DEPEND="$(BENCH_DES_OBJS_ORIG) spro-sparc.o" \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS_ORIG) spro-sparc.o" \
+		JOHN_OBJS="$(JOHN_OBJS_ORIG) spro-sparc.o" \
 		CPP=cc CC=cc AS=cc LD=cc \
 		CFLAGS="-c -xO4 -xarch=v8" \
-		LDFLAGS="-s -lc" \
+		LDFLAGS="-s -lc -lrt" \
 		OPT_NORMAL="" \
-		OPT_INLINE="-xinline=S1,S2,S3,S4,S5,S6,S7,S8"
+		OPT_INLINE="-xinline=s1,s2,s3,s4,s5,s6,s7,s8"
 
 use-solaris-sparc-v9-cc:
 	$(MAKE) $(NAIL) \
 		BENCH_DES_OBJS_DEPEND="$(BENCH_DES_OBJS_ORIG) spro-sparc.o" \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS_ORIG) spro-sparc.o" \
+		JOHN_OBJS="$(JOHN_OBJS_ORIG) spro-sparc.o" \
 		CPP=cc CC=cc AS=cc LD=cc \
 		CFLAGS="-c -xO4 -xarch=v8plusa -xchip=ultra" \
-		LDFLAGS="-s -lc" \
+		LDFLAGS="-s -lc -lrt" \
 		OPT_NORMAL="" \
-		OPT_INLINE="-xinline=S1,S2,S3,S4,S5,S6,S7,S8"
+		OPT_INLINE="-xinline=s1,s2,s3,s4,s5,s6,s7,s8"
 
 sparc.h:
 	$(RM) arch.h
@@ -250,7 +260,7 @@
 
 # Older versions of spro cc didn't support .S files directly
 spro-sparc.o: sparc.S
-	$(CPP) $(CPPFLAGS) sparc.S > tmp.s
+	$(CPP) $(CPPFLAGS) sparc.S | $(SED) 's/% /%/g' > tmp.s
 	$(AS) $(ASFLAGS) tmp.s -o spro-sparc.o
 	$(RM) tmp.s
 
@@ -260,56 +270,82 @@
 	$(MAKE) $(PROJ) \
 		SHELL=/bin/sh \
 		JOHN_OBJS="$(JOHN_OBJS) solaris-x86.o" \
-		CFLAGS="$(CFLAGS) -m486"
-
-solaris-x86-k6:
-	$(RM) arch.h
-	ln -s x86-k6.h arch.h
-	$(MAKE) $(PROJ) \
-		SHELL=/bin/sh \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS) solaris-x86.o"
+		LDFLAGS="-s -lc -lrt"
 
 # Solaris x86 got a broken assembler, with line length restriction (and some
 # other problems, that are worked around in x86.S)
 solaris-x86.o: x86.S
-	$(CPP) $(CPPFLAGS) -P -DSOLARIS x86.S | tr \; \\n > tmp.s
+	$(CPP) $(CPPFLAGS) -P -DDUMBAS x86.S | $(TR) \; \\n > tmp.s
 	$(AS) $(ASFLAGS) tmp.s -o solaris-x86.o
 	$(RM) tmp.s
 
-digital-alpha-cc:
+sco-x86-any-gcc:
+	$(RM) arch.h
+	ln -s x86-any.h arch.h
+	$(MAKE) $(PROJ) \
+		SHELL=/bin/sh \
+		JOHN_OBJS="$(JOHN_OBJS) sco-x86.o"
+
+sco-x86-any-cc:
+	$(RM) arch.h
+	ln -s x86-any.h arch.h
+	$(MAKE) $(PROJ) \
+		SHELL=/bin/sh \
+		JOHN_OBJS="$(JOHN_OBJS) sco-x86.o" \
+		CPP=cc CC=cc AS=cc LD=cc \
+		CFLAGS="-c -b elf -O3" \
+		ASFLAGS="-c -b elf" \
+		OPT_NORMAL="-K loop_unroll,no_inline" \
+		OPT_INLINE="-K inline"
+
+# SCO is even worse than Solaris x86
+sco-x86.o: x86.S
+	$(CPP) $(CPPFLAGS) -DDUMBAS x86.S | \
+		$(TR) \; \\n | $(SED) 's/\([%.]\) /\1/g' > tmp.s
+	$(AS) $(ASFLAGS) tmp.s -o sco-x86.o
+	$(RM) tmp.s
+
+tru64-alpha-cc:
 	$(LN) alpha.h arch.h
 	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS) digital-alpha.o" \
+		JOHN_OBJS="$(JOHN_OBJS) digipaq-alpha.o" \
 		CPP=cc CC=cc AS=cc LD=cc \
-		CFLAGS="-c -O5 -tune host" \
+		CFLAGS="-c -O4 -arch host" \
 		OPT_NORMAL="" \
 		OPT_INLINE="-inline all"
 
-# DEC's cc and make use the .S suffix for a different purpose...
-digital-alpha.o: alpha.S
+# Digital/Compaq's cc and make use the .S suffix for a different purpose...
+digipaq-alpha.o: alpha.S
 	$(CPP) $(CPPFLAGS) alpha.S > tmp.s
-	$(AS) $(ASFLAGS) tmp.s -o digital-alpha.o
+	$(AS) $(ASFLAGS) tmp.s -o digipaq-alpha.o
 	$(RM) tmp.s
 
 aix-ppc-cc:
 	$(LN) ppc.h arch.h
 	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS)" \
 		CPP=cc CC=cc AS=cc LD=cc \
-		CFLAGS="-c -qunroll -qarch=ppc -qtune=601 -qchars=signed" \
+		CFLAGS="-c -qunroll -qarch=ppc -qchars=signed" \
 		LDFLAGS="-s -lbsd" \
 		OPT_NORMAL="-O2" \
 		OPT_INLINE="-O3 -Q=99 -w"
 
+macosx-ppc-cc:
+	$(LN) ppc.h arch.h
+	$(MAKE) $(PROJ) \
+		CPP=cc CC=cc AS=cc LD=cc \
+		CFLAGS="-c -traditional-cpp" \
+		LDFLAGS="" \
+		OPT_NORMAL="-O2" \
+		OPT_INLINE="-O3"
+
 hpux-pa-risc-gcc:
 	$(LN) pa-risc.h arch.h
 	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS)"
+		CFLAGS="-c -Wall -O3 -fomit-frame-pointer"
 
 hpux-pa-risc-cc:
 	$(LN) pa-risc.h arch.h
 	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS)" \
 		CPP=cc CC=cc AS=cc LD=cc \
 		CFLAGS="-c -Aa -D_HPUX_SOURCE -DANSI_CPP" \
 		LDFLAGS="-s" \
@@ -319,7 +355,6 @@
 irix-mips32-cc:
 	$(LN) mips32.h arch.h
 	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS)" \
 		CPP=cc CC=cc AS=cc LD=cc \
 		CFLAGS="-c -O2 -32 -signed" \
 		LDFLAGS="-s -32" \
@@ -329,7 +364,6 @@
 irix-mips64-cc:
 	$(LN) mips64.h arch.h
 	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS)" \
 		CPP=cc CC=cc AS=cc LD=cc \
 		CFLAGS="-c -O2 -64 -mips4 -r10000 -signed" \
 		LDFLAGS="-s -64 -mips4 -r10000" \
@@ -340,50 +374,40 @@
 	copy x86-any.h arch.h
 	$(MAKE) $(PROJ_DOS) \
 		JOHN_OBJS="$(JOHN_OBJS) x86.o" \
-		CFLAGS="$(CFLAGS) -m486" \
 		ASFLAGS="$(ASFLAGS) -DUNDERSCORES -DALIGN_LOG"
 
 dos-djgpp-x86-mmx:
 	copy x86-mmx.h arch.h
 	$(MAKE) $(PROJ_DOS) \
-		JOHN_OBJS="$(JOHN_OBJS) x86.o" \
-		CFLAGS="$(CFLAGS) -m486" \
-		ASFLAGS="$(ASFLAGS) -DUNDERSCORES -DALIGN_LOG"
-
-dos-djgpp-x86-k6:
-	copy x86-k6.h arch.h
-	copy nonstd.c DES_bs_s.c
-	$(MAKE) $(PROJ_DOS) \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS) x86.o" \
+		JOHN_OBJS="$(JOHN_OBJS_MINIMAL) x86.o x86-mmx.o" \
 		ASFLAGS="$(ASFLAGS) -DUNDERSCORES -DALIGN_LOG"
 
 win32-cygwin-x86-any:
 	$(CP) x86-any.h arch.h
 	$(MAKE) $(PROJ_WIN32) \
 		JOHN_OBJS="$(JOHN_OBJS) x86.o" \
-		CFLAGS="$(CFLAGS) -mpentium" \
 		ASFLAGS="$(ASFLAGS) -DUNDERSCORES"
 
 win32-cygwin-x86-mmx:
 	$(CP) x86-mmx.h arch.h
 	$(MAKE) $(PROJ_WIN32) \
-		JOHN_OBJS="$(JOHN_OBJS) x86.o" \
-		CFLAGS="$(CFLAGS) -mpentium" \
+		JOHN_OBJS="$(JOHN_OBJS_MINIMAL) x86.o x86-mmx.o" \
 		ASFLAGS="$(ASFLAGS) -DUNDERSCORES"
 
-win32-cygwin-x86-k6:
-	$(CP) x86-k6.h arch.h
-	$(CP) nonstd.c DES_bs_s.c
-	$(MAKE) $(PROJ_WIN32) \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS) x86.o" \
-		CFLAGS="-c -Wall -O -fomit-frame-pointer" \
-		ASFLAGS="$(ASFLAGS) -DUNDERSCORES"
+beos-x86-any:
+	$(LN) x86-any.h arch.h
+	$(MAKE) $(PROJ) \
+		JOHN_OBJS="$(JOHN_OBJS) x86.o"
+
+beos-x86-mmx:
+	$(LN) x86-mmx.h arch.h
+	$(MAKE) $(PROJ) \
+		JOHN_OBJS="$(JOHN_OBJS_MINIMAL) x86.o x86-mmx.o"
 
 generic: generic.h
 	$(RM) arch.h
 	ln -s generic.h arch.h
-	$(MAKE) $(PROJ) \
-		JOHN_OBJS="$(BITSLICE_OBJS) $(JOHN_OBJS)"
+	$(MAKE) $(PROJ)
 
 generic.h:
 	$(RM) arch.h
@@ -401,12 +425,15 @@
 	$(LD) $(LDFLAGS) $(JOHN_OBJS) -o ../run/john
 
 ../run/unshadow: ../run/john
+	$(RM) ../run/unshadow
 	ln -s john ../run/unshadow
 
 ../run/unafs: ../run/john
+	$(RM) ../run/unafs
 	ln -s john ../run/unafs
 
 ../run/unique: ../run/john
+	$(RM) ../run/unique
 	ln -s john ../run/unique
 
 ../run/john.bin: $(JOHN_OBJS)
@@ -446,7 +473,7 @@
 	strip ../run/unique.exe
 
 # Inlining the S-boxes produces faster code, as long as they fit in the cache
-# (that is, on RISC with at least 8 Kb of L1 code cache).
+# (that is, on RISC with at least 8 KB of L1 code cache).
 DES_bs_b.o: DES_bs_b.c DES_bs_s.c
 	$(CC) $(CFLAGS) $(OPT_INLINE) DES_bs_b.c
 
