Skip to content

Commit dd58e86

Browse files
committed
Makefile: Autodependency tweaks
Drop more old fixed dependencies. Most of these were added 10 years ago and generated by the naive perl script so not great even then. Add a few dependencies for $(DEPDIR) so we can build particular stuff from a distclean source directory (i.e. with .deps directory missing). An example - that a buildbot found - is "make unit-tests". Also merely moves the symlink recipe for rar2john a little bit just for easier side to side compare with Makefile.legacy.
1 parent 42bb228 commit dd58e86

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/Makefile.in

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -226,10 +226,10 @@ digipaq-alpha.o: alpha.S
226226
$(AS) $(ASFLAGS) tmp.s -o digipaq-alpha.o
227227
$(RM) tmp.s
228228

229-
princeprocessor:
229+
princeprocessor: | $(DEPDIR)
230230
$(CC) @DEPFLAGS@ @CFLAGS@ @JOHN_NO_SIMD@ @CFLAGS_EXTRA@ @OPENSSL_CFLAGS@ @OPENMP_CFLAGS@ @HAVE_MPI@ @PTHREAD_CFLAGS@ $(CPPFLAGS) $(OPT_NORMAL) -DLINUX pp.c $(LDFLAGS) -o ../run/pp
231231

232-
pp.o: pp.c autoconfig.h arch.h mem_map.h os.h os-autoconf.h jumbo.h mmap-windows.c memory.h mpz_int128.h int128.h misc.h config.h params.h common.h path.h signals.h loader.h list.h formats.h logger.h status.h recovery.h options.h getopt.h external.h compiler.h cracker.h john.h unicode.h prince.h rpp.h rules.h mask.h
232+
pp.o: pp.c prince.h | $(DEPDIR)
233233
$(CC) $(CFLAGS) $(OPT_NORMAL) -DJTR_MODE -c pp.c
234234

235235
options.o: options.c options.h version.h
@@ -267,10 +267,10 @@ $(SUBDIRS):
267267
$(MAKE) -C $@ all
268268

269269
# Inlining the S-boxes produces faster code as long as they fit in the cache.
270-
DES_bs_b.o: DES_bs_b.c arch.h common.h memory.h DES_bs.h loader.h params.h list.h formats.h misc.h jumbo.h autoconfig.h os.h os-autoconf.h sboxes.c nonstd.c sboxes-s.c sboxes-t.c
270+
DES_bs_b.o: DES_bs_b.c sboxes.c nonstd.c sboxes-s.c sboxes-t.c | $(DEPDIR)
271271
$(CC) $(CFLAGS) $(OPT_INLINE) DES_bs_b.c
272272

273-
miscnl.o: misc.c
273+
miscnl.o: misc.c | $(DEPDIR)
274274
$(CC) $(CFLAGS) $(OPT_NORMAL) -D_JOHN_MISC_NO_LOG misc.c -o miscnl.o
275275

276276
mbedtls/aes.a:
@@ -352,6 +352,10 @@ poly1305-donna/poly1305-donna.a:
352352
$(CC) symlink.c -o ../run/undrop.exe
353353
$(STRIP) ../run/undrop.exe
354354

355+
../run/rar2john.exe: symlink.c
356+
$(CC) symlink.c -o ../run/rar2john.exe
357+
$(STRIP) ../run/rar2john.exe
358+
355359
../run/zip2john.exe: symlink.c
356360
$(CC) symlink.c -o ../run/zip2john.exe
357361
$(STRIP) ../run/zip2john.exe
@@ -360,10 +364,6 @@ poly1305-donna/poly1305-donna.a:
360364
$(CC) symlink.c -o ../run/gpg2john.exe
361365
$(STRIP) ../run/gpg2john.exe
362366

363-
../run/rar2john.exe: symlink.c
364-
$(CC) symlink.c -o ../run/rar2john.exe
365-
$(STRIP) ../run/rar2john.exe
366-
367367
../run/base64conv.exe: symlink.c
368368
$(CC) symlink.c -o ../run/base64conv.exe
369369
$(STRIP) ../run/base64conv.exe
@@ -426,20 +426,20 @@ poly1305-donna/poly1305-donna.a:
426426
../run/dynacomptest@EXE_EXT@: dynamic_compiler.c dynamic_compiler_lib.c dynamic_utils.c misc.c unicode.c base64_convert.o base64.o common.o crc32.o KeccakDuplex.o KeccakF-1600-opt64.o KeccakHash.o KeccakSponge.o gost.o jumbo.o memory.o ripemd.o tiger.o haval.o skein.o md2.o panama.o whirlpool.o sha1.o sha2.o
427427
$(CC) -DAC_BUILT -Wall -O2 @CPPFLAGS@ @DEPFLAGS@ @CFLAGS@ @CFLAGS_EXTRA@ @OPENSSL_CFLAGS@ @OPENMP_CFLAGS@ -DWITH_MAIN -D_JOHN_MISC_NO_LOG -DUNICODE_NO_OPTIONS dynamic_compiler.c dynamic_compiler_lib.c dynamic_utils.c misc.c unicode.c base64_convert.o base64.o common.o crc32.o KeccakDuplex.o KeccakF-1600-opt64.o KeccakHash.o KeccakSponge.o gost.o jumbo.o memory.o ripemd.o tiger.o haval.o skein.o md2.o panama.o whirlpool.o sha1.o sha2.o $(LDFLAGS) @OPENSSL_LIBS@ -o $@
428428

