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 71af0d7059d47a199e1d26de6573d6a5038caa30
and commit b852584556bec3750bad7fac984b6fc5af4c870f

Change-Id: I4b5b4dbef5954819632bb625d1914a9ec46e15d9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Edward Welbourne 2022-02-25 12:35:13 +01:00
parent 8b446859de
commit 681bef22a7
4 changed files with 11 additions and 3 deletions

View File

@ -37,6 +37,8 @@
**
****************************************************************************/
// This is a generated file. DO NOT EDIT.
// Please see util/x86simdgen/README.md
#include "qsimd_x86_p.h"
static const char features_string[] =

View File

@ -49,7 +49,7 @@
//
// This is a generated file. DO NOT EDIT.
// Please see 3rdparty/x86simd_generate.pl
// Please see util/x86simdgen/README.md
#ifndef QSIMD_X86_P_H
#define QSIMD_X86_P_H

View File

@ -11,9 +11,14 @@ 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 '/-- implementation start --/,/-- implementation end --/d' $^ | \
sed 's!3rdparty/x86simd_generate\.pl!util/x86simdgen/README.md!' > $@
$(TARGETDIR)/$(TARGETCPP): $(TARGETHEADER) header
(cat header; echo '#include "$(TARGETHEADER)"'; sed '1,/-- implementation start --/d;/-- implementation end --/,$$d' $<) > $@
(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)

View File

@ -47,3 +47,4 @@
//
// We mean it.
//