Browse Source

[Make] Remove the use of wildcards

The use of wildcards in Makefiles for targets is undesirable for tests.
For example, if a file is deleted accidentally, Make doesn't detect it.
What needs to be build should be explicit.

This patch replaces the use of wildcards in tests' Makefiles with
explicitly listed executables.
Isaku Yamahata 4 years ago
parent
commit
8ca30edbfa

+ 16 - 4
LibOS/shim/test/benchmark/Makefile

@@ -1,8 +1,20 @@
-c_executables = $(patsubst %.c,%,$(wildcard *.c))
-cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
+c_executables = \
+	fork_latency \
+	rpc_latency \
+	rpc_latency2 \
+	sig_latency \
+	start \
+	test_start
 
-exec_target = $(c_executables) $(cxx_executables)
-target = $(exec_target) manifest
+cxx_executables =
+
+exec_target = \
+	$(c_executables) \
+	$(cxx_executables)
+
+target = \
+	$(exec_target) \
+	manifest
 
 include ../../../../Scripts/Makefile.configs
 include ../../../../Scripts/Makefile.manifest

+ 22 - 4
LibOS/shim/test/fs/Makefile

@@ -1,9 +1,27 @@
-execs = $(filter-out common common_copy,$(patsubst %.c,%,$(wildcard *.c)))
-copy_execs = $(filter copy_%,$(execs))
-manifests = $(patsubst %.manifest.template,%.manifest,$(wildcard *.manifest.template)) manifest
+copy_execs = \
+	copy_mmap_rev \
+	copy_mmap_seq \
+	copy_mmap_whole \
+	copy_rev \
+	copy_seq \
+	copy_whole
+
+execs = \
+	$(copy_execs) \
+	delete \
+	open_close \
+	read_write \
+	seek_tell \
+	stat \
+	truncate
+
+manifests = manifest
 
 exec_target = $(execs)
-target = $(exec_target) $(manifests)
+
+target = \
+	$(exec_target) \
+	$(manifests)
 
 clean-extra += clean-tmp
 

+ 14 - 4
LibOS/shim/test/inline/Makefile

@@ -1,8 +1,18 @@
-c_executables = $(patsubst %.c,%,$(wildcard *.c))
-cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
+c_executables = \
+	fork \
+	helloworld \
+	vfork
 
-exec_target = $(c_executables) $(cxx_executables)
-target = $(c_executables) $(cxx_executables) manifest
+cxx_executables =
+
+exec_target = \
+	$(c_executables) \
+	$(cxx_executables)
+
+target = \
+	$(c_executables) \
+	$(cxx_executables) \
+	manifest
 
 include ../../../../Scripts/Makefile.configs
 include ../../../../Scripts/Makefile.manifest

+ 68 - 5
LibOS/shim/test/native/Makefile

@@ -1,9 +1,72 @@
-c_executables = $(patsubst %.c,%,$(wildcard *.c))
-cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
-manifests = $(patsubst %.template,%,$(wildcard *.manifest.template)) manifest
+c_executables = \
+	alarm \
+	brk \
+	clone \
+	condvar \
+	cpuinfo \
+	dir \
+	divzero \
+	dup \
+	epoll \
+	epoll_socket \
+	errno \
+	exec_fork \
+	file \
+	fork \
+	fork_bomb \
+	fork_exec \
+	fs \
+	futextest \
+	get_time \
+	helloworld \
+	helloworld_pthread \
+	kill \
+	malloc \
+	meminfo \
+	msg_create \
+	msg_create_libos \
+	msg_send \
+	msg_send_libos \
+	multiproc \
+	multisleep \
+	pause \
+	pid_alloc \
+	pid_kill \
+	pipe \
+	pipe_latency \
+	readdir \
+	rename \
+	script \
+	sem \
+	sleep \
+	socketpair \
+	sqrt \
+	start \
+	sync \
+	system \
+	tcp \
+	test_start_pthread_m \
+	time \
+	vfork \
+	vfork_exec
 
-exec_target = $(c_executables) $(cxx_executables) ls.manifest
-target = $(exec_target) $(manifests)
+cxx_executables =
+
+manifests = \
+	manifest \
+	exec_fork.manifest \
+	ls.manifest \
+	script.manifest \
+	static.manifest
+
+exec_target = \
+	$(c_executables) \
+	$(cxx_executables) \
+	ls.manifest
+
+target = \
+	$(exec_target) \
+	$(manifests)
 
 include ../../../../Scripts/Makefile.configs
 include ../../../../Scripts/Makefile.manifest

+ 89 - 5
LibOS/shim/test/regression/Makefile

