qt5base-lts/util/x86simdgen/Makefile
Edward Welbourne 681bef22a7 Fix generation of qsimd_x86 files to require no hand-editing
Recent fixes to include the "We mean it" comment in the header also
lead to that comment appearing in the generated .cpp file, which also
lacked the "This is a generated file. DO NOT EDIT." comment. The
generated header also lacked a blank line after the "We mean it"
comment, so include that (and take it out, too, in the .cpp). The
"Please see" line of the "DO NOT EDIT" comment also used the name of
the generator script as seen from the Makefile that drives the
regeneration; replace this with the README.md file that actually
explains how to regenerate the files in corelib/global/.

This amends commit 71af0d7059
and commit b852584556

Change-Id: I4b5b4dbef5954819632bb625d1914a9ec46e15d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-04-07 23:04:04 +02:00

25 lines
971 B
Makefile

GENERATOR = 3rdparty/x86simd_generate.pl
TARGETDIR = ../../src/corelib/global/
TARGETCPP = qsimd_x86.cpp
TARGETHEADER = qsimd_x86_p.h
CONF_FILES = 3rdparty/simd-intel.conf
# We don't currently use any feature from simd-amd.conf
# CONF_FILES += 3rdparty/simd-amd.conf
all: $(TARGETDIR)/$(TARGETHEADER) $(TARGETDIR)/$(TARGETCPP)
$(TARGETHEADER): $(CONF_FILES) | $(GENERATOR)
cat $^ | perl $(GENERATOR) /dev/stdin $@ > $@
$(TARGETDIR)/$(TARGETHEADER): header $(TARGETHEADER)
sed '/-- implementation start --/,/-- implementation end --/d' $^ | \
sed 's!3rdparty/x86simd_generate\.pl!util/x86simdgen/README.md!' > $@
$(TARGETDIR)/$(TARGETCPP): $(TARGETHEADER) header
(cat header | grep -v '^//' | grep .; echo; \
echo '// This is a generated file. DO NOT EDIT.'; \
echo '// Please see util/x86simdgen/README.md'; \
echo '#include "$(TARGETHEADER)"'; \
sed '1,/-- implementation start --/d;/-- implementation end --/,$$d' $<) > $@
clean:
-$(RM) $(TARGETHEADER)