1 # https://www.gnu.org/software/make/manual/make.html#Makefile-Conventions
2 # and https://www.gnu.org/prep/standards/standards.html
8 # Used for feature tests
10 TOUT := $(strip $(TOUT))
12 # Allow override for the cryptest.exe recipe. Change to
13 # ./libcryptopp.so or ./libcryptopp.dylib to suit your
14 # taste. https://github.com/weidai11/cryptopp/issues/866
15 LINK_LIBRARY ?= libcryptopp.a
16 LINK_LIBRARY_PATH ?= ./
18 # Default FLAGS if none were provided
20 CXXFLAGS ?= -g2 -O3 -fPIC -pipe
33 LDCONF ?= /sbin/ldconfig -n
39 # Clang is reporting armv8l-unknown-linux-gnueabihf
40 # for ARMv7 images on Aarch64 hardware.
41 MACHINEX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null)
42 HOSTX := $(shell echo $(MACHINEX) | cut -f 1 -d '-')
44 HOSTX := $(shell uname -m 2>/dev/null)
47 IS_LINUX := $(shell echo $(MACHINEX) | $(GREP) -i -c "Linux")
49 # Can be used by Android and Embedded cross-compiles. Disable by default because
50 # Android and embedded users typically don't run this configuration.
51 HAS_SOLIB_VERSION ?= 0
53 # Formerly adhoc.cpp was created from adhoc.cpp.proto when needed.
54 # This is now needed because ISA tests are performed using adhoc.cpp.
55 ifeq ($(wildcard adhoc.cpp),)
56 $(shell cp adhoc.cpp.proto adhoc.cpp)
59 ###########################################################
60 ##### General Variables #####
61 ###########################################################
63 # Needed when the assembler is invoked
64 ifeq ($(findstring $(ASFLAGS),-Wa,--noexecstack),)
65 ASFLAGS += -Wa,--noexecstack
68 # On ARM we may compile aes_armv4.S, sha1_armv4.S, sha256_armv4.S, and
69 # sha512_armv4.S through the CC compiler
70 ifeq ($(GCC_COMPILER),1)
72 else ifeq ($(CLANG_COMPILER),1)
76 # http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
81 LIBDIR := $(PREFIX)/lib
84 DATADIR := $(PREFIX)/share
87 INCLUDEDIR := $(PREFIX)/include
90 BINDIR := $(PREFIX)/bin
93 # We honor ARFLAGS, but the "v" option used by default causes a noisy make
98 ###########################################################
100 ###########################################################
102 # MacOS cross-compile configuration.
103 # See http://www.cryptopp.com/wiki/MacOS_(Command_Line).
105 # setenv-macos.sh sets CPPFLAGS, CXXFLAGS and LDFLAGS
106 IS_APPLE_LIBTOOL=$(shell libtool -V 2>&1 | $(GREP) -i -c 'Apple')
107 ifeq ($(IS_APPLE_LIBTOOL),1)
110 AR = /usr/bin/libtool
115 ###########################################################
117 ###########################################################
119 # iOS cross-compile configuration.
120 # See http://www.cryptopp.com/wiki/iOS_(Command_Line).
122 # setenv-ios.sh sets CPPFLAGS, CXXFLAGS and LDFLAGS
127 ###########################################################
129 ###########################################################
131 # Android cross-compile configuration.
132 # See http://www.cryptopp.com/wiki/Android_(Command_Line).
133 ifeq ($(IS_ANDROID),1)
134 # setenv-android.sh sets CPPFLAGS, CXXFLAGS and LDFLAGS
136 # Source files copied into PWD for Android cpu-features
137 # setenv-android.sh does the copying. Its a dirty compile.
138 ANDROID_CPU_OBJ = cpu-features.o
141 ###########################################################
143 ###########################################################
145 # ARM embedded cross-compile configuration.
146 # See http://www.cryptopp.com/wiki/ARM_Embedded_(Command_Line)
147 # and http://www.cryptopp.com/wiki/ARM_Embedded_(Bare Metal).
148 ifeq ($(IS_ARM_EMBEDDED),1)
149 # setenv-android.sh sets CPPFLAGS, CXXFLAGS and LDFLAGS
152 ###########################################################
153 ##### Compiler and Platform #####
154 ###########################################################
156 # Wait until CXXFLAGS have been set by setenv scripts.
158 GCC_COMPILER := $(shell $(CXX) --version 2>/dev/null | $(GREP) -v -E 'llvm|clang' | $(GREP) -i -c -E '(gcc|g\+\+)')
159 CLANG_COMPILER := $(shell $(CXX) --version 2>/dev/null | $(GREP) -i -c -E 'llvm|clang')
161 HOSTX := $(shell $(CXX) $(CXXFLAGS) -dumpmachine 2>/dev/null | cut -f 1 -d '-')
163 HOSTX := $(shell uname -m 2>/dev/null)
166 # This dance is because Clang reports the host architecture instead
167 # of the target architecture for -dumpmachine. Running Clang on an
168 # x86_64 machine with -arch arm64 yields x86_64 instead of arm64.
170 ifeq ($(CLANG_COMPILER),1)
171 # The compiler is either GCC or Clang
172 IS_X86 := $(shell echo $(CXXFLAGS) | $(GREP) -v 64 | $(GREP) -i -c -E 'i.86')
173 IS_X64 := $(shell echo $(CXXFLAGS) | $(GREP) -i -c -E 'x86_64|amd64')
174 IS_ARM32 := $(shell echo $(CXXFLAGS) | $(GREP) -v 64 | $(GREP) -i -c -E 'arm|armhf|arm7l|armeabihf')
175 IS_ARMV8 := $(shell echo $(CXXFLAGS) | $(GREP) -i -c -E 'aarch32|aarch64|arm64|armv8')
177 IS_X86 := $(shell echo $(HOSTX) | $(GREP) -v 64 | $(GREP) -i -c -E 'i.86')
178 IS_X64 := $(shell echo $(HOSTX) | $(GREP) -i -c -E 'x86_64|amd64')
179 IS_ARM32 := $(shell echo $(HOSTX) | $(GREP) -v 64 | $(GREP) -i -c -E 'arm|armhf|arm7l|eabihf')
180 IS_ARMV8 := $(shell echo $(HOSTX) | $(GREP) -i -c -E 'aarch32|aarch64|arm64|armv8')
191 # Uncomment for debugging
192 # $(info Here's what we found... IS_X86: $(IS_X86), IS_X64: $(IS_X64), IS_ARM32: $(IS_ARM32), IS_ARMV8: $(IS_ARMV8))
194 ###########################################################
195 ##### Test Program #####
196 ###########################################################
198 # Hack to skip CPU feature tests for some recipes
200 ifneq ($(findstring -DCRYPTOPP_DISABLE_ASM,$(CPPFLAGS)$(CXXFLAGS)),)
202 else ifneq ($(findstring clean,$(MAKECMDGOALS)),)
204 else ifneq ($(findstring distclean,$(MAKECMDGOALS)),)
206 else ifneq ($(findstring trim,$(MAKECMDGOALS)),)
208 else ifneq ($(findstring zip,$(MAKECMDGOALS)),)
212 # Strip out -Wall, -Wextra and friends for feature testing. FORTIFY_SOURCE is removed
213 # because it requires -O1 or higher, but we use -O0 to tame the optimizer.
214 # Always print testing flags since some tests always happen, like 64-bit.
215 TCXXFLAGS := $(filter-out -D_FORTIFY_SOURCE=% -M -MM -Wall -Wextra -Werror% -Wunused -Wconversion -Wp%, $(CPPFLAGS) $(CXXFLAGS))
216 ifneq ($(strip $(TCXXFLAGS)),)
217 $(info Using testing flags: $(TCXXFLAGS))
220 # TCOMMAND is used for just about all tests. Make will lazy-evaluate
221 # the variables when executed by $(shell $(TCOMMAND) ...).
222 TCOMMAND = $(CXX) $(TCXXFLAGS) $(TEXTRA) $(ZOPT) $(TOPT) $(TPROG) -o $(TOUT)
224 ###########################################################
225 ##### X86/X32/X64 Options #####
226 ###########################################################
228 ifneq ($(IS_X86)$(IS_X64),00)
229 ifeq ($(DETECT_FEATURES),1)
234 SSE41_FLAG = -msse4.1
235 SSE42_FLAG = -msse4.2
236 CLMUL_FLAG = -mpclmul
242 TPROG = TestPrograms/test_x86_sse2.cpp
244 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
245 ifeq ($(strip $(HAVE_OPT)),0)
246 CHACHA_FLAG = $(SSE2_FLAG)
248 # Make does not have useful debugging facilities. Show the user
249 # what happened by compiling again without the pipe.
250 $(info Running make again to see what failed)
251 $(info $(shell $(TCOMMAND)))
256 CPPFLAGS += -DCRYPTOPP_DISABLE_ASM
259 # Need SSE2 or higher for these tests
260 ifneq ($(SSE2_FLAG),)
261 TPROG = TestPrograms/test_x86_ssse3.cpp
263 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
264 ifeq ($(strip $(HAVE_OPT)),0)
265 ARIA_FLAG = $(SSSE3_FLAG)
266 CHAM_FLAG = $(SSSE3_FLAG)
267 KECCAK_FLAG = $(SSSE3_FLAG)
268 LEA_FLAG = $(SSSE3_FLAG)
269 LSH256_FLAG = $(SSSE3_FLAG)
270 LSH512_FLAG = $(SSSE3_FLAG)
271 SIMON128_FLAG = $(SSSE3_FLAG)
272 SPECK128_FLAG = $(SSSE3_FLAG)
277 # The first Apple MacBooks were Core2's with SSE4.1
278 ifneq ($(IS_DARWIN),0)
279 # Add SSE2 algo's here as required
280 # They get a free upgrade
283 TPROG = TestPrograms/test_x86_sse41.cpp
285 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
286 ifeq ($(strip $(HAVE_OPT)),0)
287 BLAKE2B_FLAG = $(SSE41_FLAG)
288 BLAKE2S_FLAG = $(SSE41_FLAG)
293 TPROG = TestPrograms/test_x86_sse42.cpp
295 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
296 ifeq ($(strip $(HAVE_OPT)),0)
297 CRC_FLAG = $(SSE42_FLAG)
302 TPROG = TestPrograms/test_x86_clmul.cpp
304 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
305 ifeq ($(strip $(HAVE_OPT)),0)
306 GCM_FLAG = $(SSSE3_FLAG) $(CLMUL_FLAG)
307 GF2N_FLAG = $(CLMUL_FLAG)
312 TPROG = TestPrograms/test_x86_aes.cpp
314 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
315 ifeq ($(strip $(HAVE_OPT)),0)
316 AES_FLAG = $(SSE41_FLAG) $(AESNI_FLAG)
317 SM4_FLAG = $(SSSE3_FLAG) $(AESNI_FLAG)
322 TPROG = TestPrograms/test_x86_avx.cpp
324 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
325 ifeq ($(strip $(HAVE_OPT)),0)
326 # XXX_FLAG = $(AVX_FLAG)
331 TPROG = TestPrograms/test_x86_avx2.cpp
333 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
334 ifeq ($(strip $(HAVE_OPT)),0)
335 CHACHA_AVX2_FLAG = $(AVX2_FLAG)
336 LSH256_AVX2_FLAG = $(AVX2_FLAG)
337 LSH512_AVX2_FLAG = $(AVX2_FLAG)
342 TPROG = TestPrograms/test_x86_sha.cpp
344 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
345 ifeq ($(strip $(HAVE_OPT)),0)
346 SHA_FLAG = $(SSE42_FLAG) $(SHANI_FLAG)
352 CPPFLAGS += -DCRYPTOPP_DISABLE_SSE3
353 else ifeq ($(SSSE3_FLAG),)
354 CPPFLAGS += -DCRYPTOPP_DISABLE_SSSE3
355 else ifeq ($(SSE41_FLAG),)
356 CPPFLAGS += -DCRYPTOPP_DISABLE_SSE4
357 else ifeq ($(SSE42_FLAG),)
358 CPPFLAGS += -DCRYPTOPP_DISABLE_SSE4
361 ifneq ($(SSE42_FLAG),)
362 # Unusual GCC/Clang on Macports. It assembles AES, but not CLMUL.
363 # test_x86_clmul.s:15: no such instruction: 'pclmulqdq $0, %xmm1,%xmm0'
364 ifeq ($(CLMUL_FLAG),)
365 CPPFLAGS += -DCRYPTOPP_DISABLE_CLMUL
367 ifeq ($(AESNI_FLAG),)
368 CPPFLAGS += -DCRYPTOPP_DISABLE_AESNI
372 CPPFLAGS += -DCRYPTOPP_DISABLE_AVX
373 else ifeq ($(AVX2_FLAG),)
374 CPPFLAGS += -DCRYPTOPP_DISABLE_AVX2
376 # SHANI independent of AVX per GH #1045
377 ifeq ($(SHANI_FLAG),)
378 CPPFLAGS += -DCRYPTOPP_DISABLE_SHANI
382 # Drop to SSE2 if available
384 GCM_FLAG = $(SSE2_FLAG)
387 # Most Clang cannot handle mixed asm with positional arguments, where the
388 # body is Intel style with no prefix and the templates are AT&T style.
389 # Also see https://bugs.llvm.org/show_bug.cgi?id=39895 .
391 # CRYPTOPP_DISABLE_MIXED_ASM is now being added in config_asm.h for all
392 # Clang compilers. This test will need to be re-enabled if Clang fixes it.
393 #TPROG = TestPrograms/test_asm_mixed.cpp
395 #HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
396 #ifneq ($(strip $(HAVE_OPT)),0)
397 # CPPFLAGS += -DCRYPTOPP_DISABLE_MIXED_ASM
406 # IS_X86, IS_X32 and IS_X64
409 ###########################################################
410 ##### ARM A-32 and NEON #####
411 ###########################################################
413 ifneq ($(IS_ARM32),0)
415 # No need for feature detection on this platform if NEON is disabled
416 ifneq ($(findstring -DCRYPTOPP_DISABLE_ARM_NEON,$(CPPFLAGS)$(CXXFLAGS)),)
420 ifeq ($(DETECT_FEATURES),1)
422 # Android needs -c compile flag for NEON. Otherwise there's an odd linker message.
423 ifeq ($(IS_ANDROID),1)
424 NEON_FLAG = -march=armv7-a -mfpu=vfpv3-d16 -mfpu=neon
426 NEON_FLAG = -march=armv7-a -mfpu=neon
429 # Clang needs an option to include <arm_neon.h>
430 TPROG = TestPrograms/test_arm_neon_header.cpp
431 TOPT = -DCRYPTOPP_ARM_NEON_HEADER=1 $(NEON_FLAG)
432 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
433 ifeq ($(strip $(HAVE_OPT)),0)
434 TEXTRA += -DCRYPTOPP_ARM_NEON_HEADER=1
437 TPROG = TestPrograms/test_arm_neon.cpp
439 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
440 ifeq ($(strip $(HAVE_OPT)),0)
441 ARIA_FLAG = $(NEON_FLAG)
442 AES_FLAG = $(NEON_FLAG)
443 CRC_FLAG = $(NEON_FLAG)
444 GCM_FLAG = $(NEON_FLAG)
445 BLAKE2B_FLAG = $(NEON_FLAG)
446 BLAKE2S_FLAG = $(NEON_FLAG)
447 CHACHA_FLAG = $(NEON_FLAG)
448 CHAM_FLAG = $(NEON_FLAG)
449 LEA_FLAG = $(NEON_FLAG)
450 SHA_FLAG = $(NEON_FLAG)
451 SIMON128_FLAG = $(NEON_FLAG)
452 SPECK128_FLAG = $(NEON_FLAG)
453 SM4_FLAG = $(NEON_FLAG)
455 # Make does not have useful debugging facilities. Show the user
456 # what happened by compiling again without the pipe.
457 $(info Running make again to see what failed)
458 $(info $(shell $(TCOMMAND)))
463 CPPFLAGS += -DCRYPTOPP_DISABLE_ASM
471 ###########################################################
472 ##### Aach32 and Aarch64 #####
473 ###########################################################
475 ifneq ($(IS_ARMV8),0)
476 ifeq ($(DETECT_FEATURES),1)
479 ASIMD_FLAG = -arch arm64
480 CRC_FLAG = -arch arm64
481 AES_FLAG = -arch arm64
482 PMUL_FLAG = -arch arm64
483 SHA_FLAG = -arch arm64
485 ASIMD_FLAG = -march=armv8-a
486 CRC_FLAG = -march=armv8-a+crc
487 AES_FLAG = -march=armv8-a+crypto
488 GCM_FLAG = -march=armv8-a+crypto
489 GF2N_FLAG = -march=armv8-a+crypto
490 SHA_FLAG = -march=armv8-a+crypto
493 TPROG = TestPrograms/test_arm_neon_header.cpp
494 TOPT = -DCRYPTOPP_ARM_NEON_HEADER=1
495 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
496 ifeq ($(strip $(HAVE_OPT)),0)
497 TEXTRA += -DCRYPTOPP_ARM_NEON_HEADER=1
500 TPROG = TestPrograms/test_arm_acle_header.cpp
501 TOPT = -DCRYPTOPP_ARM_ACLE_HEADER=1 $(ASIMD_FLAG)
502 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
503 ifeq ($(strip $(HAVE_OPT)),0)
504 TEXTRA += -DCRYPTOPP_ARM_ACLE_HEADER=1
507 TPROG = TestPrograms/test_arm_asimd.cpp
509 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
510 ifeq ($(strip $(HAVE_OPT)),0)
511 ARIA_FLAG = $(ASIMD_FLAG)
512 BLAKE2B_FLAG = $(ASIMD_FLAG)
513 BLAKE2S_FLAG = $(ASIMD_FLAG)
514 CHACHA_FLAG = $(ASIMD_FLAG)
515 CHAM_FLAG = $(ASIMD_FLAG)
516 LEA_FLAG = $(ASIMD_FLAG)
517 NEON_FLAG = $(ASIMD_FLAG)
518 SIMON128_FLAG = $(ASIMD_FLAG)
519 SPECK128_FLAG = $(ASIMD_FLAG)
520 SM4_FLAG = $(ASIMD_FLAG)
522 # Make does not have useful debugging facilities. Show the user
523 # what happened by compiling again without the pipe.
524 $(info Running make again to see what failed)
525 $(info $(shell $(TCOMMAND)))
529 ifeq ($(ASIMD_FLAG),)
530 CPPFLAGS += -DCRYPTOPP_DISABLE_ASM
533 ifneq ($(ASIMD_FLAG),)
535 TPROG = TestPrograms/test_arm_crc.cpp
537 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
538 ifneq ($(strip $(HAVE_OPT)),0)
540 CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_CRC32
543 TPROG = TestPrograms/test_arm_aes.cpp
545 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
546 ifneq ($(strip $(HAVE_OPT)),0)
548 CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_AES
551 TPROG = TestPrograms/test_arm_pmull.cpp
553 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
554 ifneq ($(strip $(HAVE_OPT)),0)
557 CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_PMULL
560 TPROG = TestPrograms/test_arm_sha1.cpp
562 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
563 ifneq ($(strip $(HAVE_OPT)),0)
565 CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_SHA1
568 TPROG = TestPrograms/test_arm_sha256.cpp
570 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
571 ifneq ($(strip $(HAVE_OPT)),0)
573 CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_SHA2
576 TPROG = TestPrograms/test_arm_sm3.cpp
577 TOPT = -march=armv8.4-a+sm3
578 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
579 ifeq ($(strip $(HAVE_OPT)),0)
580 SM3_FLAG = -march=armv8.4-a+sm3
581 SM4_FLAG = -march=armv8.4-a+sm3
583 #CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_SM3
584 #CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_SM4
587 TPROG = TestPrograms/test_arm_sha3.cpp
588 TOPT = -march=armv8.4-a+sha3
589 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
590 ifeq ($(strip $(HAVE_OPT)),0)
591 SHA3_FLAG = -march=armv8.4-a+sha3
593 #CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_SHA3
596 TPROG = TestPrograms/test_arm_sha512.cpp
597 TOPT = -march=armv8.4-a+sha512
598 HAVE_OPT = $(shell $(TCOMMAND) 2>&1 | wc -w)
599 ifeq ($(strip $(HAVE_OPT)),0)
600 SHA512_FLAG = -march=armv8.4-a+sha512
602 #CPPFLAGS += -DCRYPTOPP_DISABLE_ARM_SHA512
613 ###########################################################
615 ###########################################################
617 # Undefined Behavior Sanitizer (UBsan) testing. Issue 'make ubsan'.
618 ifeq ($(findstring ubsan,$(MAKECMDGOALS)),ubsan)
619 ifeq ($(findstring -fsanitize=undefined,$(CXXFLAGS)),)
620 CXXFLAGS += -fsanitize=undefined
622 ifeq ($(findstring -DCRYPTOPP_COVERAGE,$(CPPFLAGS)$(CXXFLAGS)),)
623 CPPFLAGS += -DCRYPTOPP_COVERAGE
627 # Address Sanitizer (Asan) testing. Issue 'make asan'.
628 ifeq ($(findstring asan,$(MAKECMDGOALS)),asan)
629 ifeq ($(findstring -fsanitize=address,$(CXXFLAGS)),)
630 CXXFLAGS += -fsanitize=address
632 ifeq ($(findstring -DCRYPTOPP_COVERAGE,$(CPPFLAGS)$(CXXFLAGS)),)
633 CPPFLAGS += -DCRYPTOPP_COVERAGE
635 ifeq ($(findstring -fno-omit-frame-pointer,$(CXXFLAGS)),)
636 CXXFLAGS += -fno-omit-frame-pointer
640 # LD gold linker testing. Triggered by 'LD=ld.gold'.
641 ifeq ($(findstring ld.gold,$(LD)),ld.gold)
642 ifeq ($(findstring -fuse-ld=gold,$(CXXFLAGS)),)
643 ELF_FORMAT := $(shell file `which ld.gold` 2>&1 | cut -d":" -f 2 | $(GREP) -i -c "elf")
644 ifneq ($(ELF_FORMAT),0)
645 LDFLAGS += -fuse-ld=gold
650 # Valgrind testing. Issue 'make valgrind'.
651 ifneq ($(filter valgrind,$(MAKECMDGOALS)),)
652 # Tune flags; see http://valgrind.org/docs/manual/quick-start.html
653 CXXFLAGS := $(CXXFLAGS:-g%=-g3)
654 CXXFLAGS := $(CXXFLAGS:-O%=-O1)
655 CXXFLAGS := $(CXXFLAGS:-xO%=-xO1)
656 ifeq ($(findstring -DCRYPTOPP_COVERAGE,$(CPPFLAGS)$(CXXFLAGS)),)
657 CPPFLAGS += -DCRYPTOPP_COVERAGE
661 # Debug testing on GNU systems. Triggered by -DDEBUG.
662 # Newlib test due to http://sourceware.org/bugzilla/show_bug.cgi?id=20268
663 ifneq ($(filter -DDEBUG -DDEBUG=1,$(CPPFLAGS) $(CXXFLAGS)),)
664 USING_GLIBCXX := $(shell $(CXX) $(CPPFLAGS) $(CXXFLAGS) -E pch.cpp 2>&1 | $(GREP) -i -c "__GLIBCXX__")
665 ifneq ($(USING_GLIBCXX),0)
666 ifeq ($(HAS_NEWLIB),0)
667 ifeq ($(findstring -D_GLIBCXX_DEBUG,$(CPPFLAGS)$(CXXFLAGS)),)
668 CPPFLAGS += -D_GLIBCXX_DEBUG
671 endif # USING_GLIBCXX
672 endif # GNU Debug build
674 # Dead code stripping. Issue 'make lean'.
675 ifeq ($(findstring lean,$(MAKECMDGOALS)),lean)
676 ifeq ($(findstring -ffunction-sections,$(CXXFLAGS)),)
677 CXXFLAGS += -ffunction-sections
679 ifeq ($(findstring -fdata-sections,$(CXXFLAGS)),)
680 CXXFLAGS += -fdata-sections
683 ifeq ($(findstring -Wl,-dead_strip,$(LDFLAGS)),)
684 LDFLAGS += -Wl,-dead_strip
686 else # BSD, Linux and Unix
687 ifeq ($(findstring -Wl,--gc-sections,$(LDFLAGS)),)
688 LDFLAGS += -Wl,--gc-sections
691 endif # Dead code stripping
693 ###########################################################
694 ##### Source and object files #####
695 ###########################################################
697 # List cryptlib.cpp first, then cpu.cpp, then integer.cpp to tame C++ static initialization problems.
698 SRCS := cryptlib.cpp cpu.cpp integer.cpp $(filter-out cryptlib.cpp cpu.cpp integer.cpp pch.cpp simple.cpp,$(sort $(wildcard *.cpp)))
699 # For Makefile.am; resource.h is Windows
700 INCL := $(filter-out resource.h,$(sort $(wildcard *.h)))
702 # Cryptogams source files. We couple to ARMv7 and NEON.
703 # Limit to Linux. The source files target the GNU assembler.
704 # Also see https://www.cryptopp.com/wiki/Cryptogams.
705 ifeq ($(IS_ARM32)$(IS_LINUX),11)
706 ifeq ($(filter -DCRYPTOPP_DISABLE_ASM -DCRYPTOPP_DISABLE_ARM_NEON,$(CPPFLAGS)$(CXXFLAGS)),)
707 # Do not use -march=armv7 if the compiler is already targeting the ISA.
708 # Also see https://github.com/weidai11/cryptopp/issues/1094
709 ifneq ($($(CXX) ++ -dM -E - </dev/null 2>/dev/null| grep 'ARM_ARCH 7|_ARM_ARCH_7A__'),)
710 CRYPTOGAMS_ARMV7_FLAG = -march=armv7-a
712 ifeq ($(CLANG_COMPILER),1)
713 CRYPTOGAMS_ARM_FLAG = $(CRYPTOGAMS_ARMV7_FLAG)
714 CRYPTOGAMS_ARM_THUMB_FLAG = $(CRYPTOGAMS_ARMV7_FLAG) -mthumb
716 # -mfpu=auto due to https://github.com/weidai11/cryptopp/issues/1094
717 CRYPTOGAMS_ARM_FLAG = $(CRYPTOGAMS_ARMV7_FLAG)
718 CRYPTOGAMS_ARM_THUMB_FLAG = $(CRYPTOGAMS_ARMV7_FLAG)
720 SRCS += aes_armv4.S sha1_armv4.S sha256_armv4.S sha512_armv4.S
724 # Remove unneeded arch specific files to speed build time.
725 ifeq ($(IS_PPC32)$(IS_PPC64),00)
726 SRCS := $(filter-out ppc_%,$(SRCS))
728 ifeq ($(IS_ARM32)$(IS_ARMV8),00)
729 SRCS := $(filter-out arm_%,$(SRCS))
730 SRCS := $(filter-out neon_%,$(SRCS))
732 ifeq ($(IS_X86)$(IS_X32)$(IS_X64),000)
733 SRCS := $(filter-out sse_%,$(SRCS))
736 # List cryptlib.cpp first, then cpu.cpp, then integer.cpp to tame C++ static initialization problems.
737 OBJS := $(SRCS:.cpp=.o)
738 OBJS := $(OBJS:.S=.o)
740 # List test.cpp first to tame C++ static initialization problems.
741 TESTSRCS := adhoc.cpp test.cpp bench1.cpp bench2.cpp bench3.cpp datatest.cpp dlltest.cpp fipsalgt.cpp validat0.cpp validat1.cpp validat2.cpp validat3.cpp validat4.cpp validat5.cpp validat6.cpp validat7.cpp validat8.cpp validat9.cpp validat10.cpp regtest1.cpp regtest2.cpp regtest3.cpp regtest4.cpp
742 TESTINCL := bench.h factory.h validate.h
745 TESTOBJS := $(TESTSRCS:.cpp=.o)
746 LIBOBJS := $(filter-out $(TESTOBJS),$(OBJS))
748 # Clean recipe, Issue 998. Don't filter-out some artifacts from the list of objects
749 # The *.S is a hack. It makes the ASM appear like C++ so the object files make the CLEAN_OBJS list
750 CLEAN_SRCS := $(wildcard *.cpp) $(patsubst %.S,%.cpp,$(wildcard *.S))
751 CLEAN_OBJS := $(CLEAN_SRCS:.cpp=.o) $(CLEAN_SRCS:.cpp=.import.o) $(CLEAN_SRCS:.cpp=.export.o)
753 # For Shared Objects, Diff, Dist/Zip rules
754 LIB_VER := $(shell $(GREP) "define CRYPTOPP_VERSION" config_ver.h | cut -d" " -f 3)
755 LIB_MAJOR := $(shell echo $(LIB_VER) | cut -c 1)
756 LIB_MINOR := $(shell echo $(LIB_VER) | cut -c 2)
757 LIB_PATCH := $(shell echo $(LIB_VER) | cut -c 3)
759 ifeq ($(strip $(LIB_PATCH)),)
763 ifeq ($(HAS_SOLIB_VERSION),1)
764 # Full version suffix for shared library
765 SOLIB_VERSION_SUFFIX=.$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)
766 # Different patchlevels and minors are compatible since 6.1
767 SOLIB_COMPAT_SUFFIX=.$(LIB_MAJOR)
768 SOLIB_FLAGS=-Wl,-soname,libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
769 endif # HAS_SOLIB_VERSION
771 ###########################################################
772 ##### Targets and Recipes #####
773 ###########################################################
775 # Default builds program with static library only
777 default: cryptest.exe
779 .PHONY: all static dynamic
780 all: static dynamic cryptest.exe
783 static: libcryptopp.a
784 shared dynamic dylib: libcryptopp.dylib
786 static: libcryptopp.a
787 shared dynamic: libcryptopp.so$(SOLIB_VERSION_SUFFIX)
791 test check: cryptest.exe
794 # CXXFLAGS are tuned earlier. Applications must use linker flags
795 # -Wl,--gc-sections (Linux and Unix) or -Wl,-dead_strip (OS X)
797 lean: static dynamic cryptest.exe
801 -$(RM) adhoc.cpp.o adhoc.cpp.proto.o $(CLEAN_OBJS) $(ANDROID_CPU_OBJ) rdrand-*.o
802 @-$(RM) libcryptopp.a libcryptopp.dylib cryptopp.dll libcryptopp.dll.a libcryptopp.import.a
803 @-$(RM) libcryptopp.so libcryptopp.so$(SOLIB_COMPAT_SUFFIX) libcryptopp.so$(SOLIB_VERSION_SUFFIX)
804 @-$(RM) cryptest.exe dlltest.exe cryptest.import.exe cryptest.dat ct et
805 @-$(RM) *.la *.lo *.gcov *.gcno *.gcda *.stackdump core core-*
806 @-$(RM) /tmp/adhoc.exe
807 @-$(RM) -r /tmp/cryptopp_test/
808 @-$(RM) -r *.exe.dSYM/
809 @-$(RM) -r *.dylib.dSYM/
812 .PHONY: autotools-clean
814 @-$(RM) -f configure.ac configure configure.in Makefile.am Makefile.in Makefile
815 @-$(RM) -f config.guess config.status config.sub config.h.in compile depcomp
816 @-$(RM) -f install-sh stamp-h1 ar-lib *.lo *.la *.m4 local.* lt*.sh missing
817 @-$(RM) -f cryptest cryptestcwd libtool* libcryptopp.la libcryptopp.pc*
818 @-$(RM) -rf build-aux/ m4/ auto*.cache/ .deps/ .libs/
822 @-$(RM) -f cryptopp-config.cmake CMakeLists.txt
823 @-$(RM) -rf cmake_build/
825 .PHONY: android-clean
827 @-$(RM) -f $(patsubst %_simd.cpp,%_simd.cpp.neon,$(wildcard *_simd.cpp))
831 distclean: clean autotools-clean cmake-clean android-clean
832 -$(RM) adhoc.cpp adhoc.cpp.copied GNUmakefile.deps benchmarks.html cryptest.txt
833 -$(RM) cryptest_all.info cryptest_debug.info cryptest_noasm.info cryptest_base.info cryptest.info cryptest_release.info
834 @-$(RM) cryptest-*.txt cryptopp.tgz libcryptopp.pc *.o *.bc *.ii *~
835 @-$(RM) -r cryptlib.lib cryptest.exe *.suo *.sdf *.pdb Win32/ x64/ ipch/
836 @-$(RM) -r $(LIBOBJS:.o=.obj) $(TESTOBJS:.o=.obj)
837 @-$(RM) -r $(LIBOBJS:.o=.lst) $(TESTOBJS:.o=.lst)
838 @-$(RM) -r TestCoverage/ ref*/
839 @-$(RM) cryptopp$(LIB_VER)\.* CryptoPPRef.zip
841 # Install cryptest.exe, libcryptopp.a and libcryptopp.so.
842 # The library install was broken-out into its own recipe at GH #653.
844 install: cryptest.exe install-lib
845 @-$(MKDIR) $(DESTDIR)$(BINDIR)
846 $(CP) cryptest.exe $(DESTDIR)$(BINDIR)
847 $(CHMOD) u=rwx,go=rx $(DESTDIR)$(BINDIR)/cryptest.exe
848 @-$(MKDIR) $(DESTDIR)$(DATADIR)/cryptopp/TestData
849 @-$(MKDIR) $(DESTDIR)$(DATADIR)/cryptopp/TestVectors
850 $(CP) TestData/*.dat $(DESTDIR)$(DATADIR)/cryptopp/TestData
851 $(CHMOD) u=rw,go=r $(DESTDIR)$(DATADIR)/cryptopp/TestData/*.dat
852 $(CP) TestVectors/*.txt $(DESTDIR)$(DATADIR)/cryptopp/TestVectors
853 $(CHMOD) u=rw,go=r $(DESTDIR)$(DATADIR)/cryptopp/TestVectors/*.txt
855 # A recipe to install only the library, and not cryptest.exe. Also
856 # see https://github.com/weidai11/cryptopp/issues/653.
859 @-$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/cryptopp
860 $(CP) *.h $(DESTDIR)$(INCLUDEDIR)/cryptopp
861 $(CHMOD) u=rw,go=r $(DESTDIR)$(INCLUDEDIR)/cryptopp/*.h
862 ifneq ($(wildcard libcryptopp.a),)
863 @-$(MKDIR) $(DESTDIR)$(LIBDIR)
864 $(CP) libcryptopp.a $(DESTDIR)$(LIBDIR)
865 $(CHMOD) u=rw,go=r $(DESTDIR)$(LIBDIR)/libcryptopp.a
867 ifneq ($(wildcard libcryptopp.dylib),)
868 @-$(MKDIR) $(DESTDIR)$(LIBDIR)
869 $(CP) libcryptopp.dylib $(DESTDIR)$(LIBDIR)
870 $(CHMOD) u=rwx,go=rx $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
871 -install_name_tool -id $(DESTDIR)$(LIBDIR)/libcryptopp.dylib $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
873 ifneq ($(wildcard libcryptopp.so$(SOLIB_VERSION_SUFFIX)),)
874 @-$(MKDIR) $(DESTDIR)$(LIBDIR)
875 $(CP) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)
876 $(CHMOD) u=rwx,go=rx $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX)
877 ifeq ($(HAS_SOLIB_VERSION),1)
878 -$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so
879 -$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
880 $(LDCONF) $(DESTDIR)$(LIBDIR)
883 ifneq ($(wildcard libcryptopp.pc),)
884 @-$(MKDIR) $(DESTDIR)$(LIBDIR)/pkgconfig
885 $(CP) libcryptopp.pc $(DESTDIR)$(LIBDIR)/pkgconfig
886 $(CHMOD) u=rw,go=r $(DESTDIR)$(LIBDIR)/pkgconfig/libcryptopp.pc
889 .PHONY: remove uninstall
891 -$(RM) -r $(DESTDIR)$(INCLUDEDIR)/cryptopp
892 -$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.a
893 -$(RM) $(DESTDIR)$(BINDIR)/cryptest.exe
894 @-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.dylib
895 @-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_VERSION_SUFFIX)
896 @-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
897 @-$(RM) $(DESTDIR)$(LIBDIR)/libcryptopp.so
899 libcryptopp.a: $(LIBOBJS) $(ANDROID_CPU_OBJ)
900 $(AR) $(ARFLAGS) $@ $(LIBOBJS) $(ANDROID_CPU_OBJ)
903 ifeq ($(HAS_SOLIB_VERSION),1)
904 .PHONY: libcryptopp.so
905 libcryptopp.so: libcryptopp.so$(SOLIB_VERSION_SUFFIX)
908 libcryptopp.so$(SOLIB_VERSION_SUFFIX): $(LIBOBJS) $(ANDROID_CPU_OBJ)
909 $(CXX) -shared $(SOLIB_FLAGS) -o $@ $(strip $(CPPFLAGS) $(CXXFLAGS)) -Wl,--exclude-libs,ALL $(LIBOBJS) $(ANDROID_CPU_OBJ) $(LDFLAGS) $(LDLIBS)
910 ifeq ($(HAS_SOLIB_VERSION),1)
911 -$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) libcryptopp.so
912 -$(LN) libcryptopp.so$(SOLIB_VERSION_SUFFIX) libcryptopp.so$(SOLIB_COMPAT_SUFFIX)
915 libcryptopp.dylib: $(LIBOBJS)
916 $(CXX) -dynamiclib -o $@ $(strip $(CPPFLAGS) $(CXXFLAGS)) -install_name "$@" -current_version "$(LIB_MAJOR).$(LIB_MINOR).$(LIB_PATCH)" -compatibility_version "$(LIB_MAJOR).$(LIB_MINOR)" -headerpad_max_install_names $(LDFLAGS) $(LIBOBJS)
918 cryptest.exe: $(LINK_LIBRARY) $(TESTOBJS)
919 $(CXX) -o $@ $(strip $(CPPFLAGS) $(CXXFLAGS)) $(TESTOBJS) $(LINK_LIBRARY_PATH)$(LINK_LIBRARY) $(LDFLAGS) $(LDLIBS)
921 # Used to generate list of source files for Autotools, CMakeList and Android.mk
924 $(info ***** Library sources *****)
925 $(info $(filter-out $(TESTSRCS),$(SRCS)))
927 $(info ***** Library headers *****)
928 $(info $(filter-out $(TESTINCL),$(INCL)))
930 $(info ***** Test sources *****)
933 $(info ***** Test headers *****)
936 adhoc.cpp: adhoc.cpp.proto
937 ifeq ($(wildcard adhoc.cpp),)
938 cp adhoc.cpp.proto adhoc.cpp
943 # Include dependencies, if present. You must issue `make deps` to create them.
944 ifeq ($(wildcard GNUmakefile.deps),GNUmakefile.deps)
945 -include GNUmakefile.deps
948 # A few recipes trigger warnings for -std=c++11 and -stdlib=c++
949 NOSTD_CXXFLAGS=$(filter-out -stdlib=%,$(filter-out -std=%,$(CXXFLAGS)))
951 # Cryptogams ARM asm implementation. AES needs -mthumb for Clang
952 aes_armv4.o : aes_armv4.S
953 $(CXX) $(strip $(CPPFLAGS) $(ASFLAGS) $(NOSTD_CXXFLAGS) $(CRYPTOGAMS_ARM_THUMB_FLAG) -c) $<
955 # Use C++ compiler on C source after patching.
956 # https://github.com/weidai11/cryptopp/issues/926
957 cpu-features.o: cpu-features.h cpu-features.c
958 $(CXX) -x c $(strip $(CPPFLAGS) $(NOSTD_CXXFLAGS) -c) cpu-features.c
960 # SSSE3 or NEON available
961 aria_simd.o : aria_simd.cpp
962 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(ARIA_FLAG) -c) $<
964 # SSE, NEON or POWER7 available
965 blake2s_simd.o : blake2s_simd.cpp
966 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(BLAKE2S_FLAG) -c) $<
968 # SSE, NEON or POWER8 available
969 blake2b_simd.o : blake2b_simd.cpp
970 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(BLAKE2B_FLAG) -c) $<
972 # SSE2 or NEON available
973 chacha_simd.o : chacha_simd.cpp
974 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(CHACHA_FLAG) -c) $<
977 chacha_avx.o : chacha_avx.cpp
978 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(CHACHA_AVX2_FLAG) -c) $<
981 cham_simd.o : cham_simd.cpp
982 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(CHAM_FLAG) -c) $<
986 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(DARN_FLAG) -c) $<
989 donna_sse.o : donna_sse.cpp
990 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SSE2_FLAG) -c) $<
993 sse_simd.o : sse_simd.cpp
994 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SSE2_FLAG) -c) $<
996 # SSE4.2 or ARMv8a available
997 crc_simd.o : crc_simd.cpp
998 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(CRC_FLAG) -c) $<
1000 # PCLMUL or ARMv7a/ARMv8a available
1001 gcm_simd.o : gcm_simd.cpp
1002 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(GCM_FLAG) -c) $<
1004 # Carryless multiply
1005 gf2n_simd.o : gf2n_simd.cpp
1006 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(GF2N_FLAG) -c) $<
1009 keccak_simd.o : keccak_simd.cpp
1010 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(KECCAK_FLAG) -c) $<
1013 lea_simd.o : lea_simd.cpp
1014 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(LEA_FLAG) -c) $<
1017 lsh256_sse.o : lsh256_sse.cpp
1018 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(LSH256_FLAG) -c) $<
1021 lsh256_avx.o : lsh256_avx.cpp
1022 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(LSH256_AVX2_FLAG) -c) $<
1025 lsh512_sse.o : lsh512_sse.cpp
1026 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(LSH512_FLAG) -c) $<
1029 lsh512_avx.o : lsh512_avx.cpp
1030 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(LSH512_AVX2_FLAG) -c) $<
1033 neon_simd.o : neon_simd.cpp
1034 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(NEON_FLAG) -c) $<
1036 # AESNI or ARMv7a/ARMv8a available
1037 rijndael_simd.o : rijndael_simd.cpp
1038 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(AES_FLAG) -c) $<
1040 # SSE4.2/SHA-NI or ARMv8a available
1041 sha_simd.o : sha_simd.cpp
1042 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SHA_FLAG) -c) $<
1044 # Cryptogams SHA1 asm implementation.
1045 sha1_armv4.o : sha1_armv4.S
1046 $(CXX) $(strip $(CPPFLAGS) $(ASFLAGS) $(NOSTD_CXXFLAGS) $(CRYPTOGAMS_ARM_FLAG) -c) $<
1048 # Cryptogams SHA256 asm implementation.
1049 sha256_armv4.o : sha256_armv4.S
1050 $(CXX) $(strip $(CPPFLAGS) $(ASFLAGS) $(NOSTD_CXXFLAGS) $(CRYPTOGAMS_ARM_FLAG) -c) $<
1052 # Cryptogams SHA512 asm implementation.
1053 sha512_armv4.o : sha512_armv4.S
1054 $(CXX) $(strip $(CPPFLAGS) $(ASFLAGS) $(NOSTD_CXXFLAGS) $(CRYPTOGAMS_ARM_FLAG) -c) $<
1056 # SSE4.2/SHA-NI or ARMv8a available
1057 shacal2_simd.o : shacal2_simd.cpp
1058 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SHA_FLAG) -c) $<
1060 # SSSE3, NEON or POWER8 available
1061 simon128_simd.o : simon128_simd.cpp
1062 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SIMON128_FLAG) -c) $<
1064 # SSSE3, NEON or POWER8 available
1065 speck128_simd.o : speck128_simd.cpp
1066 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SPECK128_FLAG) -c) $<
1069 sm3_simd.o : sm3_simd.cpp
1070 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SM3_FLAG) -c) $<
1073 sm4_simd.o : sm4_simd.cpp
1074 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) $(SM4_FLAG) -c) $<
1077 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS) -c) $<
1079 .PHONY: dep deps depend
1080 dep deps depend GNUmakefile.deps:
1081 $(CXX) $(strip $(CPPFLAGS) $(CXXFLAGS)) -MM *.cpp > GNUmakefile.deps