toolchain-tests: update the Makefile to always run compilation tests

We had to explicitly run `make check` here in order to get compile-time
checks, which we aren't currently doing. Since it's easy for these
diagnostic tests to accidentally break, and they have all of the same
dependencies as the test file's, fold these tests into the rules for
object file generation.

We could theoretically get slightly better parallelism by breaking these
out, but it takes <1 second for this to finish, so simplicity is
probably the thing to shoot for here.

BUG=chromium:1159199
TEST=emerge-amd64-generic chromeos-base/toolchain-tests with broken
     diagnostic tests.

Change-Id: I452a6bdf0859c653266e85d125dcaaa5cae24c6d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/autotest/+/2594294
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Commit-Queue: George Burgess <gbiv@chromium.org>
Tested-by: George Burgess <gbiv@chromium.org>
diff --git a/client/site_tests/platform_ToolchainTests/src/Makefile b/client/site_tests/platform_ToolchainTests/src/Makefile
index 36c2e57..bd7e67d 100644
--- a/client/site_tests/platform_ToolchainTests/src/Makefile
+++ b/client/site_tests/platform_ToolchainTests/src/Makefile
@@ -17,10 +17,15 @@
                        clang-fortify-tests-2.o
 	$(CXX) $(LDFLAGS) -o $@ $+
 
+# Test FORTIFY diagnostics in the same target as generating the .o file for
+# convenience. Testing diagnostics takes <1sec, and these tests silently fell
+# off the radar before (crbug.com/1159199).
 clang-fortify-tests-1.o: $(fortify-test-src)
+	$(fortify-cxx) $(fortify-diag-flags) -D_FORTIFY_SOURCE=1
 	$(fortify-cxx) $(fortify-runtime-flags) -c -D_FORTIFY_SOURCE=1 -o $@
 
 clang-fortify-tests-2.o: $(fortify-test-src)
+	$(fortify-cxx) $(fortify-diag-flags) -D_FORTIFY_SOURCE=2
 	$(fortify-cxx) $(fortify-runtime-flags) -c -D_FORTIFY_SOURCE=2 -o $@
 
 clean:
@@ -31,7 +36,3 @@
 	install -m 0755 toolchain-tests $(DESTDIR)/usr/local/bin
 	install -m 0755 fortify-runtime-tests $(DESTDIR)/usr/local/bin
 
-.PHONY: check
-check:
-	$(fortify-cxx) $(fortify-diag-flags) -D_FORTIFY_SOURCE=1
-	$(fortify-cxx) $(fortify-diag-flags) -D_FORTIFY_SOURCE=2