#
# This file is part of John the Ripper password cracker,
# Copyright (c) 1996-2014 by Solar Designer
#
# ...with changes in the jumbo patch, by various authors
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted.
#
# There's ABSOLUTELY NO WARRANTY, express or implied.
#
# This file converted into autoconf format by JimF and
# magnum, in 2014. That is still a work in progress.
#

@SET_MAKE@
CC = @CC@
PTHREAD_CC = @PTHREAD_CC@
ifdef PTHREAD_CC
CC = @PTHREAD_CC@
endif
AR = @AR@
AS = @AS@
LD = @LD@
CPP = @CPP@
CP = cp
CP_PRESERVE = cp -p
LN = @LN_S@
RM = rm -f
MKDIR = @MKDIR_P@
TR = tr
SED = @SED@
NULL = /dev/null
SORT = @SORT@
STRIP = @STRIP@

SHELL = /bin/sh
VPATH = @srcdir@

subdirs = aes escrypt
top_srcdir = @top_srcdir@
srcdir = @srcdir@
prefix = @prefix@

# CUDA settings. See output of "nvcc -h"
NVCC_FLAGS = -c -Xptxas -v -fmad=true

CPPFLAGS = @CPPFLAGS@
CFLAGSX = -c @CFLAGS@ @CFLAGS_EXTRA@ @MEMDBG_CFLAGS@ @HAVE_CUDA@ @OPENSSL_CFLAGS@ @OPENMP_CFLAGS@ @HAVE_MPI@ @PTHREAD_CFLAGS@ $(RELEASE_BLD) $(CPPFLAGS)
# CFLAGS for use on the main john.c file only
CFLAGS_MAIN = -DAC_BUILT @CC_MAIN_CPU@ $(CFLAGSX)
CFLAGS = -DAC_BUILT @CC_CPU@ $(CFLAGSX)
ASFLAGS = -DAC_BUILT @ASFLAGS@ @CC_CPU@ -c @OPENMP_CFLAGS@ @HAVE_MPI@ @EXTRA_AS_FLAGS@
LIBS = @LIBS@
LDFLAGS = -g @LDFLAGS@ $(LIBS) @HAVE_MPI@
#
OPT_NORMAL = @OPT_NORMAL_FLAGS@
OPT_INLINE = @OPT_INLINE_FLAGS@
#

PLUGFORMATS_OBJS = @PLUGFORMATS_OBJS@

JOHN_OBJS = \
	jumbo.o john-mpi.o \
	DES_fmt.o DES_std.o DES_bs.o DES_bs_b.o \
	BSDI_fmt.o \
	MD5_fmt.o MD5_std.o cryptmd5_common.o \
	BF_fmt.o BF_std.o BF_common.o \
	scrypt_fmt.o \
	escrypt/crypto_scrypt-best.o escrypt/crypto_scrypt-common.o \
	escrypt/sha256.o \
	AFS_fmt.o \
	LM_fmt.o \
	trip_fmt.o \
	NT_fmt.o \
	timer.o \
	md5.o \
	rc4.o \
	hmacmd5.o \
	base64.o base64_convert.o \
	md4.o sha2.o \
	dynamic_fmt.o dynamic_parser.o dynamic_preloads.o dynamic_utils.o dynamic_big_crypt.o \
	ripemd.o tiger.o \
	ssh2john.o \
	pfx2john.o \
	unrarcmd.o unrarfilter.o unrarhlp.o unrar.o unrarppm.o unrarvm.o \
	rar2john.o \
	zip2john.o pkzip.o gladman_hmac.o gladman_pwd2key.o \
	racf2john.o \
	keychain2john.o \
	kwallet2john.o \
	pwsafe2john.o \
	dmg2john.o \
	keepass2john.o \
	keyring2john.o \
	hccap2john.o \
	$(PLUGFORMATS_OBJS) \
	dyna_salt.o dummy.o \
	gost.o \
	common-gpu.o \
	batch.o bench.o charset.o common.o compiler.o config.o cracker.o \
	crc32.o external.o formats.o getopt.o idle.o inc.o john.o list.o \
	loader.o logger.o mask.o mask_ext.o math.o memory.o misc.o options.o \
	params.o path.o recovery.o rpp.o rules.o signals.o single.o status.o \
	tty.o wordlist.o \
	mkv.o mkvlib.o \
	listconf.o \
	fake_salts.o \
	win32_memmap.o \
	uaf_encode.o \
	unicode.o \
	unshadow.o \
	unafs.o \
	undrop.o \
	regex.o pp.o \
	c3_fmt.o \
	unique.o putty2john.o gpg2john.o memdbg.o

OCL_OBJS = common-opencl.o opencl_autotune.o

CUDA_OBJS = common-cuda.o cuda_common.o cuda_cryptmd5.o cuda_phpass.o \
	cuda_cryptsha256.o cuda_cryptsha512.o cuda_mscash2.o \
	cuda_rawsha256.o cuda_rawsha224.o cuda_mscash.o \
	cuda_xsha512.o cuda_wpapsk.o cuda_rawsha512.o cuda_pwsafe.o \
	cuda_rawsha224_fmt.o cuda_rawsha256_fmt.o

GENMKVPWD_OBJS = \
	genmkvpwd.o mkvlib.o memory.o miscnl.o path.o memdbg.o

PROJ = ../run/john@EXE_EXT@ ../run/unshadow@EXE_EXT@ ../run/unafs@EXE_EXT@ ../run/unique@EXE_EXT@ ../run/undrop@EXE_EXT@ \
	../run/ssh2john@EXE_EXT@ ../run/rar2john@EXE_EXT@ ../run/zip2john@EXE_EXT@ \
	../run/genmkvpwd@EXE_EXT@ ../run/mkvcalcproba@EXE_EXT@ ../run/calc_stat@EXE_EXT@ \
	../run/tgtsnarf@EXE_EXT@ ../run/racf2john@EXE_EXT@ ../run/hccap2john@EXE_EXT@ \
	../run/pwsafe2john@EXE_EXT@ ../run/raw2dyna@EXE_EXT@ ../run/keepass2john@EXE_EXT@ ../run/pfx2john@EXE_EXT@ \
	../run/keychain2john@EXE_EXT@ ../run/keyring2john@EXE_EXT@ ../run/kwallet2john@EXE_EXT@ \
	../run/dmg2john@EXE_EXT@ ../run/putty2john@EXE_EXT@ ../run/uaf2john@EXE_EXT@ \
	../run/wpapcap2john@EXE_EXT@ \
	../run/gpg2john@EXE_EXT@ ../run/cprepair@EXE_EXT@ ../run/luks2john@EXE_EXT@ ../run/base64conv@EXE_EXT@

