makefile.include 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  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. HASH=hashsum
  55. CRYPT=encrypt
  56. SMALL=small
  57. TV=tv_gen
  58. MULTI=multi
  59. TIMING=timing
  60. TEST=test
  61. SIZES=sizes
  62. CONSTANTS=constants
  63. #LIBPATH-The directory for libtomcrypt to be installed to.
  64. #INCPATH-The directory to install the header files for libtomcrypt.
  65. #DATAPATH-The directory to install the pdf docs.
  66. ifndef DESTDIR
  67. DESTDIR=
  68. endif
  69. ifndef LIBPATH
  70. LIBPATH=/usr/lib
  71. endif
  72. ifndef INCPATH
  73. INCPATH=/usr/include
  74. endif
  75. ifndef DATAPATH
  76. DATAPATH=/usr/share/doc/libtomcrypt/pdf
  77. endif
  78. #Who do we install as?
  79. ifdef INSTALL_USER
  80. USER=$(INSTALL_USER)
  81. else
  82. USER=root
  83. endif
  84. ifdef INSTALL_GROUP
  85. GROUP=$(INSTALL_GROUP)
  86. else
  87. GROUP=wheel
  88. endif