selftests/x86: Add <test_name>{,_32,_64} targets
authorDmitry Safonov <dima@arista.com>
Thu, 18 Jan 2018 22:26:25 +0000 (22:26 +0000)
committerShuah Khan <shuahkh@osg.samsung.com>
Tue, 23 Jan 2018 14:46:55 +0000 (07:46 -0700)
commitcc08d1b91d1e0679d015bf7a99aedb28e2c89e12
treeed4f6f280f5a5a3f93a2a5219688c6ab98d3ac48
parent14f1889fd4d7ea1f496e90ae055ecc086575a8cd
selftests/x86: Add <test_name>{,_32,_64} targets

One can only use `make all` or `make <test_name>_<bitness>`
as make targets.
`make <test_name>` doesn't work as Ingo noticed:
  x86> make test_vsyscall
  gcc -O2 -g -std=gnu99 -pthread -Wall -no-pie test_vsyscall.c -o test_vsyscall
  /tmp/aBaoo3nb.o: In function `init_vdso':
  test_vsyscall.c:68: undefined reference to `dlopen'
  test_vsyscall.c:76: undefined reference to `dlsym'
  test_vsyscall.c:80: undefined reference to `dlsym'
  test_vsyscall.c:84: undefined reference to `dlsym'
  test_vsyscall.c:88: undefined reference to `dlsym'
  test_vsyscall.c:70: undefined reference to `dlopen'
  collect2: error: ld returned 1 exit status
  <builtin>: recipe for target 'test_vsyscall' failed
  make: *** [test_vsyscall] Error 1

Makefile target substitution neither works :-/

Generate .PHONY targets per-test and fix target substitution.

Cc: Andy Lutomirski <luto@kernel.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Shuah Khan <shuah@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kselftest@vger.kernel.org
Cc: x86@kernel.org
Reported-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Dmitry Safonov <dima@arista.com>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
tools/testing/selftests/x86/Makefile