WITH_PCAP = @HAVE_PCAP@
ifdef WITH_PCAP
PROJ += ../run/SIPdump@EXE_EXT@ ../run/vncpcap2john@EXE_EXT@
endif

WITH_CUDA = @HAVE_CUDA@
ifdef WITH_CUDA
NVCC = @NVCC@
CCBIN = @NVCC_GCC@
ifdef CCBIN
NVCC_FLAGS += @CPU_BITS@ -ccbin=$(CCBIN)
endif
JOHN_OBJS += $(CUDA_OBJS)
endif

WITH_OPENCL=@CL_LIBS@
ifdef WITH_OPENCL
CFLAGS += -DHAVE_OPENCL @CL_CFLAGS@
CFLAGS_MAIN += -DHAVE_OPENCL @CL_CFLAGS@
JOHN_OBJS += $(OCL_OBJS)
endif

#########################################################
# this is what ./configure && make
# gets you. NOTE, we have to do the link in ./configure.
#   ** DONE $(LN) x86-sse.h arch.h or $(LN) x86-64 arch.h
# for now, in my testing, this is hard coded to x86-32.h
# NOTE, we also need to add extra .o file's some how.
#  ** DONE x86-64.o sse-intrinsics.o for 64 bit
#  ** DONE x86.o x86-sse.o sha1-mmx.o md4-mmx.o md5-mmx.o sse-intrinsics.o  for 32 bit:
#
# for ssexi builds:
# x86-64.o sse-intrinsics-64.o for 64 bit
# x86.o x86-sse.o sha1-mmx.o md4-mmx.o md5-mmx.o sse-intrinsics-32.o  for 32 bit:
#   and add -DUSING_ICC_S_FILE to CFLAGS
#
#  also need to figure out -DUNDERSCORES and add to ASFLAGS
#  also need to figure out -mpreferred-stack-boundary=4 and add (or whatever the stack size is)
#
#########################################################
default:
	$(MAKE) $(PROJ) \
		JOHN_OBJS="$(JOHN_OBJS) @CC_ASM_OBJS@" \
		AESNI_ARCH=@AESNI_ARCH@
