ONOS-7059 Port counters in tor.p4 and bmv2/tofino compiler output

Tested on BMv2 and working.

Change-Id: Ia6e4b3c823b0bdfd1671419558e8a350b1d99990
diff --git a/tools/test/p4src/tor/Makefile b/tools/test/p4src/tor/Makefile
new file mode 100644
index 0000000..b5dc8d9
--- /dev/null
+++ b/tools/test/p4src/tor/Makefile
@@ -0,0 +1,32 @@
+BMV2_CPU_PORT=255
+MAVERICKS_CPU_PORT=320
+MONTARA_CPU_PORT=192
+
+MAVERICKS_OPTIONS=-DCPU_PORT=$(MAVERICKS_CPU_PORT)
+MONTARA_OPTIONS=-DCPU_PORT=$(MONTARA_CPU_PORT)
+BMV2_OPTIONS=-DDO_BMV2_BUILD -DCPU_PORT=$(BMV2_CPU_PORT)
+
+all: tor-bmv2 tor-tofino
+
+tor-bmv2: class_id.p4 headers.p4 ipv4_checksum.p4 l3_fwd.p4 \
+			packetio.p4 parser.p4 punt.p4 \
+			spoof_protection.p4 tor.p4 vrf.p4
+	p4c-bm2-ss $(BMV2_OPTIONS) -o p4c-out/tor.json \
+		--p4runtime-file p4c-out/tor.p4info \
+		--p4runtime-format text tor.p4
+
+tor-tofino: class_id.p4 headers.p4 ipv4_checksum.p4 l3_fwd.p4 \
+			packetio.p4 parser.p4 punt.p4 \
+			spoof_protection.p4 tor.p4 vrf.p4
+	p4c -x p4-16 -b tofino-v1model-barefoot \
+		$(MAVERICKS_OPTIONS) -o p4c-out/tofino/tor/mavericks \
+		--p4runtime-file p4c-out/tofino/tor/mavericks/tor.p4info \
+		--p4runtime-format text tor.p4
+	p4c -x p4-16 -b tofino-v1model-barefoot \
+		$(MONTARA_OPTIONS) -o p4c-out/tofino/tor/montara \
+		--p4runtime-file p4c-out/tofino/tor/montara/tor.p4info \
+		--p4runtime-format text tor.p4
+
+clean:
+	rm -rf p4c-out/*.json
+	rm -rf p4c-out/*.p4info