2
0

makefile.include 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #
  2. # Include makefile for libtomcrypt
  3. #
  4. # Compiler and Linker Names
  5. ifndef PREFIX
  6. PREFIX:=
  7. endif
  8. ifeq ($(CC),cc)
  9. CC := $(PREFIX)gcc
  10. endif
  11. LD:=$(PREFIX)ld
  12. AR:=$(PREFIX)ar
  13. # Archiver [makes .a files]
  14. #AR=ar
  15. ARFLAGS:=r
  16. ifndef MAKE
  17. MAKE:=make
  18. endif
  19. # Compilation flags. Note the += does not write over the user's CFLAGS!
  20. CFLAGS += -I./testprof/ -I./src/headers/ -Wall -Wsign-compare -Wshadow -DLTC_SOURCE
  21. ifdef OLD_GCC
  22. CFLAGS += -W
  23. # older GCCs can't handle the "rotate with immediate" ROLc/RORc/etc macros
  24. # define this to help
  25. CFLAGS += -DLTC_NO_ROLC
  26. else
  27. CFLAGS += -Wextra
  28. # additional warnings
  29. CFLAGS += -Wsystem-headers -Wbad-function-cast -Wcast-align
  30. CFLAGS += -Wstrict-prototypes -Wpointer-arith
  31. CFLAGS += -Wdeclaration-after-statement
  32. endif
  33. CFLAGS += -Wno-type-limits
  34. ifdef LTC_DEBUG
  35. # compile for DEBUGGING (required for ccmalloc checking!!!)
  36. ifneq (,$(strip $(LTC_DEBUG)))
  37. CFLAGS += -g3 -DLTC_NO_ASM -DLTC_TEST_DBG=$(LTC_DEBUG)
  38. else
  39. CFLAGS += -g3 -DLTC_NO_ASM -DLTC_TEST_DBG
  40. endif
  41. else
  42. ifdef LTC_SMALL
  43. # optimize for SIZE
  44. CFLAGS += -Os -DLTC_SMALL_CODE
  45. else
  46. ifndef IGNORE_SPEED
  47. # optimize for SPEED
  48. CFLAGS += -O3 -funroll-loops
  49. # add -fomit-frame-pointer. hinders debugging!
  50. CFLAGS += -fomit-frame-pointer
  51. endif
  52. endif # COMPILE_SMALL
  53. endif # COMPILE_DEBUG
  54. ifneq ($(findstring clang,$(CC)),)
  55. CFLAGS += -Wno-typedef-redefinition -Wno-tautological-compare
  56. endif
  57. HASH=hashsum
  58. CRYPT=encrypt
  59. SMALL=small
  60. TV=tv_gen
  61. MULTI=multi
  62. TIMING=timing
  63. TEST=test
  64. SIZES=sizes
  65. CONSTANTS=constants
  66. DEMOS=hashsum crypt small tv_gen multi sizes constants
  67. TIMINGS=demos/timing.o
  68. TESTS=demos/test.o
  69. #LIBPATH-The directory for libtomcrypt to be installed to.
  70. #INCPATH-The directory to install the header files for libtomcrypt.
  71. #DATAPATH-The directory to install the pdf docs.
  72. ifndef DESTDIR
  73. DESTDIR=
  74. endif
  75. ifndef LIBPATH
  76. LIBPATH=/usr/lib
  77. endif
  78. ifndef INCPATH
  79. INCPATH=/usr/include
  80. endif
  81. ifndef DATAPATH
  82. DATAPATH=/usr/share/doc/libtomcrypt/pdf
  83. endif
  84. #Who do we install as?
  85. ifdef INSTALL_USER
  86. USER=$(INSTALL_USER)
  87. else
  88. USER=root
  89. endif
  90. ifdef INSTALL_GROUP
  91. GROUP=$(INSTALL_GROUP)
  92. else
  93. GROUP=wheel
  94. endif