ifdef WITH_OPENCL
	$(MKDIR) ../run/kernels/
	$(CP_PRESERVE) opencl/*.cl ../run/kernels/
	$(CP_PRESERVE) opencl_*.h ../run/kernels/
endif
	@echo
	@echo Make process completed.

#########################################################
## This is the 'END' of the main default make target.
#########################################################

# Default build is always using -g (stripped when 'make install') but this
# target turns off optimizations for better debugging, and defines DEBUG
# so code can adopt.
debug:
	$(MAKE) default CFLAGS="-DDEBUG $(CFLAGS) @O_DEBUG@" CFLAGS_MAIN="-DDEBUG $(CFLAGS_MAIN) @O_DEBUG@"

# Similar but just turn memdbg on instead, and normal optimizations.
memdbg:
	$(MAKE) default CFLAGS="-DMEMDBG_ON $(CFLAGS)" CFLAGS_MAIN="-DMEMDBG_ON $(CFLAGS_MAIN)"
memdbg_ex:
	$(MAKE) default CFLAGS="-DMEMDBG_ON -DMEMDBG_EXTRA_CHECKS $(CFLAGS)" CFLAGS_MAIN="-DMEMDBG_ON -DMEMDBG_EXTRA_CHECKS $(CFLAGS_MAIN)"

help:
	@echo "The 'older' fat makefile can be done with make --file=Makefile.legacy [target]"

# 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 digipaq-alpha.o
	$(RM) tmp.s

cuda_common.o:	cuda/cuda_common.cuh cuda/cuda_common.cu
	cd cuda; $(NVCC) $(NVCC_FLAGS) cuda_common.cu -o ../cuda_common.o

cuda_cryptmd5.o:  cuda_cryptmd5.h cuda/cryptmd5.cu cuda_common.o
	cd cuda; $(NVCC) $(NVCC_FLAGS) cryptmd5.cu -o ../cuda_cryptmd5.o

cuda_phpass.o:  cuda_phpass.h cuda/phpass.cu cuda_common.o
	cd cuda; $(NVCC) $(NVCC_FLAGS) phpass.cu -o ../cuda_phpass.o

cuda_cryptsha256.o:  cuda_cryptsha256.h cuda/cryptsha256.cu cuda_common.o cryptsha256_common.h
	cd cuda; $(NVCC) $(NVCC_FLAGS) cryptsha256.cu -o ../cuda_cryptsha256.o

cuda_cryptsha512.o:  cuda_cryptsha512.h cuda/cryptsha512.cu cuda_common.o
	cd cuda; $(NVCC) $(NVCC_FLAGS) cryptsha512.cu -o ../cuda_cryptsha512.o

cuda_mscash2.o:  cuda_mscash2.h cuda/mscash2.cu cuda_common.o
	cd cuda; $(NVCC) $(NVCC_FLAGS) mscash2.cu -o ../cuda_mscash2.o

cuda_mscash.o:  cuda_mscash.h cuda/mscash.cu cuda_common.o
	cd cuda; $(NVCC) $(NVCC_FLAGS) mscash.cu -o ../cuda_mscash.o

cuda_rawsha256.o:  cuda_rawsha256.h cuda/rawsha256.cu cuda_common.o
	cd cuda; $(NVCC) $(NVCC_FLAGS) -DSHA256 rawsha256.cu -o ../cuda_rawsha256.o

cuda_rawsha256_fmt.o: cuda_rawsha256.o cuda_rawsha256_fmt.c
	$(CC)  $(CFLAGS) -DSHA256 cuda_rawsha256_fmt.c -o cuda_rawsha256_fmt.o

cuda_rawsha224.o:  cuda_rawsha256.h cuda/rawsha256.cu cuda_common.o
	cd cuda; $(NVCC) $(NVCC_FLAGS) -DSHA224 rawsha256.cu -o ../cuda_rawsha224.o

cuda_rawsha224_fmt.o: cuda_rawsha224.o cuda_rawsha256_fmt.c
	$(CC)  $(CFLAGS) -DSHA224 cuda_rawsha256_fmt.c -o cuda_rawsha224_fmt.o

cuda_xsha512.o: cuda_xsha512.h cuda/xsha512.cu cuda_common.o
	cd cuda; $(NVCC) $(NVCC_FLAGS) xsha512.cu -o ../cuda_xsha512.o

cuda_wpapsk.o:  cuda_wpapsk.h cuda/wpapsk.cu cuda_common.o
	cd cuda; $(NVCC) $(NVCC_FLAGS) wpapsk.cu -o ../cuda_wpapsk.o

cuda_rawsha512.o: cuda_rawsha512.h cuda/rawsha512.cu cuda_common.o
	cd cuda; $(NVCC) $(NVCC_FLAGS) rawsha512.cu -o ../cuda_rawsha512.o

cuda_pwsafe.o: cuda_pwsafe.h cuda/pwsafe.cu cuda_common.o
	cd cuda; $(NVCC) $(NVCC_FLAGS) pwsafe.cu -o ../cuda_pwsafe.o

@PLUGFORMATS_DEPS@

######## auto-generated, best-effort
AFS_fmt.o:	AFS_fmt.c arch.h misc.h params.h DES_std.h common.h formats.h memdbg.h

BF_common.o:	BF_common.c arch.h misc.h common.h formats.h BF_common.h

BF_fmt.o:	BF_fmt.c arch.h misc.h BF_std.h common.h formats.h memdbg.h

BF_std.o:	BF_std.c arch.h common.h BF_std.h memdbg.h

BSDI_fmt.o:	BSDI_fmt.c arch.h misc.h DES_std.h common.h formats.h DES_bs.h memdbg.h

DES_bs.o:	DES_bs.c arch.h common.h DES_std.h DES_bs.h unicode.h memdbg.h

DES_fmt.o:	DES_fmt.c arch.h DES_std.h common.h formats.h DES_bs.h memdbg.h

DES_std.o:	DES_std.c arch.h common.h DES_std.h memdbg.h misc.h

LM_fmt.o:	LM_fmt.c arch.h misc.h memory.h DES_bs.h common.h formats.h memdbg.h

MD5_fmt.o:	MD5_fmt.c arch.h misc.h sse-intrinsics.h MD5_std.h common.h formats.h memdbg.h

MD5_std.o:	MD5_std.c arch.h common.h MD5_std.h memdbg.h

SIPdump.o:	SIPdump.c autoconfig.h tcphdr.h SIPdump.h memdbg.h

base64.o:	base64.c memdbg.h

base64_convert.o:	base64_convert.c missing_getopt.h memory.h misc.h common.h jumbo.h base64.h base64_convert.h memdbg.h

batch.o:	batch.c params.h os.h signals.h loader.h status.h config.h single.h wordlist.h inc.h memdbg.h

bench.o:	bench.c os.h times.h arch.h misc.h math.h params.h memory.h signals.h formats.h dyna_salt.h bench.h john.h unicode.h config.h common-gpu.h options.h john-mpi.h memdbg.h

best.o:	best.c os.h math.h params.h common.h formats.h bench.h memdbg.h

blowfish.o:	blowfish.c blowfish.h bf_tab.h memory.h johnswap.h memdbg.h

c3_fmt.o:	c3_fmt.c autoconfig.h options.h arch.h misc.h params.h memory.h common.h formats.h loader.h john.h john-mpi.h memdbg.h

calc_stat.o:	calc_stat.c autoconfig.h memory.h memdbg.h

charset.o:	charset.c os.h arch.h misc.h params.h path.h memory.h list.h crc32.h signals.h loader.h external.h charset.h memdbg.h

common-cuda.o:	common-cuda.c cuda_common.h options.h john.h memdbg.h

common-gpu.o:	common-gpu.c autoconfig.h Win32-dlfcn-port.h common-gpu.h john.h memory.h params.h logger.h config.h signals.h memdbg.h

common-opencl.o:	common-opencl.c os.h options.h config.h common-opencl.h dyna_salt.h signals.h recovery.h status.h john.h john-mpi.h memdbg.h

common.o:	common.c arch.h common.h memdbg.h misc.h

compiler.o:	compiler.c arch.h params.h memory.h compiler.h memdbg.h

config.o:	config.c misc.h params.h path.h memory.h config.h john.h logger.h external.h memdbg.h

cprepair.o:	cprepair.c autoconfig.h unicode.h memdbg.h

cracker.o:	cracker.c os.h arch.h misc.h math.h params.h memory.h signals.h idle.h formats.h dyna_salt.h loader.h logger.h status.h recovery.h external.h options.h mask.h unicode.h john.h fake_salts.h john-mpi.h path.h jumbo.h common-gpu.h memdbg.h

crc32.o:	crc32.c memory.h crc32.h memdbg.h

cryptmd5_common.o:	cryptmd5_common.c arch.h misc.h common.h formats.h cryptmd5_common.h

detect.o:	detect.c memdbg.h

dmg2john.o:	dmg2john.c autoconfig.h stdint.h gladman_fileenc.h filevault.h misc.h jumbo.h memdbg.h

dummy.o:	dummy.c common.h formats.h memdbg.h

dyna_salt.o:	dyna_salt.c formats.h memory.h dyna_salt.h memdbg.h

dynamic_big_crypt.o:	dynamic_big_crypt.c arch.h openssl_local_overrides.h misc.h common.h formats.h sha.h sha2.h md5.h md4.h stdint.h gost.h sph_haval.h sph_ripemd.h sph_tiger.h sph_whirlpool.h dynamic.h johnswap.h sse-intrinsics.h dynamic_types.h memdbg.h

dynamic_fmt.o:	dynamic_fmt.c arch.h sse-intrinsics.h misc.h common.h formats.h params.h md5.h md4.h dynamic.h options.h config.h sha.h gost.h memory.h unicode.h johnswap.h pkzip.h aligned.h fake_salts.h dynamic_types.h memdbg.h

dynamic_parser.o:	dynamic_parser.c arch.h misc.h common.h formats.h config.h md5.h options.h john.h unicode.h dynamic.h memdbg.h

dynamic_preloads.o:	dynamic_preloads.c arch.h misc.h common.h formats.h md5.h dynamic.h memdbg.h

dynamic_utils.o:	dynamic_utils.c arch.h misc.h common.h formats.h config.h md5.h dynamic.h memdbg.h

external.o:	external.c misc.h params.h os.h signals.h compiler.h loader.h logger.h status.h recovery.h options.h config.h cracker.h john.h external.h mask.h options.h memdbg.h

fake_salts.o:	fake_salts.c config.h john.h memory.h options.h fake_salts.h memdbg.h

formats.o:	formats.c params.h memory.h formats.h dyna_salt.h misc.h unicode.h options.h loader.h common-opencl.h cuda_common.h memdbg.h

genmkvpwd.o:	genmkvpwd.c autoconfig.h params.h memory.h mkvlib.h memdbg.h

getopt.o:	getopt.c misc.h memory.h list.h getopt.h john.h memdbg.h

gladman_hmac.o:	gladman_hmac.c gladman_hmac.h memdbg.h

gladman_pwd2key.o:	gladman_pwd2key.c gladman_hmac.h memdbg.h

gost.o:	gost.c gost.h memdbg.h

gpg2john.o:	gpg2john.c autoconfig.h arch.h jumbo.h misc.h memdbg.h

haval_helper.o:	haval_helper.c

hccap2john.o:	hccap2john.c autoconfig.h jumbo.h os.h common.h memdbg.h

hmacmd5.o:	hmacmd5.c arch.h common.h md5.h hmacmd5.h memdbg.h

idle.o:	idle.c os.h params.h config.h options.h signals.h bench.h formats.h memdbg.h

inc.o:	inc.c arch.h misc.h params.h path.h memory.h os.h signals.h formats.h loader.h logger.h status.h recovery.h options.h config.h charset.h external.h cracker.h john.h options.h unicode.h mask.h memdbg.h

john-mpi.o:	john-mpi.c autoconfig.h john-mpi.h john.h memory.h memdbg.h

jumbo.o:	jumbo.c jumbo.h params.h memory.h memdbg.h

keepass2john.o:	keepass2john.c autoconfig.h stdint.h missing_getopt.h jumbo.h params.h memory.h memdbg.h

keychain2john.o:	keychain2john.c stdint.h jumbo.h memdbg.h

keyring2john.o:	keyring2john.c stdint.h memory.h jumbo.h memdbg.h

kwallet2john.o:	kwallet2john.c stdint.h jumbo.h memdbg.h

list.o:	list.c memory.h list.h memdbg.h

listconf.o:	listconf.c autoconfig.h arch.h jumbo.h params.h path.h formats.h options.h unicode.h dynamic.h config.h regex.h john_build_rule.h common-opencl.h memdbg.h

loader.o:	loader.c autoconfig.h jumbo.h os.h arch.h misc.h params.h path.h memory.h list.h signals.h formats.h dyna_salt.h loader.h options.h config.h unicode.h dynamic.h fake_salts.h john.h cracker.h config.h logger.h memdbg.h

logger.o:	logger.c os.h arch.h misc.h params.h path.h memory.h status.h options.h config.h options.h unicode.h dynamic.h john-mpi.h cracker.h signals.h memdbg.h

luks2john.o:	luks2john.c autoconfig.h jumbo.h stdint.h johnswap.h params.h memdbg.h

mask.o:	mask.c misc.h logger.h recovery.h os.h signals.h status.h options.h config.h external.h cracker.h john.h mask.h unicode.h encoding_data.h memdbg.h

math.o:	math.c arch.h math.h memdbg.h

md4.o:	md4.c md4.h memdbg.h

md5.o:	md5.c md5.h memdbg.h

md_helper.o:	md_helper.c

memdbg.o:	memdbg.c common.h memdbg.h

memory.o:	memory.c arch.h misc.h memory.h common.h johnswap.h memdbg.h

misc.o:	misc.c os.h logger.h params.h misc.h options.h john-mpi.h memdbg.h

missing_getopt.o:	missing_getopt.c missing_getopt.h

mkv.o:	mkv.c arch.h misc.h params.h path.h memory.h os.h signals.h formats.h loader.h logger.h status.h recovery.h config.h charset.h external.h cracker.h options.h john.h mkv.h mask.h memdbg.h

mkvcalcproba.o:	mkvcalcproba.c autoconfig.h params.h mkvlib.h memory.h jumbo.h memdbg.h

mkvlib.o:	mkvlib.c arch.h misc.h params.h memory.h mkvlib.h path.h memdbg.h

mmap-windows.o:	mmap-windows.c memdbg.h

nonstd.o:	nonstd.c

NT_fmt.o:	NT_fmt.c arch.h misc.h memory.h common.h formats.h options.h unicode.h aligned.h johnswap.h memdbg.h

opencl_autotune.o:	opencl_autotune.c common-opencl.h memdbg.h

options.o:	options.c os.h arch.h misc.h params.h memory.h list.h loader.h logger.h status.h recovery.h options.h bench.h external.h john.h dynamic.h unicode.h fake_salts.h regex.h john-mpi.h common-opencl.h prince.h memdbg.h john_build_rule.h

para-best.o:	para-best.c math.h params.h common.h formats.h bench.h memdbg.h

params.o:	params.c params.h memdbg.h

path.o:	path.c autoconfig.h misc.h params.h memory.h path.h memdbg.h

pfx2john.o:	pfx2john.c jumbo.h common.h arch.h params.h memdbg.h

pkzip.o:	pkzip.c arch.h misc.h common.h memory.h formats.h pkzip.h memdbg.h

putty2john.o:	putty2john.c autoconfig.h memory.h jumbo.h memdbg.h

pwsafe2john.o:	pwsafe2john.c stdint.h jumbo.h memdbg.h

racf2john.o:	racf2john.c autoconfig.h jumbo.h memory.h memdbg.h

rar2john.o:	rar2john.c jumbo.h common.h arch.h params.h crc32.h unicode.h stdint.h jumbo.h base64_convert.h sha2.h rar2john.h missing_getopt.h memdbg.h

raw2dyna.o:	raw2dyna.c autoconfig.h memdbg.h

rc4.o:	rc4.c rc4.h memdbg.h

recovery.o:	recovery.c os.h arch.h misc.h params.h path.h memory.h options.h loader.h logger.h status.h recovery.h john.h mask.h unicode.h john-mpi.h signals.h memdbg.h

regex.o:	regex.c regex.h loader.h logger.h status.h os.h signals.h recovery.h options.h config.h cracker.h john.h external.h memdbg.h

ripemd.o:	ripemd.c sph_ripemd.h memdbg.h md_helper.c md_helper.c md_helper.c md_helper.c md_helper.c

rpp.o:	rpp.c arch.h params.h config.h rpp.h common.h memdbg.h

rules.o:	rules.c arch.h misc.h params.h common.h memory.h formats.h loader.h logger.h rpp.h rules.h options.h john.h unicode.h encoding_data.h memdbg.h

sboxes-s.o:	sboxes-s.c

sboxes.o:	sboxes.c nonstd.c

scrypt_fmt.o:	scrypt_fmt.c escrypt/crypto_scrypt.h arch.h misc.h common.h formats.h base64_convert.h memdbg.h

sha2.o:	sha2.c arch.h sha2.h params.h common.h johnswap.h memdbg.h

signals.o:	signals.c os.h arch.h misc.h params.h tty.h options.h config.h bench.h john.h status.h signals.h john-mpi.h memdbg.h

single.o:	single.c misc.h params.h common.h memory.h os.h signals.h loader.h logger.h status.h recovery.h options.h rpp.h rules.h external.h cracker.h john.h unicode.h config.h memdbg.h

sse-intrinsics.o:	sse-intrinsics.c pseudo_intrinsics.h arch.h memory.h md5.h MD5_std.h stdint.h johnswap.h sse-intrinsics-load-flags.h aligned.h memdbg.h

ssh2john.o:	ssh2john.c jumbo.h common.h arch.h params.h memdbg.h

status.o:	status.c os.h times.h arch.h misc.h math.h params.h cracker.h options.h status.h bench.h config.h unicode.h signals.h mask.h john-mpi.h common-gpu.h memdbg.h

symlink.o:	symlink.c

tgtsnarf.o:	tgtsnarf.c autoconfig.h memory.h memdbg.h

timer.o:	timer.c timer.h memdbg.h

trip_fmt.o:	trip_fmt.c arch.h DES_std.h common.h formats.h DES_bs.h memdbg.h

tty.o:	tty.c arch.h tty.h memdbg.h

uaf2john.o:	uaf2john.c uaf_encode.h uaf_raw.h memdbg.h

uaf_encode.o:	uaf_encode.c arch.h uaf_raw.h uaf_encode.h memdbg.h uaf_hash.c

uaf_hash.o:	uaf_hash.c uaf_encode.c memdbg.h

unafs.o:	unafs.c misc.h memdbg.h

undrop.o:	undrop.c os.h memdbg.h

unicode.o:	unicode.c common.h arch.h byteorder.h unicode.h UnicodeData.h encoding_data.h misc.h config.h md4.h john.h memdbg.h

unique.o:	unique.c autoconfig.h arch.h misc.h params.h memory.h jumbo.h memdbg.h

unrar.o:	unrar.c arch.h unrar.h unrarppm.h unrarvm.h unrarfilter.h memdbg.h

unrarcmd.o:	unrarcmd.c unrar.h unrarcmd.h memdbg.h

unrarfilter.o:	unrarfilter.c arch.h unrar.h unrarfilter.h memdbg.h

unrarhlp.o:	unrarhlp.c unrarhlp.h memdbg.h

unrarvm.o:	unrarvm.c arch.h unrar.h unrarvm.h unrarcmd.h memdbg.h

unshadow.o:	unshadow.c misc.h params.h memory.h memdbg.h

vncpcap2john.o:	vncpcap2john.c autoconfig.h cygwin/ethernet.h tcphdr.h memdbg.h

win32_memmap.o:	win32_memmap.c os.h win32_memmap.h memdbg.h

wordlist.o:	wordlist.c autoconfig.h os.h win32_memmap.h mmap-windows.c arch.h jumbo.h misc.h math.h params.h common.h path.h signals.h loader.h logger.h status.h recovery.h options.h rpp.h rules.h external.h cracker.h john.h memory.h unicode.h regex.h mask.h memdbg.h

pp.o:	pp.c prince.h mpz_int128.h autoconfig.h os.h arch.h jumbo.h misc.h math.h params.h common.h path.h signals.h loader.h logger.h status.h recovery.h options.h external.h cracker.h john.h memory.h unicode.h memdbg.h
	$(CC) $(CFLAGS) $(OPT_NORMAL) -DJTR_MODE -Wno-declaration-after-statement -std=c99 -c pp.c

wpapcap2john.o:	wpapcap2john.c wpapcap2john.h memdbg.h

zip2john.o:	zip2john.c common.h jumbo.h formats.h stdint.h pkzip.h missing_getopt.h memdbg.h

########

SUBDIRS = aes

.PHONY: subdirs $(SUBDIRS)

subdirs: $(SUBDIRS)

$(SUBDIRS):
	$(MAKE) -C $@ all

# Inlining the S-boxes produces faster code as long as they fit in the cache.
DES_bs_b.o: DES_bs_b.c sboxes.c nonstd.c sboxes-s.c
	$(CC) $(CFLAGS) $(OPT_INLINE) DES_bs_b.c

miscnl.o: misc.c
	$(CC) $(CFLAGS) $(OPT_NORMAL) -D_JOHN_MISC_NO_LOG misc.c -o miscnl.o

aes/aes.a:
	$(MAKE) -C aes all

###############################################################################
#  Process targets.  Note, these are *nix targets, but also work fine under
#  cygwin.  The only problem with cygwin, is that the ln -s will NOT generate
#  a valid exe which can be run under native Win32 cmd shell
#  If a use wants that behavior, then run configure, with --enable-ln-s
#  By default, it is set to cygwin will use the .EXE symlink.c building,
#  where the macro EXE_EXT is .exe.  Mingw builds always set EXE_EXT to .exe
###############################################################################

# PTHREAD_CFLAGS and OPENMP_CFLAGS may actually contain linker options,
# like -fopenmp
../run/john@EXE_EXT@: $(JOHN_OBJS) aes/aes.a
	$(LD) $(JOHN_OBJS) $(LDFLAGS) @OPENSSL_LIBS@ @COMMONCRYPTO_LIBS@ @OPENMP_CFLAGS@ @GMP_LIBS@ @SKEY_LIBS@ @REXGEN_LIBS@ @CUDA_LIBS@ @CL_LIBS@ @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ @M_LIBS@ @Z_LIBS@ @DL_LIBS@ @CRYPT_LIBS@ @BZ2_LIBS@ aes/aes.a -o ../run/john

../run/unshadow: ../run/john
	$(RM) ../run/unshadow
	$(LN) john ../run/unshadow

../run/unafs: ../run/john
	$(RM) ../run/unafs
	$(LN) john ../run/unafs

../run/undrop: ../run/john
	$(RM) ../run/undrop
	$(LN) john ../run/undrop

../run/ssh2john: ../run/john
	$(RM) ../run/ssh2john
	$(LN) john ../run/ssh2john

../run/putty2john: ../run/john
	$(RM) ../run/putty2john
	$(LN) john ../run/putty2john

../run/pfx2john: ../run/john
	$(RM) ../run/pfx2john
	$(LN) john ../run/pfx2john

../run/keepass2john: ../run/john
	$(RM) ../run/keepass2john
	$(LN) john ../run/keepass2john

../run/keyring2john: ../run/john
	$(RM) ../run/keyring2john
	$(LN) john ../run/keyring2john

../run/zip2john: ../run/john
	$(RM) ../run/zip2john
	$(LN) john ../run/zip2john

../run/gpg2john: ../run/john
	$(RM) ../run/gpg2john
	$(LN) john ../run/gpg2john

../run/rar2john: ../run/john
	$(RM) ../run/rar2john
	$(LN) john ../run/rar2john

../run/racf2john: ../run/john
	$(RM) ../run/racf2john
	$(LN) john ../run/racf2john

../run/keychain2john: ../run/john
	$(RM) ../run/keychain2john
	$(LN) john ../run/keychain2john

../run/kwallet2john: ../run/john
	$(RM) ../run/kwallet2john
	$(LN) john ../run/kwallet2john

../run/pwsafe2john: ../run/john
	$(RM) ../run/pwsafe2john
	$(LN) john ../run/pwsafe2john

../run/dmg2john: ../run/john
	$(RM) ../run/dmg2john
	$(LN) john ../run/dmg2john

../run/hccap2john: ../run/john
	$(RM) ../run/hccap2john
	$(LN) john ../run/hccap2john

../run/base64conv: ../run/john
	$(RM) ../run/base64conv
	$(LN) john ../run/base64conv

../run/unique: ../run/john
	$(RM) ../run/unique
	$(LN) john ../run/unique

#####################################################################
# These targets MUST match ALL of the john targets that use ln -s
# These are built for Win32, so that we have a 'native' symlink back
# to the john exe.  The john exe is still built fat, but there is no
# workable ln -s, so we have built a 'symlink.c' file. It works in
# a limited way, like symlink. Mingw and default cygwin use these.
# cygwin can override this within ./configure using --enable-ln-s
#####################################################################
../run/unshadow.exe: symlink.c
	$(CC) symlink.c -o ../run/unshadow.exe
	$(STRIP) ../run/unshadow.exe

../run/unafs.exe: symlink.c
	$(CC) symlink.c -o ../run/unafs.exe
	$(STRIP) ../run/unafs.exe

../run/undrop.exe: symlink.c
	$(CC) symlink.c -o ../run/undrop.exe
	$(STRIP) ../run/undrop.exe

../run/ssh2john.exe: symlink.c
	$(CC) symlink.c -o ../run/ssh2john.exe
	$(STRIP) ../run/ssh2john.exe

../run/putty2john.exe: symlink.c
	$(CC) symlink.c -o ../run/putty2john.exe
	$(STRIP) ../run/putty2john.exe

../run/pfx2john.exe: symlink.c
	$(CC) symlink.c -o ../run/pfx2john.exe
	$(STRIP) ../run/pfx2john.exe

../run/keepass2john.exe: symlink.c
	$(CC) symlink.c -o ../run/keepass2john.exe
	$(STRIP) ../run/keepass2john.exe

../run/keyring2john.exe: symlink.c
	$(CC) symlink.c -o ../run/keyring2john.exe
	$(STRIP) ../run/keyring2john.exe

../run/zip2john.exe: symlink.c
	$(CC) symlink.c -o ../run/zip2john.exe
	$(STRIP) ../run/zip2john.exe

../run/gpg2john.exe: symlink.c
	$(CC) symlink.c -o ../run/gpg2john.exe
	$(STRIP) ../run/gpg2john.exe

../run/rar2john.exe: symlink.c
	$(CC) symlink.c -o ../run/rar2john.exe
	$(STRIP) ../run/rar2john.exe

../run/racf2john.exe: symlink.c
	$(CC) symlink.c -o ../run/racf2john.exe
	$(STRIP) ../run/racf2john.exe

../run/keychain2john.exe: symlink.c
	$(CC) symlink.c -o ../run/keychain2john.exe
	$(STRIP) ../run/keychain2john.exe

../run/kwallet2john.exe: symlink.c
	$(CC) symlink.c -o ../run/kwallet2john.exe
	$(STRIP) ../run/kwallet2john.exe

../run/pwsafe2john.exe: symlink.c
	$(CC) symlink.c -o ../run/pwsafe2john.exe
	$(STRIP) ../run/pwsafe2john.exe

../run/dmg2john.exe: symlink.c
	$(CC) symlink.c -o ../run/dmg2john.exe
	$(STRIP) ../run/dmg2john.exe

../run/hccap2john.exe: symlink.c
	$(CC) symlink.c -o ../run/hccap2john.exe
	$(STRIP) ../run/hccap2john.exe

../run/base64conv.exe: symlink.c
	$(CC) symlink.c -o ../run/base64conv.exe
	$(STRIP) ../run/base64conv.exe

../run/unique.exe: symlink.c
	$(CC) symlink.c -o ../run/unique.exe
	$(STRIP) ../run/unique.exe

########################################################
# Not linked to symlink for a .exe file, so simply make
# single targets, using the EXE_EXT macro
########################################################
../run/genmkvpwd@EXE_EXT@: $(GENMKVPWD_OBJS)
	$(LD) $(GENMKVPWD_OBJS) $(LDFLAGS) @M_LIBS@ @OPENMP_CFLAGS@ -o ../run/genmkvpwd

../run/mkvcalcproba@EXE_EXT@: mkvcalcproba.o
	$(LD) mkvcalcproba.o @MEMDBG_CFLAGS@ memdbg.o $(LDFLAGS) @M_LIBS@ @OPENMP_CFLAGS@ -o ../run/mkvcalcproba

../run/calc_stat@EXE_EXT@: calc_stat.o
	$(LD) calc_stat.o @MEMDBG_CFLAGS@ memdbg.o $(LDFLAGS) @M_LIBS@ @OPENMP_CFLAGS@ -o ../run/calc_stat

../run/raw2dyna@EXE_EXT@: raw2dyna.o
	$(LD) raw2dyna.o @MEMDBG_CFLAGS@ memdbg.o $(LDFLAGS) @OPENMP_CFLAGS@ -o ../run/raw2dyna

../run/SIPdump@EXE_EXT@: SIPdump.o
	$(LD) SIPdump.o @MEMDBG_CFLAGS@ memdbg.o $(LDFLAGS) @PCAP_LIBS@ @OPENMP_CFLAGS@ -o ../run/SIPdump

../run/vncpcap2john@EXE_EXT@: vncpcap2john.o
	$(CC) -DAC_BUILT -Wall vncpcap2john.o @MEMDBG_CFLAGS@ memdbg.o $(LDFLAGS) @PCAP_LIBS@ @OPENMP_CFLAGS@ -o ../run/vncpcap2john

../run/uaf2john@EXE_EXT@: uaf2john.o uaf_encode.o
	$(LD) $(LDFLAGS) @PTHREAD_CFLAGS@ @PTHREAD_LIBS@ uaf2john.o uaf_encode.o @MEMDBG_CFLAGS@ memdbg.o @OPENMP_CFLAGS@ -o ../run/uaf2john

# Note that this is NOT depending on PCAP lib. It is self-contained.
../run/wpapcap2john@EXE_EXT@: wpapcap2john.o
	$(LD) $(LDFLAGS) wpapcap2john.o @MEMDBG_CFLAGS@ memdbg.o @OPENMP_CFLAGS@ -o ../run/wpapcap2john

../run/luks2john@EXE_EXT@: luks2john.o
	$(LD) $(LDFLAGS) luks2john.o @OPENSSL_LIBS@ @OPENMP_CFLAGS@ -o ../run/luks2john

../run/cprepair@EXE_EXT@: cprepair.c unicode.c unicode.h options.h misc.h misc.c \
	memdbg.h memdbg.c
	$(CC) -DAC_BUILT -Wall -O3 @CFLAGS_EXTRA@ @OPENSSL_CFLAGS@ -DNOT_JOHN -D_JOHN_MISC_NO_LOG cprepair.c unicode.c \
	misc.c memdbg.c -o ../run/cprepair

../run/tgtsnarf@EXE_EXT@: tgtsnarf.o
	$(LD) tgtsnarf.o @MEMDBG_CFLAGS@ memdbg.o $(LDFLAGS) @OPENMP_CFLAGS@ -o ../run/tgtsnarf

john.o: john.c autoconfig.h os.h params.h arch.h openssl_local_overrides.h \
	misc.h path.h memory.h list.h tty.h signals.h common.h idle.h \
	formats.h dyna_salt.h loader.h logger.h status.h recovery.h options.h \
	config.h bench.h charset.h single.h wordlist.h inc.h mask.h mkv.h \
	external.h batch.h dynamic.h fake_salts.h listconf.h john-mpi.h \
	regex.h unicode.h common-opencl.h cuda_common.h prince.h \
	john_build_rule.h memdbg.h fmt_externs.h fmt_registers.h
	$(CC) $(CFLAGS_MAIN) $(OPT_NORMAL) -O0 $*.c

# Workaround for gcc 3.4.6 (seen on Sparc32) (do not use -funroll-loops)
unrarppm.o: unrarppm.c
	$(CC) -DAC_BUILT $(CFLAGS) $< -o $@

.c.o:
	$(CC) $(CFLAGS) $(OPT_NORMAL) $< -o $@

.S.o:
	$(AS) $(ASFLAGS) $*.S

check: default
	../run/john --test=0 --verbosity=2

depend:
	makedepend -fMakefile.dep -Y *.c 2>> /dev/null

test: default
	cd ../test && perl jtrts.pl -q

test_full: default
	cd ../test && perl jtrts.pl -q -type full

test_utf8: default
	cd ../test && perl jtrts.pl -q -type utf-8

test_verbose: default
	cd ../test && perl jtrts.pl

test_full_verbose: default
	cd ../test && perl jtrts.pl -type full

test_utf8_verbose: default
	cd ../test && perl jtrts.pl -type utf-8

bash-completion:
	[ -d /etc/bash_completion.d ] && $(CP) ../run/john.bash_completion /etc/bash_completion.d/ || true
	[ -d /usr/local/etc/bash_completion.d ] && $(CP) ../run/john.bash_completion /usr/local/etc/bash_completion.d/ || true
	[ -d /opt/local/etc/bash_completion.d ] && $(CP) ../run/john.bash_completion /opt/local/etc/bash_completion.d/ || true
	@echo Bash-completion for JtR opportunistically installed.
	@echo Source \". ../run/john.bash_completion\" or logout/login to activate the changes

zsh-completion:
	[ -d /usr/share/zsh/functions/Completion/Unix ] && $(CP) ../run/john.zsh_completion /usr/share/zsh/functions/Completion/Unix/_john || true
	[ -d /usr/share/zsh/site-functions ] && $(CP) ../run/john.zsh_completion /usr/share/zsh/site-functions/_john || true
	[ -d /usr/local/share/zsh/site-functions ] && $(CP) ../run/john.zsh_completion /usr/local/share/zsh/site-functions/_john || true
	@echo zsh-completion for JtR opportunistically installed.
	@echo Source \". ../run/john.zsh_completion\" or logout/login to activate the changes

shell-completion: bash-completion zsh-completion

clean:
	$(RM) $(PROJ)
	@for exe in ${PROJ}; do \
	  ($(RM) $$exe.exe) \
	done
	$(RM) john-macosx-* *.o escrypt/*.o *.bak core
	$(RM) ../run/kernels/*.cl ../run/kernels/*.h ../run/kernels/*.bin
	$(RM) detect bench para-bench generic.h tmp.s
	$(RM) cuda/*.o cuda/*~ *~
	$(CP) $(NULL) Makefile.dep
	@for dir in ${subdirs}; do \
	  (cd $$dir && $(MAKE) clean) \
	  || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
	done && test -z "$$fail"

# These are mostly for internal use.
charsets: ../run/ascii.chr ../run/alpha.chr ../run/lowernum.chr ../run/uppernum.chr ../run/lowerspace.chr ../run/lower.chr ../run/upper.chr ../run/digits.chr ../run/alnum.chr ../run/lanman.chr ../run/lm_ascii.chr ../run/alnumspace.chr ../run/latin1.chr ../run/utf8.chr

../run/ascii.chr: charset.c params.h
	../run/john -make-charset=../run/ascii.chr -pot:rockyou.ansi.pot -ext:filter_ascii

../run/alpha.chr: charset.c params.h
	../run/john -make-charset=../run/alpha.chr -pot:rockyou.ansi.pot -ext:filter_alpha

../run/lowernum.chr: charset.c params.h
	../run/john -make-charset=../run/lowernum.chr -pot:rockyou.ansi.pot -ext:filter_lowernum

../run/uppernum.chr: charset.c params.h
	../run/john -make-charset=../run/uppernum.chr -pot:rockyou.ansi.pot -ext:filter_uppernum

../run/lowerspace.chr: charset.c params.h
	../run/john -make-charset=../run/lowerspace.chr -pot:rockyou.ansi.pot -ext:filter_lowerspace

../run/lower.chr: charset.c params.h
	../run/john -make-charset=../run/lower.chr -pot:rockyou.ansi.pot -ext:filter_lower

../run/upper.chr: charset.c params.h
	../run/john -make-charset=../run/upper.chr -pot:rockyou.ansi.pot -ext:filter_upper

../run/digits.chr: charset.c params.h
	../run/john -make-charset=../run/digits.chr -pot:rockyou.ansi.pot -ext:filter_digits

../run/alnum.chr: charset.c params.h
	../run/john -make-charset=../run/alnum.chr -pot:rockyou.ansi.pot -ext:filter_alnum

../run/lanman.chr: charset.c params.h
	../run/john -make-charset=../run/lanman.chr -pot:rockyou.lm850.pot -ext:filter_lanman

../run/lm_ascii.chr: charset.c params.h
	../run/john -make-charset=../run/lm_ascii.chr -pot:rockyou.lm850.pot -ext:filter_lm_ascii

../run/alnumspace.chr: charset.c params.h
	../run/john -make-charset=../run/alnumspace.chr -pot:rockyou.ansi.pot -ext:filter_alnumspace

../run/latin1.chr: charset.c params.h
	../run/john -make-charset=../run/latin1.chr -pot:rockyou.ansi.16.pot

../run/utf8.chr: charset.c params.h
	../run/john -make-charset=../run/utf8.chr -pot:rockyou.utf8.24.pot


# For the time being, icc builds a better sse-intrinsics.S but this may
# change over time. NOTE that sse-intrinsics.S is never re-built unless you
# manually do a "make intrinsics".
intrinsics: clean-intrinsics sse-intrinsics-64.S sse-intrinsics-32.S

clean-intrinsics:
	$(RM) sse-intrinsics-64.S sse-intrinsics-32.S sse-intrinsics-win32.S

sse-intrinsics-64.S:
	$(LN) -f x86-64.h arch.h
	icc -S -o sse-intrinsics-64.S sse-intrinsics.c -O2 -fno-builtin -fno-verbose-asm -openmp -DUSING_ICC_S_FILE -Wall

sse-intrinsics-32.S:
	$(LN) -f x86-sse.h arch.h
	icc -m32 -S -o sse-intrinsics-32.S sse-intrinsics.c -O2 -fno-builtin -fno-verbose-asm -openmp -DUSING_ICC_S_FILE -Wall
	perl sse2i_winfix.pl sse-intrinsics-32.S sse-intrinsics-win32.S
	mv sse-intrinsics-win32.S sse-intrinsics-32.S

#######################################################################
## NOTE, auto re-building configure will ONLY happen IF the user has ##
## CONFIG_MAINT=1 environment variable.  Beware.                     ##
#######################################################################

M4_INCLUDES=@M4_INCLUDES@

## automatic re-running of configure if the configure.ac file has changed
ifeq ($(CONFIG_MAINT), 1)
configure: configure.ac
	autoconf
else
configure: configure.ac
	@touch configure
endif

# autoheader might not change autoconfig.h.in, so touch a stamp file
ifeq ($(CONFIG_MAINT), 1)
autoconfig.h.in: autoconfig-stamp-h-in
autoconfig-stamp-h-in: configure.ac $(M4_INCLUDES)
	autoheader
	echo "timestamp from Makefile" > autoconfig-stamp-h-in
else
autoconfig.h.in: autoconfig-stamp-h-in
autoconfig-stamp-h-in: configure.ac $(M4_INCLUDES)
	echo "timestamp from Makefile" > autoconfig-stamp-h-in
endif

ifeq ($(CONFIG_MAINT), 1)
autoconfig.h: autoconfig-stamp-h
autoconfig-stamp-h: autoconfig.h.in config.status
	./config.status
else
autoconfig.h: autoconfig-stamp-h
autoconfig-stamp-h: autoconfig.h.in config.status
	@touch config.status
	@touch autoconfig.h.in
	@touch autoconfig-stamp-h
	@touch autoconfig.h
endif

ifeq ($(CONFIG_MAINT), 1)
Makefile: Makefile.in config.status
	./config.status
endif

ifeq ($(CONFIG_MAINT), 1)
config.status: configure
	./config.status --recheck
endif

all:
	@for dir in ${subdirs}; do \
	  (cd $$dir && $(MAKE) all) \
	  || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
	done && test -z "$$fail"

distclean: clean
	$(RM) -rf autom4te.cache
	@for dir in ${subdirs}; do \
	  (cd $$dir && $(MAKE) distclean) \
	  || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \
	done && test -z "$$fail"
	$(RM) -f Makefile autoconfig.h config.status config.cache \
		config.log autoconfig-stamp-h autoconfig-stamp-h-in stamp-h1
	$(LN) Makefile.stub Makefile
	$(RM) arch.h
	$(RM) fmt_registers.h fmt_externs.h john_build_rule.h

install: default shell-completion
	@echo Stripping executables.
	$(STRIP) $(PROJ)
#ifneq ($(prefix), ../run)
#	@echo Copying binaries to $(prefix)
#	$(MKDIR) $(prefix)
#	$(CP) -p -P -R ../run/*.{py,pl,rb} $(PROJ) $(prefix)
#	@echo Copying data and config files to $(prefix)
#	$(MKDIR) $(prefix)
#	$(CP) -p -P -R ../run/*.{chr,conf,lst} $(prefix)
#ifdef WITH_OPENCL
#	$(CP) -p -P -R ../run/kernels $(prefix)
#endif
#endif

include Makefile.dep
