Makefile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #
  2. # Written and revised by Solar Designer <solar at openwall.com> in 2000-2011.
  3. # No copyright is claimed, and the software is hereby placed in the public
  4. # domain. In case this attempt to disclaim copyright and place the software
  5. # in the public domain is deemed null and void, then the software is
  6. # Copyright (c) 2000-2011 Solar Designer and it is hereby released to the
  7. # general public under the following terms:
  8. #
  9. # Redistribution and use in source and binary forms, with or without
  10. # modification, are permitted.
  11. #
  12. # There's ABSOLUTELY NO WARRANTY, express or implied.
  13. #
  14. # See crypt_blowfish.c for more information.
  15. #
  16. CC = gcc
  17. AS = $(CC)
  18. LD = $(CC)
  19. RM = rm -f
  20. CFLAGS = -W -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Wmissing-prototypes -Wstrict-prototypes -Wshadow -Wundef -Wpointer-arith -O2 -fomit-frame-pointer -funroll-loops
  21. ASFLAGS = -c
  22. LDFLAGS = -s
  23. BLOWFISH_OBJS = \
  24. crypt_blowfish.o x86.o
  25. CRYPT_OBJS = \
  26. $(BLOWFISH_OBJS) crypt_gensalt.o wrapper.o
  27. TEST_OBJS = \
  28. $(BLOWFISH_OBJS) crypt_gensalt.o crypt_test.o
  29. TEST_THREADS_OBJS = \
  30. $(BLOWFISH_OBJS) crypt_gensalt.o crypt_test_threads.o
  31. EXTRA_MANS = \
  32. crypt_r.3 crypt_rn.3 crypt_ra.3 \
  33. crypt_gensalt.3 crypt_gensalt_rn.3 crypt_gensalt_ra.3
  34. all: $(CRYPT_OBJS) man
  35. check: crypt_test
  36. ./crypt_test
  37. crypt_test: $(TEST_OBJS)
  38. $(LD) $(LDFLAGS) $(TEST_OBJS) -o $@
  39. crypt_test.o: wrapper.c ow-crypt.h crypt_blowfish.h crypt_gensalt.h
  40. $(CC) -c $(CFLAGS) wrapper.c -DTEST -o $@
  41. check_threads: crypt_test_threads
  42. ./crypt_test_threads
  43. crypt_test_threads: $(TEST_THREADS_OBJS)
  44. $(LD) $(LDFLAGS) $(TEST_THREADS_OBJS) -lpthread -o $@
  45. crypt_test_threads.o: wrapper.c ow-crypt.h crypt_blowfish.h crypt_gensalt.h
  46. $(CC) -c $(CFLAGS) wrapper.c -DTEST -DTEST_THREADS=4 -o $@
  47. man: $(EXTRA_MANS)
  48. $(EXTRA_MANS):
  49. echo '.so man3/crypt.3' > $@
  50. crypt_blowfish.o: crypt_blowfish.h
  51. crypt_gensalt.o: crypt_gensalt.h
  52. wrapper.o: crypt.h ow-crypt.h crypt_blowfish.h crypt_gensalt.h
  53. .c.o:
  54. $(CC) -c $(CFLAGS) $*.c
  55. .S.o:
  56. $(AS) $(ASFLAGS) $*.S
  57. clean:
  58. $(RM) crypt_test crypt_test_threads *.o $(EXTRA_MANS) core