summaryrefslogtreecommitdiff
path: root/vendor/github.com/bytedance/sonic/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/bytedance/sonic/Makefile')
-rw-r--r--vendor/github.com/bytedance/sonic/Makefile15
1 files changed, 10 insertions, 5 deletions
diff --git a/vendor/github.com/bytedance/sonic/Makefile b/vendor/github.com/bytedance/sonic/Makefile
index c672c313e..69b8e11f1 100644
--- a/vendor/github.com/bytedance/sonic/Makefile
+++ b/vendor/github.com/bytedance/sonic/Makefile
@@ -23,9 +23,9 @@ CPU_avx := amd64
CPU_avx2 := amd64
CPU_sse := amd64
-TMPL_avx := fastint_amd64_test fastfloat_amd64_test native_amd64_test recover_amd64_test
-TMPL_avx2 := fastint_amd64_test fastfloat_amd64_test native_amd64_test recover_amd64_test
-TMPL_sse := fastint_amd64_test fastfloat_amd64_test native_amd64_test recover_amd64_test
+TMPL_avx := native_test fastint_test fastfloat_test native_amd64 recover_test
+TMPL_avx2 := native_test fastint_test fastfloat_test native_amd64 recover_test
+TMPL_sse := native_test fastint_test fastfloat_test native_amd64 recover_test
CFLAGS_avx := -msse -mno-sse4 -mavx -mpclmul -mno-avx2 -mstack-alignment=0 -DUSE_AVX=1 -DUSE_AVX2=0
CFLAGS_avx2 := -msse -mno-sse4 -mavx -mpclmul -mavx2 -mstack-alignment=0 -DUSE_AVX=1 -DUSE_AVX2=1
@@ -54,10 +54,14 @@ define build_tmpl
$(eval @arch := $(1))
$(eval @tmpl := $(2))
$(eval @dest := $(3))
+ $(eval @cpu := $(4))
${@dest}: ${@tmpl}
mkdir -p $(dir ${@dest})
- echo '// Code generated by Makefile, DO NOT EDIT.' > ${@dest}
+ echo '// +build ${@cpu}' > ${@dest}
+ echo >> ${@dest}
+ echo >> ${@dest}
+ echo '// Code generated by Makefile, DO NOT EDIT.' >> ${@dest}
echo >> ${@dest}
sed -e 's/{{PACKAGE}}/${@arch}/g' ${@tmpl} >> ${@dest}
endef
@@ -91,7 +95,8 @@ $(foreach \
build_tmpl, \
$(1), \
${OUT_DIR}/${tmpl}.tmpl, \
- ${OUT_DIR}/$(1)/${tmpl}.go \
+ ${OUT_DIR}/$(1)/${tmpl}.go, \
+ $(value CPU_$(1)) \
)) \
)
endef