ob64 0.1.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/main.yml +20 -4
  3. data/.gitignore +2 -0
  4. data/CHANGELOG.md +18 -1
  5. data/{LICENSE.txt → LICENSE} +1 -1
  6. data/README.md +34 -2
  7. data/benchmark.rb +42 -3
  8. data/ext/ob64/ob64_ext.c +5 -3
  9. data/lib/ob64/core_ext.rb +2 -0
  10. data/lib/ob64/version.rb +1 -1
  11. data/lib/ob64.rb +52 -0
  12. data/ob64.gemspec +12 -6
  13. data/vendor/libbase64/.gitignore +12 -0
  14. data/vendor/libbase64/.travis.yml +71 -0
  15. data/vendor/libbase64/CMakeLists.txt +264 -0
  16. data/vendor/libbase64/LICENSE +28 -0
  17. data/vendor/libbase64/Makefile +93 -0
  18. data/vendor/libbase64/README.md +474 -0
  19. data/vendor/libbase64/base64-benchmarks.png +0 -0
  20. data/vendor/libbase64/bin/base64.c +132 -0
  21. data/vendor/libbase64/cmake/Modules/TargetArch.cmake +29 -0
  22. data/vendor/libbase64/cmake/Modules/TargetSIMDInstructionSet.cmake +34 -0
  23. data/vendor/libbase64/cmake/base64-config.cmake.in +5 -0
  24. data/vendor/libbase64/cmake/config.h.in +25 -0
  25. data/vendor/libbase64/cmake/test-arch.c +35 -0
  26. data/vendor/libbase64/include/libbase64.h +145 -0
  27. data/vendor/libbase64/lib/arch/avx/codec.c +42 -0
  28. data/vendor/libbase64/lib/arch/avx2/codec.c +42 -0
  29. data/vendor/libbase64/lib/arch/avx2/dec_loop.c +110 -0
  30. data/vendor/libbase64/lib/arch/avx2/dec_reshuffle.c +34 -0
  31. data/vendor/libbase64/lib/arch/avx2/enc_loop.c +89 -0
  32. data/vendor/libbase64/lib/arch/avx2/enc_reshuffle.c +83 -0
  33. data/vendor/libbase64/lib/arch/avx2/enc_translate.c +30 -0
  34. data/vendor/libbase64/lib/arch/generic/32/dec_loop.c +86 -0
  35. data/vendor/libbase64/lib/arch/generic/32/enc_loop.c +73 -0
  36. data/vendor/libbase64/lib/arch/generic/64/enc_loop.c +77 -0
  37. data/vendor/libbase64/lib/arch/generic/codec.c +39 -0
  38. data/vendor/libbase64/lib/arch/generic/dec_head.c +37 -0
  39. data/vendor/libbase64/lib/arch/generic/dec_tail.c +91 -0
  40. data/vendor/libbase64/lib/arch/generic/enc_head.c +24 -0
  41. data/vendor/libbase64/lib/arch/generic/enc_tail.c +34 -0
  42. data/vendor/libbase64/lib/arch/neon32/codec.c +72 -0
  43. data/vendor/libbase64/lib/arch/neon32/dec_loop.c +106 -0
  44. data/vendor/libbase64/lib/arch/neon32/enc_loop.c +58 -0
  45. data/vendor/libbase64/lib/arch/neon32/enc_reshuffle.c +54 -0
  46. data/vendor/libbase64/lib/arch/neon32/enc_translate.c +57 -0
  47. data/vendor/libbase64/lib/arch/neon64/codec.c +70 -0
  48. data/vendor/libbase64/lib/arch/neon64/dec_loop.c +129 -0
  49. data/vendor/libbase64/lib/arch/neon64/enc_loop.c +66 -0
  50. data/vendor/libbase64/lib/arch/neon64/enc_reshuffle.c +54 -0
  51. data/vendor/libbase64/lib/arch/sse41/codec.c +42 -0
  52. data/vendor/libbase64/lib/arch/sse42/codec.c +42 -0
  53. data/vendor/libbase64/lib/arch/ssse3/codec.c +42 -0
  54. data/vendor/libbase64/lib/arch/ssse3/dec_loop.c +173 -0
  55. data/vendor/libbase64/lib/arch/ssse3/dec_reshuffle.c +33 -0
  56. data/vendor/libbase64/lib/arch/ssse3/enc_loop.c +67 -0
  57. data/vendor/libbase64/lib/arch/ssse3/enc_reshuffle.c +48 -0
  58. data/vendor/libbase64/lib/arch/ssse3/enc_translate.c +33 -0
  59. data/vendor/libbase64/lib/codec_choose.c +281 -0
  60. data/vendor/libbase64/lib/codecs.h +65 -0
  61. data/vendor/libbase64/lib/env.h +67 -0
  62. data/vendor/libbase64/lib/exports.txt +7 -0
  63. data/vendor/libbase64/lib/lib.c +164 -0
  64. data/vendor/libbase64/lib/lib_openmp.c +149 -0
  65. data/vendor/libbase64/lib/tables/.gitignore +1 -0
  66. data/vendor/libbase64/lib/tables/Makefile +17 -0
  67. data/vendor/libbase64/lib/tables/table_dec_32bit.h +393 -0
  68. data/vendor/libbase64/lib/tables/table_enc_12bit.h +1031 -0
  69. data/vendor/libbase64/lib/tables/table_enc_12bit.py +45 -0
  70. data/vendor/libbase64/lib/tables/table_generator.c +184 -0
  71. data/vendor/libbase64/lib/tables/tables.c +40 -0
  72. data/vendor/libbase64/lib/tables/tables.h +23 -0
  73. metadata +67 -6
  74. data/.byebug_history +0 -72
  75. data/.envrc +0 -1
