Simplified Makefile and fixed minor issue with fabric.p4

Change-Id: I8a1dfe5a647b93f5dab133c42e7ffb3910485999
diff --git a/pipelines/fabric-pro/src/main/resources/fabric-compile.sh b/pipelines/fabric-pro/src/main/resources/fabric-compile.sh
new file mode 100755
index 0000000..54830ea
--- /dev/null
+++ b/pipelines/fabric-pro/src/main/resources/fabric-compile.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env bash
+
+set -x
+
+P4_SRC_DIR=$1
+MAVERICKS_OPTIONS=$2
+MONTARA_OPTIONS=$3
+OTHER_PP_FLAGS=$4
+NAME=$5
+
+p4c -x p4-16 -b tofino-v1model-barefoot \
+		-I ${P4_SRC_DIR} \
+		${MAVERICKS_OPTIONS} ${OTHER_PP_FLAGS} -o p4c-out/tofino/${NAME}/mavericks \
+		--p4runtime-file p4c-out/tofino/${NAME}/mavericks/fabric.p4info \
+		--p4runtime-format text main.p4
+	p4c -x p4-16 -b tofino-v1model-barefoot \
+		-I ${P4_SRC_DIR} \
+		${MONTARA_OPTIONS} ${OTHER_PP_FLAGS} -o p4c-out/tofino/${NAME}/montara \
+		--p4runtime-file p4c-out/tofino/${NAME}/montara/fabric.p4info \
+		--p4runtime-format text main.p4
+	sed -i 's/FabricIngress\.//g' p4c-out/tofino/${NAME}/*/*.p4info
+	sed -i 's/FabricEgress\.//g' p4c-out/tofino/${NAME}/*/*.p4info
+	sed -i 's/FabricIngress\.//g' p4c-out/tofino/${NAME}/*/context.json
+	sed -i 's/FabricEgress\.//g' p4c-out/tofino/${NAME}/*/context.json