blob: b5dc8d9ec3f7480955e4ab78901eb7eaf67f0432 [file] [log] [blame]
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