blob: 76323c2a8caadc89508715725b45c801789b56e6 [file] [log] [blame]
P4_SRC_DIR=$(ONOS_ROOT)/pipelines/fabric/src/main/resources
MAVERICKS_CPU_PORT=320
MONTARA_CPU_PORT=192
MAVERICKS_OPTIONS=-DCPU_PORT=$(MAVERICKS_CPU_PORT)
MONTARA_OPTIONS=-DCPU_PORT=$(MONTARA_CPU_PORT)
all: fabric-tofino fabric-spgw-tofino
int: fabric-int-tofino fabric-spgw-int-tofino
fabric-tofino:
p4c -x p4-16 -b tofino-v1model-barefoot \
-I $(P4_SRC_DIR) \
$(MAVERICKS_OPTIONS) -o p4c-out/tofino/fabric/mavericks \
--p4runtime-file p4c-out/tofino/fabric/mavericks/fabric.p4info \
--p4runtime-format text main.p4
p4c -x p4-16 -b tofino-v1model-barefoot \
-I $(P4_SRC_DIR) \
$(MONTARA_OPTIONS) -o p4c-out/tofino/fabric/montara \
--p4runtime-file p4c-out/tofino/fabric/montara/fabric.p4info \
--p4runtime-format text main.p4
fabric-spgw-tofino:
p4c -x p4-16 -b tofino-v1model-barefoot \
-I $(P4_SRC_DIR) \
$(MAVERICKS_OPTIONS) -DWITH_SPGW -o p4c-out/tofino/fabric-spgw/mavericks \
--p4runtime-file p4c-out/tofino/fabric-spgw/mavericks/fabric.p4info \
--p4runtime-format text main.p4
p4c -x p4-16 -b tofino-v1model-barefoot \
-I $(P4_SRC_DIR) \
$(MONTARA_OPTIONS) -DWITH_SPGW -o p4c-out/tofino/fabric-spgw/montara \
--p4runtime-file p4c-out/tofino/fabric-spgw/montara/fabric.p4info \
--p4runtime-format text main.p4
fabric-spgw-int-tofino: fabric-spgw-int-1-tofino fabric-spgw-int-2-tofino
fabric-spgw-int-1-tofino:
p4c -x p4-16 -b tofino-v1model-barefoot \
-I $(P4_SRC_DIR) \
$(MAVERICKS_OPTIONS) -DWITH_SPGW -DWITH_INT_TRANSIT -DINT_SWITCH_ID=100 -o p4c-out/tofino/fabric-spgw-int-1/mavericks \
--p4runtime-file p4c-out/tofino/fabric-spgw-int-1/mavericks/fabric.p4info \
--p4runtime-format text main.p4
p4c -x p4-16 -b tofino-v1model-barefoot \
-I $(P4_SRC_DIR) \
$(MONTARA_OPTIONS) -DWITH_SPGW -DWITH_INT_TRANSIT -DINT_SWITCH_ID=100 -o p4c-out/tofino/fabric-spgw-int-1/montara \
--p4runtime-file p4c-out/tofino/fabric-spgw-int-1/montara/fabric.p4info \
--p4runtime-format text main.p4
sed -i 's/FabricIngress\.//g' p4c-out/tofino/fabric-spgw-int-1/*/*.p4info
sed -i 's/FabricEgress\.//g' p4c-out/tofino/fabric-spgw-int-1/*/*.p4info
sed -i 's/FabricIngress\.//g' p4c-out/tofino/fabric-spgw-int-1/*/context.json
sed -i 's/FabricEgress\.//g' p4c-out/tofino/fabric-spgw-int-1/*/context.json
fabric-spgw-int-2-tofino:
p4c -x p4-16 -b tofino-v1model-barefoot \
-I $(P4_SRC_DIR) \
$(MAVERICKS_OPTIONS) -DWITH_SPGW -DWITH_INT_TRANSIT -DINT_SWITCH_ID=200 -o p4c-out/tofino/fabric-spgw-int-2/mavericks \
--p4runtime-file p4c-out/tofino/fabric-spgw-int-2/mavericks/fabric.p4info \
--p4runtime-format text main.p4
p4c -x p4-16 -b tofino-v1model-barefoot \
-I $(P4_SRC_DIR) \
$(MONTARA_OPTIONS) -DWITH_SPGW -DWITH_INT_TRANSIT -DINT_SWITCH_ID=200 -o p4c-out/tofino/fabric-spgw-int-2/montara \
--p4runtime-file p4c-out/tofino/fabric-spgw-int-2/montara/fabric.p4info \
--p4runtime-format text main.p4
sed -i 's/FabricIngress\.//g' p4c-out/tofino/fabric-spgw-int-2/*/*.p4info
sed -i 's/FabricEgress\.//g' p4c-out/tofino/fabric-spgw-int-2/*/*.p4info
sed -i 's/FabricIngress\.//g' p4c-out/tofino/fabric-spgw-int-2/*/context.json
sed -i 's/FabricEgress\.//g' p4c-out/tofino/fabric-spgw-int-2/*/context.json
fabric-int-tofino:
p4c -x p4-16 -b tofino-v1model-barefoot \
-I $(P4_SRC_DIR) \
$(MAVERICKS_OPTIONS) -DWITH_INT_TRANSIT -o p4c-out/tofino/fabric-int/mavericks \
--p4runtime-file p4c-out/tofino/fabric-int/mavericks/fabric.p4info \
--p4runtime-format text main.p4
p4c -x p4-16 -b tofino-v1model-barefoot \
-I $(P4_SRC_DIR) \
$(MONTARA_OPTIONS) -DWITH_INT_TRANSIT -o p4c-out/tofino/fabric-int/montara \
--p4runtime-file p4c-out/tofino/fabric-int/montara/fabric.p4info \
--p4runtime-format text main.p4
clean:
rm -rf p4c-out/*