-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathMakefile
More file actions
132 lines (105 loc) · 5.38 KB
/
Makefile
File metadata and controls
132 lines (105 loc) · 5.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
###############################################################################
# Copyright Christopher Kormanyos 2026.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# My local machine
# cd /mnt/c/Users/ckorm/Documents/Ks/PC_Software/NumericalPrograms/ExtendedNumberTypes/wide_integer
# make MY_CC=g++ MY_BOOST_ROOT=/mnt/c/boost/boost_1_90_0 all
# MacOS with brew llvm
# make MY_CC=/opt/homebrew/opt/llvm/bin/clang++ MY_BOOST_ROOT=../boost-root MY_STD=c++23 MY_BREW=brew all
all : compile_and_link
BOOST_ROOT := ../boost-root
CC := clang++
STD := c++20
ifneq ($(MY_BOOST_ROOT),)
BOOST_ROOT := $(MY_BOOST_ROOT)
endif
ifneq ($(MY_CC),)
CC := $(MY_CC)
endif
ifneq ($(MY_STD),)
STD := $(MY_STD)
endif
ECHO := echo
FILES_SRC := test/test.cpp \
test/test_uintwide_t_boost_backend.cpp \
test/test_uintwide_t_edge_cases.cpp \
test/test_uintwide_t_examples.cpp \
test/test_uintwide_t_float_convert.cpp \
test/test_uintwide_t_int_convert.cpp \
test/test_uintwide_t_n_base.cpp \
test/test_uintwide_t_n_binary_ops_base.cpp \
test/test_uintwide_t_spot_values.cpp \
examples/example000a_builtin_convert.cpp \
examples/example000_numeric_limits.cpp \
examples/example001_mul_div.cpp \
examples/example001a_div_mod.cpp \
examples/example002_shl_shr.cpp \
examples/example003_sqrt.cpp \
examples/example003a_cbrt.cpp \
examples/example004_rootk_pow.cpp \
examples/example005_powm.cpp \
examples/example005a_pow_factors_of_p99.cpp \
examples/example006_gcd.cpp \
examples/example007_random_generator.cpp \
examples/example008_miller_rabin_prime.cpp \
examples/example008a_miller_rabin_prime.cpp \
examples/example008b_solovay_strassen_prime.cpp \
examples/example009_timed_mul.cpp \
examples/example009a_timed_mul_4_by_4.cpp \
examples/example009b_timed_mul_8_by_8.cpp \
examples/example010_uint48_t.cpp \
examples/example011_uint24_t.cpp \
examples/example012_rsa_crypto.cpp \
examples/example013_ecdsa_sign_verify.cpp \
examples/example014_pi_spigot_wide.cpp
CPPFLAGS := -std=$(STD) \
-finline-functions \
-march=native \
-mtune=native \
-O3 \
-Werror \
-Wall \
-Wextra \
-Wpedantic \
-Wconversion \
-Wsign-conversion \
-Wshadow \
-Wundef \
-Wunused-parameter \
-Wuninitialized \
-Wunreachable-code \
-Winit-self \
-Wzero-as-null-pointer-constant
C_DEFINES := -DWIDE_INTEGER_HAS_LIMB_TYPE_UINT64 \
-DWIDE_INTEGER_HAS_MUL_8_BY_8_UNROLL \
-DWIDE_INTEGER_NAMESPACE=ckormanyos
C_INCLUDES := -I. \
-I$(BOOST_ROOT)
ifeq ($(MY_BREW),brew)
C_INCLUDES += -isystem /opt/homebrew/opt/llvm/include
C_INCLUDES += -isystem $$(xcrun --show-sdk-path)
endif
LDFLAGS := -pthread \
-lpthread
ifeq ($(MY_BREW),brew)
LDFLAGS += -L/opt/homebrew/opt/llvm/lib
endif
clean :
@-$(ECHO)
@-$(ECHO) +++ cleaning
@-rm -f ./wide_integer || true
compile_and_link : clean
@-$(ECHO)
@-$(ECHO) +++ print compiler version
@-$(CC) --version
@-$(ECHO)
@-$(ECHO) +++ compiling and linking to wide_integer
@-$(ECHO)
-$(CC) $(CPPFLAGS) $(C_DEFINES) $(C_INCLUDES) $(LDFLAGS) $(FILES_SRC) -o wide_integer
@-$(ECHO)
@-$(ECHO) +++ check for executable wide_integer
-ls -la ./wide_integer
@-$(ECHO)