Minor refactoring for fabric.p4
Change-Id: I736b20fc95b4a03afa1074eb777a23507530b44f
diff --git a/pipelines/fabric/src/main/resources/Makefile b/pipelines/fabric/src/main/resources/Makefile
index 4ff94e0..f11de1b 100644
--- a/pipelines/fabric/src/main/resources/Makefile
+++ b/pipelines/fabric/src/main/resources/Makefile
@@ -1,10 +1,22 @@
-all: fabric.json
+BMV2_CPU_PORT=255
-fabric.json: fabric.p4
- p4c-bm2-ss -o p4c-out/bmv2/fabric.json \
- --p4runtime-file p4c-out/bmv2/fabric.p4info --p4runtime-format text \
- fabric.p4
+BMV2_OPTIONS=-DTARGET_BMV2
+
+all: bmv2
+
+bmv2:
+ p4c -v -x p4-16 -b bmv2-ss-p4org \
+ $(BMV2_OPTIONS) -o p4c-out/bmv2 \
+ --p4runtime-file p4c-out/bmv2/fabric.p4info \
+ --p4runtime-format text fabric.p4
+ mv p4c-out/bmv2/fabric.p4rt p4c-out/bmv2/fabric.p4info
+ rm -f p4c-out/bmv2/fabric.p4i
+
+custom:
+ p4c -v -x p4-16 -b $(BACKEND) \
+ $(BACKEND_OPTIONS) -o p4c-out/$(BACKEND) \
+ --p4runtime-file p4c-out/$(BACKEND)/fabric.p4info \
+ --p4runtime-format text fabric.p4
clean:
- rm -rf p4c-out/bmv2/*.json
- rm -rf p4c-out/bmv2/*.p4info
+ rm -rf p4c-out/*