posix: Do not include testcases.h, ptestcases.h in source tree
Commit Message
* Andreas Schwab:
> On Nov 28 2018, Florian Weimer <fweimer@redhat.com> wrote:
>
>> @@ -261,13 +261,15 @@ bug-glob1-ARGS = "$(objpfx)"
>> tst-execvp3-ARGS = --test-dir=$(objpfx)
>> CFLAGS-tst-spawn3.c += -DOBJPFX=\"$(objpfx)\"
>>
>> -testcases.h: TESTS TESTS2C.sed
>> +$(objpfx)testcases.h: TESTS TESTS2C.sed
>> LC_ALL=C sed -f TESTS2C.sed < $< > $@T
>> - mv -f $@T $@
>> + $(move-if-change) $@T $@
>> +$(objpfx)runtests.o: $(objpfx)testcases.h
>
> You should not use move-if-change without a stamp file. But why do you
> need it in the first place?
You are right, mv is just fine here.
What about the patch below? (Actual file removal diff still missing due
to encoding problems.)
Thanks,
Florian
-----
posix: Do not include testcases.h, ptestcases.h in source tree
These files were both auto-generated and shipped in the source tree.
We can assume that sed is available and always generate the files
during the build.
2018-11-29 Florian Weimer <fweimer@redhat.com>
* posix/Makefile (before-compile): Remove testcases.h and
ptestcases.h.
(testcases.h, ptestcases.h): Move to $(objpfx).
(runtests.o): Add dependency on testcases.h.
(runptests.o): Add dependency on ptestcases.h.
* posix/testcases.h, posix/ptestcases.h: Remove files.
* scripts/build-many-glibcs.py (Context.fix_glibc_timestamps): Do
not touch posix/testcases.h and posix/ptestcases.h.
Comments
On Nov 29 2018, Florian Weimer <fweimer@redhat.com> wrote:
> * posix/Makefile (before-compile): Remove testcases.h and
> ptestcases.h.
> (testcases.h, ptestcases.h): Move to $(objpfx).
> (runtests.o): Add dependency on testcases.h.
> (runptests.o): Add dependency on ptestcases.h.
> * posix/testcases.h, posix/ptestcases.h: Remove files.
> * scripts/build-many-glibcs.py (Context.fix_glibc_timestamps): Do
> not touch posix/testcases.h and posix/ptestcases.h.
You need to add them to generated. Ok with that change.
Andreas.
@@ -115,7 +115,7 @@ others := getconf
install-bin := getconf
install-others-programs := $(inst_libexecdir)/getconf
-before-compile += testcases.h ptestcases.h $(objpfx)posix-conf-vars-def.h
+before-compile += $(objpfx)posix-conf-vars-def.h
# So they get cleaned up.
generated += $(addprefix wordexp-test-result, 1 2 3 4 5 6 7 8 9 10) \
@@ -261,13 +261,15 @@ bug-glob1-ARGS = "$(objpfx)"
tst-execvp3-ARGS = --test-dir=$(objpfx)
CFLAGS-tst-spawn3.c += -DOBJPFX=\"$(objpfx)\"
-testcases.h: TESTS TESTS2C.sed
+$(objpfx)testcases.h: TESTS TESTS2C.sed
LC_ALL=C sed -f TESTS2C.sed < $< > $@T
- mv -f $@T $@
+ mv $@T $@
+$(objpfx)runtests.o: $(objpfx)testcases.h
-ptestcases.h: PTESTS PTESTS2C.sed
+$(objpfx)ptestcases.h: PTESTS PTESTS2C.sed
LC_ALL=C sed -f PTESTS2C.sed < $< > $@T
- mv -f $@T $@
+ mv $@T $@
+$(objpfx)runptests.o: $(objpfx)ptestcases.h
$(objpfx)tst-getopt-cancel: $(shared-thread-library)
@@ -846,8 +846,7 @@ class Context(object):
# Some other files have such dependencies but do not need to
# be touched because nothing in a build depends on the files
# in question.
- for f in ('locale/C-translit.h', 'posix/ptestcases.h',
- 'posix/testcases.h', 'sysdeps/gnu/errlist.c',
+ for f in ('locale/C-translit.h', 'sysdeps/gnu/errlist.c',
'sysdeps/mach/hurd/bits/errno.h',
'sysdeps/sparc/sparc32/rem.S',
'sysdeps/sparc/sparc32/sdiv.S',