forked from lya-bjtu/sousuo
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathp4program.am
38 lines (32 loc) · 1.12 KB
/
p4program.am
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
chip_arch=tofino
p4_build_dir = p4-build-$(P4_NAME)-$(chip_arch)
AM_P4FLAGS = $(P4FLAGS)
AM_P4PPFLAGS = $(P4PPFLAGS)
AM_PDFLAGS = $(PDFLAGS)
P4C_COMPILER ?= --with-p4c=$(P4C)
configure.ts.$(chip_arch):
mkdir -p $(p4_build_dir); \
cd $(p4_build_dir); \
$(abs_top_srcdir)/p4-build/configure \
P4C_BM=$(abs_top_srcdir)/../p4c-bmv2/p4c_bm/__main__.py \
P4_NAME=$(P4_NAME) \
P4_PATH=$(P4_MAIN) \
P4_VERSION=$(P4_VERSION) \
P4_ARCHITECTURE=$(P4_ARCHITECTURE) \
P4FLAGS='$(AM_P4FLAGS)' P4PPFLAGS='$(AM_P4PPFLAGS)' PDFLAGS='$(AM_PDFLAGS)' \
--with-$(chip_arch) --enable-thrift $(P4_BUILD_EXTRA_CONFIG_FLAG) \
--with-asan='$(ASAN_CONFIG_VAL)' \
$(P4C_COMPILER) \
--prefix=$(prefix)
all-local: configure.ts.$(chip_arch)
cd $(p4_build_dir) && $(MAKE) $(AM_MAKEFLAGS) all
install-data-local:
cd $(p4_build_dir) && $(MAKE) $(AM_MAKEFLAGS) install-data
install-exec-local:
cd $(p4_build_dir) && $(MAKE) $(AM_MAKEFLAGS) install-exec
clean-local:
rm -rf $(p4_build_dir)
rm -f configure.ts.$(chip_arch)
# Makefile targets for the P4 program.
$(P4_NAME)-install-local: install
$(P4_NAME)-local: all