diff options
Diffstat (limited to '02-usart/genmake.pl')
-rwxr-xr-x | 02-usart/genmake.pl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/02-usart/genmake.pl b/02-usart/genmake.pl index 89403ce..c4165a6 100755 --- a/02-usart/genmake.pl +++ b/02-usart/genmake.pl @@ -87,6 +87,7 @@ foreach $file (@files) { my $obj_files_deps = join(' ', @obj_files); +my @tests_tgts; foreach $file (@test_files) { my $c_file = $file; @@ -98,6 +99,7 @@ foreach $file (@test_files) { my @deps = header_deps($c_file); my $deps_as_join = join(" ", @deps); + push (@test_tgts, "${outbinary}"); print "${outbinary}: $deps_as_join $obj_files_deps test_harness/test_harness.a\n\t"; print "mkdir -p " . dirname($outbinary) . "\n\t"; print '$(CC) $(CFLAGS) -o' . ${outbinary} . ' ' . $c_file . ' ' . $obj_files_deps . " test_harness/test_harness.a\n\n"; @@ -111,6 +113,13 @@ foreach $file (@test_files) { print "test_harness/test_harness.a: test_harness/test_harness.h test_harness/test_harness.c\n\t"; print 'cd test_harness; $(MAKE) test_harness.a; cd ..' . "\n\n"; +print "tests_: " . join(" ", @test_tgts) . "\n\t"; +print "" . join("\n\t", @test_tgts) . "\n\n"; + +print ".PHONY: tests\n"; +print "tests:\n\t"; +print 'PREFIX=$(TEST_PREFIX) CFLAGS="$(TEST_CFLAGS)" $(MAKE) tests_' . "\n\n"; + print "FORCE:\n\t\n\n"; print "$arch_obs_dir/main.elf: FORCE $obj_files_deps linker/linker_script.ld\n\t"; print "([ \"\$\$($idempotency_cmd_make)\" != \"\$(IDEMPOTENCY_HASH)\" ] " |