resources: Fixed square build documentation

Square needs to be built via the `gcn-gpu` docker image. Previously the
README.md falsely claimed it could be built by installing the ROCM
compiler.

This commit also cleans-up the `src/square/Makefile` and added the
`src/square/bin` directory to `src/square/.gitignore`.

Change-Id: Ia808e2a2d1c15d51e7eec8e76d77705a07dd9bf8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5-resources/+/33555
Reviewed-by: Kyle Roarty <kyleroarty1716@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: Jason Lowe-Power <power.jg@gmail.com>
diff --git a/README.md b/README.md
index ed7018f..d53a2b3 100755
--- a/README.md
+++ b/README.md
@@ -334,15 +334,11 @@
 
 ## Compilation
 
-To compile Square the [ROCM HIPCC Compiler](
-https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html)
-must be installed.
-
 To compile:
 
 ```
 cd src/square
-make gfx8-apu
+docker run --rm -v ${PWD}:${PWD} -w ${PWD} -u $UID:$GID gcr.io/gem5-test/gcn-gpu make gfx8-apu
 ```
 
 The compiled binary can be found in `src/square/bin`
diff --git a/src/square/.gitignore b/src/square/.gitignore
new file mode 100644
index 0000000..ba077a4
--- /dev/null
+++ b/src/square/.gitignore
@@ -0,0 +1 @@
+bin
diff --git a/src/square/Makefile b/src/square/Makefile
index 5d7f226..4f4eb82 100644
--- a/src/square/Makefile
+++ b/src/square/Makefile
@@ -3,7 +3,9 @@
 
 BIN_DIR?= ./bin
 
-gfx8-apu: square.cpp $(BIN_DIR)
+gfx8-apu: $(BIN_DIR)/square.o
+
+$(BIN_DIR)/square.o: square.cpp $(BIN_DIR)
 	$(HIPCC) --amdgpu-target=gfx801 $(CXXFLAGS) square.cpp -o $(BIN_DIR)/square.o
 
 $(BIN_DIR):