429-
../run/cprepair@EXE_EXT@: cprepair.c autoconfig.h unicode.c unicode.h options.h misc.h misc.c
429+
../run/cprepair@EXE_EXT@: cprepair.c unicode.c misc.c | $(DEPDIR)
430430
$(CC) -DAC_BUILT -Wall -O3 @CFLAGS_EXTRA@ @OPENSSL_CFLAGS@ -DNOT_JOHN -D_JOHN_MISC_NO_LOG $(CPPFLAGS) cprepair.c unicode.c misc.c memory.c -o $@
431431

432432
../run/tgtsnarf@EXE_EXT@: tgtsnarf.o
433433
$(LD) tgtsnarf.o $(LDFLAGS) @OPENMP_CFLAGS@ -o $@
434434

435-
john.o: john.c john.h fmt_externs.h fmt_registers.h
435+
john.o: john.c john.h fmt_externs.h fmt_registers.h | $(DEPDIR)
436436
$(CC) $(CFLAGS_MAIN) $(OPT_NORMAL) -O1 $*.c
437437

438-
path.o: path.c path.h autoconfig.h arch.h params.h misc.h memory.h
438+
path.o: path.c path.h arch.h params.h misc.h memory.h | $(DEPDIR)
439439
$(CC) $(CFLAGS_MAIN) $(OPT_NORMAL) -O1 $*.c
440440

441441
# Workaround for gcc 3.4.6 (seen on Sparc32) (do not use -funroll-loops)
442-
unrarppm.o: unrarppm.c arch.h aes.h autoconfig.h unrar.h unrarhlp.h memory.h jumbo.h unrarppm.h unrarvm.h unrarcmd.h unrarfilter.h common.h os.h os-autoconf.h
442+
unrarppm.o: unrarppm.c | $(DEPDIR)
443443
$(CC) -DAC_BUILT $(CFLAGS) $< -o $@
444444

445445
AUTODEP=@DEPFLAGS@
@@ -525,28 +525,28 @@ UNIT_TEST_OBJS = \
525525
UNIT_TEST_INCLUDED_PIECES = \
526526
tests/test_valid_utf8.c
527527

528-
tests/unit-tests.o: tests/unit-tests.c common.h memory.h misc.h
528+
tests/unit-tests.o: tests/unit-tests.c | $(DEPDIR)
529529
$(CC) -o tests/unit-tests.o $(CFLAGS) -DFORCE_GENERIC_SHA2 -D_JOHN_MISC_NO_LOG tests/unit-tests.c
530530

531-
tests/sha2.o: sha2.c arch.h sha2.h aligned.h openssl_local_overrides.h md4.h md5.h jtr_sha2.h johnswap.h common.h memory.h stdbool.h params.h os.h os-autoconf.h autoconfig.h jumbo.h
531+
tests/sha2.o: sha2.c | $(DEPDIR)
532532
$(CC) -o tests/sha2.o $(CFLAGS) -DFORCE_GENERIC_SHA2 -D_JOHN_MISC_NO_LOG sha2.c
533533

534-
tests/misc.o: misc.c os.h os-autoconf.h autoconfig.h jumbo.h arch.h logger.h params.h misc.h options.h list.h loader.h formats.h getopt.h common.h memory.h john_mpi.h
534+
tests/misc.o: misc.c misc.h | $(DEPDIR)
535535
$(CC) -o tests/misc.o $(CFLAGS) -D_JOHN_MISC_NO_LOG misc.c
536536

537-
tests/common.o: common.c arch.h common.h memory.h os.h os-autoconf.h autoconfig.h jumbo.h misc.h base64_convert.h
537+
tests/common.o: common.c common.h | $(DEPDIR)
538538
$(CC) -o tests/common.o $(CFLAGS) -D_JOHN_MISC_NO_LOG common.c
539539

540-
tests/memory.o: memory.c arch.h misc.h jumbo.h autoconfig.h memory.h common.h johnswap.h os.h os-autoconf.h
540+
tests/memory.o: memory.c memory.h | $(DEPDIR)
541541
$(CC) -o tests/memory.o $(CFLAGS) -D_JOHN_MISC_NO_LOG memory.c
542542

543-
tests/unicode.o: unicode.o # just to have all the same deps
543+
tests/unicode.o: unicode.o | $(DEPDIR)
544544
$(CC) -o tests/unicode.o $(CFLAGS) -DUNICODE_NO_OPTIONS -DNOT_JOHN unicode.c
545545

546546
# keep the 'easy name' build target of unit-tests The 'real' target is ../run/unit-tests[.exe]
547-
unit-tests: ../run/unit-tests@EXE_EXT@
547+
unit-tests: ../run/unit-tests@EXE_EXT@
548548

549-
../run/unit-tests@EXE_EXT@: $(UNIT_TEST_OBJS) $(UNIT_TEST_INCLUDED_PIECES)
549+
../run/unit-tests@EXE_EXT@: $(UNIT_TEST_OBJS) $(UNIT_TEST_INCLUDED_PIECES)
550550
$(LD) $(UNIT_TEST_OBJS) $(LDFLAGS) @OPENSSL_LIBS@ -o $@
551551
@ echo "Now Running the Unit Tests"
552552
@ ${POSSIBLE_WINE_MSG}

0 commit comments

Comments
 (0)