@@ -1,9 +1,93 @@
-c_executables = $(patsubst %.c,%,$(wildcard *.c))
-cxx_executables = $(patsubst %.cpp,%,$(wildcard *.cpp))
-manifests = $(patsubst %.manifest.template,%.manifest,$(wildcard *.manifest.template)) manifest
+c_executables = \
+	abort \
+	abort_multithread \
+	bootstrap \
+	bootstrap_pie \
+	bootstrap_static \
+	cpuid \
+	epoll_wait_timeout \
+	eventfd \
+	exec \
+	exec_invalid_args \
+	exec_same \
+	exec_victim \
+	exit \
+	exit_group \
+	fdleak \
+	file_check_policy \
+	file_size \
+	fopen_cornercases \
+	fork_and_exec \
+	fstat_cwd \
+	futex_bitset \
+	futex_requeue \
+	futex_timeout \
+	futex_wake_op \
+	getcwd \
+	getdents \
+	getsockopt \
+	host_root_fs \
+	init_fail \
+	large-mmap \
+	large_dir_read \
+	mmap-file \
+	mprotect_file_fork \
+	multi_pthread \
+	openmp \
+	poll \
+	poll_many_types \
+	ppoll \
+	proc \
+	proc-path \
+	proc_cpuinfo \
+	pselect \
+	readdir \
+	sched \
+	select \
+	shared_object \
+	sigaltstack \
+	sigprocmask \
+	spinlock \
+	stat_invalid_args \
+	str_close_leak \
+	syscall \
+	tcp_ipv6_v6only \
+	tcp_msg_peek \
+	udp \
+	unix \
+	vfork_and_exec
 
-exec_target = $(c_executables) $(cxx_executables) file_check_policy_strict.manifest file_check_policy_allow_all_but_log.manifest
-target = $(exec_target) $(manifests)
+cxx_executables = bootstrap-c++
+
+manifests = \
+	manifest \
+	eventfd.manifest \
+	exec_victim.manifest \
+	exit_group.manifest \
+	file_check_policy_allow_all_but_log.manifest \
+	file_check_policy_strict.manifest \
+	futex_bitset.manifest \
+	futex_requeue.manifest \
+	futex_wake_op.manifest \
+	getdents.manifest \
+	host_root_fs.manifest \
+	init_fail.manifest \
+	large-mmap.manifest \
+	mmap-file.manifest \
+	multi_pthread.manifest \
+	openmp.manifest \
+	proc-path.manifest \
+	shared_object.manifest
+
+exec_target = \
+	$(c_executables) \
+	$(cxx_executables) \
+	file_check_policy_strict.manifest \
+	file_check_policy_allow_all_but_log.manifest
+
+target = \
+	$(exec_target) \
+	$(manifests)
 
 clean-extra += clean-tmp
 

+ 17 - 1
Pal/regression/Makefile

@@ -37,7 +37,23 @@ executables = \
 	Thread2 \
 	normalize_path
 
-manifests   = manifest $(patsubst %.manifest.template,%.manifest,$(wildcard *.manifest.template))
+manifests = \
+	manifest \
+	Attestation.manifest \
+	AvxDisable.manifest \
+	Bootstrap2.manifest \
+	Bootstrap3.manifest \
+	Bootstrap4.manifest \
+	Bootstrap5.manifest \
+	Bootstrap6.manifest \
+	Bootstrap7.manifest \
+	File.manifest \
+	Process.manifest \
+	Process2.manifest \
+	Process3.manifest \
+	SendHandle.manifest \
+	Thread2.manifest \
+	nonelf_binary.manifest
 
 target = $(executables) $(manifests)
 

+ 25 - 4
Pal/test/Makefile

@@ -4,12 +4,33 @@ include ../../Scripts/Makefile.rules
 CFLAGS += -fno-builtin -nostdlib -no-pie \
 	  -I../include/pal -I../include/lib
 
-executables = HelloWorld File Failure Thread Fork Event Process Exception \
-	      Memory Pipe Tcp Udp Yield Server Wait HandleSend Select Segment \
-	      Sleep Pie
+executables = \
+	HelloWorld \
+	File \
+	Failure \
+	Thread \
+	Fork \
+	Event \
+	Process \
+	Exception \
+	Memory \
+	Pipe \
+	Tcp \
+	Udp \
+	Yield \
+	Server \
+	Wait \
+	HandleSend \
+	Select \
+	Segment \
+	Sleep \
+	Pie
+
 manifests = manifest
 
-target = $(executables) $(manifests)
+target = \
+	$(executables) \
+	$(manifests)
 
 include ../../Scripts/Makefile.manifest