@@ -0,0 +1,264 @@
1
+ # Written in 2016-2017, 2021 by Henrik Steffen Gaßmann henrik@gassmann.onl
2
+ #
3
+ # To the extent possible under law, the author(s) have dedicated all
4
+ # copyright and related and neighboring rights to this software to the
5
+ # public domain worldwide. This software is distributed without any warranty.
6
+ #
7
+ # You should have received a copy of the CC0 Public Domain Dedication
8
+ # along with this software. If not, see
9
+ #
10
+ # http://creativecommons.org/publicdomain/zero/1.0/
11
+ #
12
+ ########################################################################
13
+ cmake_minimum_required(VERSION 3.1)
14
+
15
+ project(base64 LANGUAGES C VERSION 0.4.0)
16
+
17
+ include(GNUInstallDirs)
18
+ include(CMakeDependentOption)
19
+ include(FeatureSummary)
20
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
21
+
22
+ #######################################################################
23
+ # platform detection
24
+ include(TargetArch)
25
+ detect_target_architecture(_TARGET_ARCH)
26
+
27
+
28
+ ###################################################################
29
+ # optional/conditional dependencies
30
+ find_package(OpenMP)
31
+ set_package_properties(OpenMP PROPERTIES
32
+ TYPE OPTIONAL
33
+ PURPOSE "Allows to utilize openmp"
34
+ )
35
+
36
+
37
+ ########################################################################
38
+ # Compilation options
39
+ option(BASE64_BUILD_TESTS "add test projects" ON)
40
+ cmake_dependent_option(BASE64_WITH_OPENMP "use openmp" OFF "OPENMP_FOUND" OFF)
41
+ add_feature_info("OpenMP codec" BASE64_WITH_OPENMP "spreads codec work accross multiple threads")
42
+ cmake_dependent_option(BASE64_REGENERATE_TABLES "regenerate the codec tables" OFF "NOT CMAKE_CROSSCOMPILING" OFF)
43
+
44
+ set(_IS_X86 "\"${_TARGET_ARCH}\" STREQUAL \"x86\" OR \"${_TARGET_ARCH}\" STREQUAL \"x64\"")
45
+ cmake_dependent_option(BASE64_WITH_SSSE3 "add SSSE 3 codepath" ON ${_IS_X86} OFF)
46
+ add_feature_info(SSSE3 BASE64_WITH_SSSE3 "add SSSE 3 codepath")
47
+ cmake_dependent_option(BASE64_WITH_SSE41 "add SSE 4.1 codepath" ON ${_IS_X86} OFF)
48
+ add_feature_info(SSE4.1 BASE64_WITH_SSE41 "add SSE 4.1 codepath")
49
+ cmake_dependent_option(BASE64_WITH_SSE42 "add SSE 4.2 codepath" ON ${_IS_X86} OFF)
50
+ add_feature_info(SSE4.2 BASE64_WITH_SSE42 "add SSE 4.2 codepath")
51
+ cmake_dependent_option(BASE64_WITH_AVX "add AVX codepath" ON ${_IS_X86} OFF)
52
+ add_feature_info(AVX BASE64_WITH_AVX "add AVX codepath")
53
+ cmake_dependent_option(BASE64_WITH_AVX2 "add AVX 2 codepath" ON ${_IS_X86} OFF)
54
+ add_feature_info(AVX2 BASE64_WITH_AVX2 "add AVX2 codepath")
55
+
56
+ set(_IS_ARM "\"${_TARGET_ARCH}\" STREQUAL \"arm\"")
57
+ cmake_dependent_option(BASE64_WITH_NEON32 "add NEON32 codepath" OFF ${_IS_ARM} OFF)
58
+ add_feature_info(NEON32 BASE64_WITH_NEON32 "add NEON32 codepath")
59
+
60
+ set(_IS_ARM64 "\"${_TARGET_ARCH}\" STREQUAL \"arm64\"")
61
+ cmake_dependent_option(BASE64_WITH_NEON64 "add NEON64 codepath" ON ${_IS_ARM64} OFF)
62
+ add_feature_info(NEON64 BASE64_WITH_NEON64 "add NEON64 codepath")
63
+
64
+ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
65
+ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
66
+
67
+ ########################################################################
68
+ # Regenerate headers
69
+
70
+ if (BASE64_REGENERATE_TABLES)
71
+ # Generate tables in build folder and copy to source tree.
72
+ # Don't add the tables in the source tree to the outputs, to avoid `make clean` removing them.
73
+ add_executable(table_generator
74
+ lib/tables/table_generator.c
75
+ )
76
+
77
+ add_custom_command(OUTPUT table_dec_32bit.h "${CMAKE_CURRENT_SOURCE_DIR}/lib/tables/table_dec_32bit.h"
78
+ COMMAND table_generator > table_dec_32bit.h
79
+ COMMAND "${CMAKE_COMMAND}" -E copy table_dec_32bit.h "${CMAKE_CURRENT_SOURCE_DIR}/lib/tables/table_dec_32bit.h"
80
+ DEPENDS table_generator
81
+ )
82
+ set(Python_ADDITIONAL_VERSIONS 3)
83
+ find_package(PythonInterp REQUIRED)
84
+ add_custom_command(OUTPUT table_enc_12bit.h "${CMAKE_CURRENT_SOURCE_DIR}/lib/tables/table_enc_12bit.h"
85
+ COMMAND "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/lib/tables/table_enc_12bit.py" > table_enc_12bit.h
86
+ COMMAND "${CMAKE_COMMAND}" -E copy table_enc_12bit.h "${CMAKE_CURRENT_SOURCE_DIR}/lib/tables/table_enc_12bit.h"
87
+ DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/lib/tables/table_enc_12bit.py"
88
+ )
89
+ endif()
90
+
91
+
92
+ ########################################################################
93
+ # library project
94
+ add_library(base64
95
+ # library files
96
+ lib/lib.c
97
+ lib/codec_choose.c
98
+ include/libbase64.h
99
+
100
+ lib/tables/tables.c
101
+ # Add generated headers explicitly to target, to insert them in the dependency tree
102
+ lib/tables/table_dec_32bit.h
103
+ lib/tables/table_enc_12bit.h
104
+
105
+ # codec implementations
106
+ lib/arch/generic/codec.c
107
+
108
+ lib/arch/ssse3/codec.c
109
+ lib/arch/sse41/codec.c
110
+ lib/arch/sse42/codec.c
111
+ lib/arch/avx/codec.c
112
+ lib/arch/avx2/codec.c
113
+
114
+ lib/arch/neon32/codec.c
115
+ lib/arch/neon64/codec.c
116
+ )
117
+
118
+ target_include_directories(base64
119
+ PUBLIC
120
+ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
121
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
122
+ PRIVATE
123
+ "${CMAKE_CURRENT_BINARY_DIR}"
124
+ )
125
+
126
+ ####################################################################
127
+ # platform/compiler specific configuration
128
+ set_target_properties(base64 PROPERTIES
129
+ C_STANDARD 99
130
+ C_STANDARD_REQUIRED YES
131
+ C_EXTENSIONS OFF
132
+ DEFINE_SYMBOL BASE64_EXPORTS
133
+ VERSION ${PROJECT_VERSION}
134
+ SOVERSION ${PROJECT_VERSION_MAJOR}
135
+ )
136
+
137
+ #generate_export_header(base64)
138
+ # the following definitions and those in libbase64.h have been
139
+ # kept forward compatible in case we ever switch to generate_export_header
140
+ if (BUILD_SHARED_LIBS)
141
+ set_target_properties(base64 PROPERTIES
142
+ C_VISIBILITY_PRESET hidden
143
+ )
144
+ else()
145
+ target_compile_definitions(base64
146
+ PUBLIC
147
+ BASE64_STATIC_DEFINE
148
+ )
149
+ endif()
150
+
151
+ target_compile_options(base64 PRIVATE
152
+ $<$<C_COMPILER_ID:MSVC>:
153
+ /W4
154
+ /WX # All warnings as error
155
+ /we4013 # Error warning C4013: 'function' undefined; assuming extern returning int
156
+ /we4700 # Error warning C4700: uninitialized local variable
157
+ /we4715 # not all control paths return a value
158
+ /we4003 # not enough actual parameters for macro
159
+ /wd4456 # disable warning C4456: declaration of 'xxx' hides previous local declaration
160
+ >
161
+ $<$<NOT:$<C_COMPILER_ID:MSVC>>:
162
+ -Wall
163
+ -Wextra
164
+ -Wpedantic
165
+ -O3
166
+ >
167
+ )
168
+
169
+ target_compile_definitions(base64 PRIVATE
170
+ $<$<C_COMPILER_ID:MSVC>:
171
+ # remove unnecessary warnings about unchecked iterators
172
+ _SCL_SECURE_NO_WARNINGS
173
+ >
174
+ )
175
+
176
+ ########################################################################
177
+ # SIMD settings
178
+ include(TargetSIMDInstructionSet)
179
+ define_SIMD_compile_flags()
180
+
181
+ if (_TARGET_ARCH STREQUAL "x86" OR _TARGET_ARCH STREQUAL "x64")
182
+ macro(configure_codec _TYPE)
183
+ if (BASE64_WITH_${_TYPE})
184
+ message(STATUS "Add codec: lib/arch/${_DIR}/codec.c")
185
+ string(TOLOWER "${_TYPE}" _DIR)
186
+ set_source_files_properties("lib/arch/${_DIR}/codec.c" PROPERTIES
187
+ COMPILE_FLAGS "${COMPILE_FLAGS_${_TYPE}}"
188
+ )
189
+
190
+ if (${ARGC} GREATER 1 AND MSVC)
191
+ set_source_files_properties("lib/arch/${_DIR}/codec.c" PROPERTIES
192
+ COMPILE_DEFINITIONS ${ARGV1}
193
+ )
194
+ endif()
195
+ endif()
196
+ endmacro()
197
+
198
+ configure_codec(SSSE3 __SSSE3__)
199
+ configure_codec(SSE41 __SSSE4_1__)
200
+ configure_codec(SSE42 __SSSE4_2__)
201
+ configure_codec(AVX)
202
+ configure_codec(AVX2)
203
+
204
+ elseif (_TARGET_ARCH STREQUAL "arm")
205
+ set(BASE64_NEON32_CFLAGS "${COMPILE_FLAGS_NEON32}" CACHE STRING "the NEON32 compile flags (for 'lib/arch/neon32/codec.c')")
206
+ mark_as_advanced(BASE64_NEON32_CFLAGS)
207
+
208
+ if (BASE64_WITH_NEON32)
209
+ set_source_files_properties("lib/arch/neon32/codec.c" PROPERTIES
210
+ COMPILE_FLAGS "${BASE64_NEON32_CFLAGS} "
211
+ )
212
+ endif()
213
+
214
+ #elseif (_TARGET_ARCH STREQUAL "arm64" AND BASE64_WITH_NEON64)
215
+
216
+ endif()
217
+
218
+ configure_file("${CMAKE_CURRENT_LIST_DIR}/cmake/config.h.in" "${CMAKE_CURRENT_BINARY_DIR}/config.h" @ONLY)
219
+
220
+ ########################################################################
221
+ # OpenMP Settings
222
+ if (BASE64_WITH_OpenMP)
223
+ target_compile_options(base64
224
+ PRIVATE
225
+ ${OpenMP_C_FLAGS}
226
+ )
227
+ endif()
228
+
229
+ ########################################################################
230
+ if (BASE64_BUILD_TESTS)
231
+ enable_testing()
232
+ add_subdirectory(test)
233
+ endif()
234
+
235
+ ########################################################################
236
+ # cmake install
237
+ install(DIRECTORY include/ TYPE INCLUDE)
238
+ install(TARGETS base64 EXPORT base64-targets)
239
+
240
+ include(CMakePackageConfigHelpers)
241
+ configure_package_config_file(cmake/base64-config.cmake.in
242
+ "${CMAKE_CURRENT_BINARY_DIR}/base64-config.cmake"
243
+
244
+ INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
245
+ )
246
+ write_basic_package_version_file(
247
+ "${CMAKE_CURRENT_BINARY_DIR}/base64-config-version.cmake"
248
+ VERSION ${BASE64_VERSION}
249
+ COMPATIBILITY ExactVersion
250
+ )
251
+
252
+ install(FILES
253
+ "${CMAKE_CURRENT_BINARY_DIR}/base64-config.cmake"
254
+ "${CMAKE_CURRENT_BINARY_DIR}/base64-config-version.cmake"
255
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
256
+ )
257
+
258
+ install(EXPORT base64-targets
259
+ NAMESPACE aklomp::
260
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}"
261
+ )
262
+
263
+ ########################################################################
264
+ feature_summary(WHAT PACKAGES_FOUND PACKAGES_NOT_FOUND ENABLED_FEATURES DISABLED_FEATURES)
@@ -0,0 +1,28 @@
1
+ Copyright (c) 2005-2007, Nick Galbreath
2
+ Copyright (c) 2013-2019, Alfred Klomp
3
+ Copyright (c) 2015-2017, Wojciech Mula
4
+ Copyright (c) 2016-2017, Matthieu Darbois
5
+ All rights reserved.
6
+
7
+ Redistribution and use in source and binary forms, with or without
8
+ modification, are permitted provided that the following conditions are
9
+ met:
10
+
11
+ - Redistributions of source code must retain the above copyright notice,
12
+ this list of conditions and the following disclaimer.
13
+
14
+ - Redistributions in binary form must reproduce the above copyright
15
+ notice, this list of conditions and the following disclaimer in the
16
+ documentation and/or other materials provided with the distribution.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
19
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20
+ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
21
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
24
+ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
25
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
26
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
27
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,93 @@
1
+ CFLAGS += -std=c99 -O3 -Wall -Wextra -pedantic
2
+
3
+ # Set OBJCOPY if not defined by environment:
4
+ OBJCOPY ?= objcopy
5
+
6
+ OBJS = \
7
+ lib/arch/avx2/codec.o \
8
+ lib/arch/generic/codec.o \
9
+ lib/arch/neon32/codec.o \
10
+ lib/arch/neon64/codec.o \
11
+ lib/arch/ssse3/codec.o \
12
+ lib/arch/sse41/codec.o \
13
+ lib/arch/sse42/codec.o \
14
+ lib/arch/avx/codec.o \
15
+ lib/lib.o \
16
+ lib/codec_choose.o \
17
+ lib/tables/tables.o
18
+
19
+ HAVE_AVX2 = 0
20
+ HAVE_NEON32 = 0
21
+ HAVE_NEON64 = 0
22
+ HAVE_SSSE3 = 0
23
+ HAVE_SSE41 = 0
24
+ HAVE_SSE42 = 0
25
+ HAVE_AVX = 0
26
+
27
+ # The user should supply compiler flags for the codecs they want to build.
28
+ # Check which codecs we're going to include:
29
+ ifdef AVX2_CFLAGS
30
+ HAVE_AVX2 = 1
31
+ endif
32
+ ifdef NEON32_CFLAGS
33
+ HAVE_NEON32 = 1
34
+ endif
35
+ ifdef NEON64_CFLAGS
36
+ HAVE_NEON64 = 1
37
+ endif
38
+ ifdef SSSE3_CFLAGS
39
+ HAVE_SSSE3 = 1
40
+ endif
41
+ ifdef SSE41_CFLAGS
42
+ HAVE_SSE41 = 1
43
+ endif
44
+ ifdef SSE42_CFLAGS
45
+ HAVE_SSE42 = 1
46
+ endif
47
+ ifdef AVX_CFLAGS
48
+ HAVE_AVX = 1
49
+ endif
50
+ ifdef OPENMP
51
+ CFLAGS += -fopenmp
52
+ endif
53
+
54
+
55
+ .PHONY: all analyze clean
56
+
57
+ all: bin/base64 lib/libbase64.o
58
+
59
+ bin/base64: bin/base64.o lib/libbase64.o
60
+ $(CC) $(CFLAGS) -o $@ $^
61
+
62
+ lib/libbase64.o: $(OBJS)
63
+ $(LD) -r -o $@ $^
64
+ $(OBJCOPY) --keep-global-symbols=lib/exports.txt $@
65
+
66
+ lib/config.h:
67
+ @echo "#define HAVE_AVX2 $(HAVE_AVX2)" > $@
68
+ @echo "#define HAVE_NEON32 $(HAVE_NEON32)" >> $@
69
+ @echo "#define HAVE_NEON64 $(HAVE_NEON64)" >> $@
70
+ @echo "#define HAVE_SSSE3 $(HAVE_SSSE3)" >> $@
71
+ @echo "#define HAVE_SSE41 $(HAVE_SSE41)" >> $@
72
+ @echo "#define HAVE_SSE42 $(HAVE_SSE42)" >> $@
73
+ @echo "#define HAVE_AVX $(HAVE_AVX)" >> $@
74
+
75
+ $(OBJS): lib/config.h
76
+ $(OBJS): CFLAGS += -Ilib
77
+
78
+ lib/arch/avx2/codec.o: CFLAGS += $(AVX2_CFLAGS)
79
+ lib/arch/neon32/codec.o: CFLAGS += $(NEON32_CFLAGS)
80
+ lib/arch/neon64/codec.o: CFLAGS += $(NEON64_CFLAGS)
81
+ lib/arch/ssse3/codec.o: CFLAGS += $(SSSE3_CFLAGS)
82
+ lib/arch/sse41/codec.o: CFLAGS += $(SSE41_CFLAGS)
83
+ lib/arch/sse42/codec.o: CFLAGS += $(SSE42_CFLAGS)
84
+ lib/arch/avx/codec.o: CFLAGS += $(AVX_CFLAGS)
85
+
86
+ %.o: %.c
87
+ $(CC) $(CFLAGS) -o $@ -c $<
88
+
89
+ analyze: clean
90
+ scan-build --use-analyzer=`which clang` --status-bugs make
91
+
92
+ clean:
93
+ rm -f bin/base64 bin/base64.o lib/libbase64.o lib/config.h $(OBJS)