forked from p4lang/p4c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.am
127 lines (104 loc) · 4.26 KB
/
Makefile.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Copyright 2013-present Barefoot Networks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ACLOCAL_AMFLAGS = -I m4
AM_CPPFLAGS = -I$(srcdir)/frontends -I$(srcdir)/backends -I$(srcdir)/extensions -Wall -Wextra \
-Wno-overloaded-virtual -Wno-deprecated
AM_YFLAGS = -v
TOOLSDIR=$(srcdir)/tools
GENTESTS=$(TOOLSDIR)/gen-tests.py
GEN_UNIFIED_MAKEFILE=$(TOOLSDIR)/gen-unified-makefile.py
GEN_UNIFIED_CPP=$(TOOLSDIR)/gen-unified-sources.py
.l.c:
$(LEX.l) $< > $@
# Variables that are appended to in sub-Makefiles
# Please use += to add values to these variables
# The first 7 are standard automake variables
CLEANFILES = # Files to remove on clean
bin_PROGRAMS = # Binaries built
noinst_HEADERS = # Headers that are not installed
noinst_LIBRARIES = # Static libraries built
noinst_PROGRAMS = # Binaries built that are not installed
BUILT_SOURCES = # Generated source files
TESTS = # Tests to execute
XFAIL_TESTS = $(IFAIL_TESTS) # Tests that are supposed to fail
IFAIL_TESTS = # intermittent failures
export XFAIL_TESTS
export IFAIL_TESTS
cpplint_FILES = # Files that should be passed to cpplint (and etags)
ir_DEF_FILES = # Files that generate the IR
extension_frontend_SOURCES = # Files added to libfrontend by extensions
include $(srcdir)/lib/Makefile.am
include $(srcdir)/tools/ir-generator/Makefile.am
include $(srcdir)/ir/Makefile.am
include $(srcdir)/frontends/Makefile.am
include $(srcdir)/midend/Makefile.am
# The following files are generated by scripts.
include $(srcdir)/otherMakefiles.am
$(srcdir)/otherMakefiles.am: $(srcdir)/backends $(srcdir)/extensions $(wildcard $(srcdir)/backends/*/Makefile.am $(srcdir)/extensions/*/Makefile.am)
cd $(srcdir); ./find-makefiles.sh
include $(srcdir)/unified-compilation.am
include $(srcdir)/regenerate-unified-compilation.am
######## Generate C++ IR files from *.def files using ir-generator
# make is very stupid regarding multiple files generated from the same source
# this pattern ensures that parallel builds continue to work
ir/ir-generated.h: irgenerator $(ir_DEF_FILES)
./irgenerator -t ir/gen-tree-macro.h -i ir/ir-generated.cpp $(ir_DEF_FILES) >$@ || ( rm $@ && false )
@$(srcdir)/tools/fixup-line-directives $@ >[email protected]
@mv [email protected] $@
ir/gen-tree-macro.h: ir/ir-generated.h
@$(srcdir)/tools/fixup-line-directives $@ >[email protected]
@mv [email protected] $@
ir/ir-generated.cpp: ir/ir-generated.h
@$(srcdir)/tools/fixup-line-directives $@ >[email protected]
@mv [email protected] $@
BUILT_SOURCES += \
ir/ir-generated.h \
ir/ir-generated.cpp \
ir/gen-tree-macro.h
################
# Front-end library
noinst_LIBRARIES += libfrontend.a
libfrontend_a_SOURCES = \
setup.h \
setup.cpp \
$(frontend_SOURCES) \
$(midend_SOURCES) \
$(ir_SOURCES) \
ir/ir-generated.cpp \
$(extension_frontend_SOURCES)
# unit tests
include $(srcdir)/test/Makefile.am
# Lint all header files.
cpplint_FILES += $(noinst_HEADERS)
################ Misc custom targets
install:
echo "Installation not yet supported."
clean-local:
-rm -f $(BUILT_SOURCES) $(CLEANFILES)
cpplint:
@cd $(srcdir); tools/cpplint.py --root=. --extensions=h,hpp,c,cpp,ypp,l $(sort $(cpplint_FILES))
tags:
cd $(srcdir); ctags -R --langmap=C++:+.def,Flex:+.l,YACC:+.ypp \
backends extensions frontends ir lib tools midend
cd $(srcdir)/tools/ir-generator; ctags -R --langmap=Flex:+.l,YACC:+.ypp \
. ../../lib
etags:
cd $(srcdir); ctags -e -R --langmap=C++:+.def,Flex:+.l,YACC:+.ypp \
backends extensions frontends ir lib tools midend
cd $(srcdir)/tools/ir-generator; ctags -e -R --langmap=Flex:+.l,YACC:+.ypp \
. ../../lib
check-%:
@$(MAKE) check TESTS="$(filter $*/%, $(TESTS) $(EXTRA_TESTS))"
recheck-%:
@$(MAKE) recheck TESTS="$(filter $*/%, $(TESTS) $(EXTRA_TESTS))"