Makefile.common 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983
  1. # -*- mode: makefile -*-
  2. # The first line sets the emacs major mode to Makefile
  3. # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
  4. # SPDX-License-Identifier: MIT-0
  5. CBMC_STARTER_KIT_VERSION = CBMC starter kit 2.8
  6. ################################################################
  7. # The CBMC Starter Kit depends on the files Makefile.common and
  8. # run-cbmc-proofs.py. They are installed by the setup script
  9. # cbmc-starter-kit-setup and updated to the latest version by the
  10. # update script cbmc-starter-kit-update. For more information about
  11. # the starter kit and these files and these scripts, see
  12. # https://model-checking.github.io/cbmc-starter-kit
  13. #
  14. # Makefile.common implements what we consider to be some best
  15. # practices for using cbmc for software verification.
  16. #
  17. # Section I gives default values for a large number of Makefile
  18. # variables that control
  19. # * how your code is built (include paths, etc),
  20. # * what program transformations are applied to your code (loop
  21. # unwinding, etc), and
  22. # * what properties cbmc checks for in your code (memory safety, etc).
  23. #
  24. # These variables are defined below with definitions of the form
  25. # VARIABLE ?= DEFAULT_VALUE
  26. # meaning VARIABLE is set to DEFAULT_VALUE if VARIABLE has not already
  27. # been given a value.
  28. #
  29. # For your project, you can override these default values with
  30. # project-specific definitions in Makefile-project-defines.
  31. #
  32. # For any individual proof, you can override these default values and
  33. # project-specific values with proof-specific definitions in the
  34. # Makefile for your proof.
  35. #
  36. # The definitions in the proof Makefile override definitions in the
  37. # project Makefile-project-defines which override definitions in this
  38. # Makefile.common.
  39. #
  40. # Section II uses the values defined in Section I to build your code, run
  41. # your proof, and build a report of your results. You should not need
  42. # to modify or override anything in Section II, but you may want to
  43. # read it to understand how the values defined in Section I control
  44. # things.
  45. #
  46. # To use Makefile.common, set variables as described above as needed,
  47. # and then for each proof,
  48. #
  49. # * Create a subdirectory <DIR>.
  50. # * Write a proof harness (a function) with the name <HARNESS_ENTRY>
  51. # in a file with the name <DIR>/<HARNESS_FILE>.c
  52. # * Write a makefile with the name <DIR>/Makefile that looks
  53. # something like
  54. #
  55. # HARNESS_FILE=<HARNESS_FILE>
  56. # HARNESS_ENTRY=<HARNESS_ENTRY>
  57. # PROOF_UID=<PROOF_UID>
  58. #
  59. # PROJECT_SOURCES += $(SRCDIR)/libraries/api_1.c
  60. # PROJECT_SOURCES += $(SRCDIR)/libraries/api_2.c
  61. #
  62. # PROOF_SOURCES += $(PROOFDIR)/harness.c
  63. # PROOF_SOURCES += $(SRCDIR)/cbmc/proofs/stub_a.c
  64. # PROOF_SOURCES += $(SRCDIR)/cbmc/proofs/stub_b.c
  65. #
  66. # UNWINDSET += foo.0:3
  67. # UNWINDSET += bar.1:6
  68. #
  69. # REMOVE_FUNCTION_BODY += api_stub_a
  70. # REMOVE_FUNCTION_BODY += api_stub_b
  71. #
  72. # DEFINES = -DDEBUG=0
  73. #
  74. # include ../Makefile.common
  75. #
  76. # * Change directory to <DIR> and run make
  77. #
  78. # The proof setup script cbmc-starter-kit-setup-proof from the CBMC
  79. # Starter Kit will do most of this for, creating a directory and
  80. # writing a basic Makefile and proof harness into it that you can edit
  81. # as described above.
  82. #
  83. # Warning: If you get results that are hard to explain, consider
  84. # running "make clean" or "make veryclean" before "make" if you get
  85. # results that are hard to explain. Dependency handling in this
  86. # Makefile.common may not be perfect.
  87. SHELL=/bin/bash
  88. default: report
  89. ################################################################
  90. ################################################################
  91. ## Section I: This section gives common variable definitions.
  92. ##
  93. ## Override these definitions in Makefile-project-defines or
  94. ## your proof Makefile.
  95. ##
  96. ## Remember that Makefile.common and Makefile-project-defines are
  97. ## included into the proof Makefile in your proof directory, so all
  98. ## relative pathnames defined there should be relative to your proof
  99. ## directory.
  100. ################################################################
  101. # Define the layout of the source tree and the proof subtree
  102. #
  103. # Generally speaking,
  104. #
  105. # SRCDIR = the root of the repository
  106. # CBMC_ROOT = /srcdir/cbmc
  107. # PROOF_ROOT = /srcdir/cbmc/proofs
  108. # PROOF_SOURCE = /srcdir/cbmc/sources
  109. # PROOF_INCLUDE = /srcdir/cbmc/include
  110. # PROOF_STUB = /srcdir/cbmc/stubs
  111. # PROOFDIR = the directory containing the Makefile for your proof
  112. #
  113. # The path /srcdir/cbmc used in the example above is determined by the
  114. # setup script cbmc-starter-kit-setup. Projects usually create a cbmc
  115. # directory somewhere in the source tree, and run the setup script in
  116. # that directory. The value of CBMC_ROOT becomes the absolute path to
  117. # that directory.
  118. #
  119. # The location of that cbmc directory in the source tree affects the
  120. # definition of SRCDIR, which is defined in terms of the relative path
  121. # from a proof directory to the repository root. The definition is
  122. # usually determined by the setup script cbmc-starter-kit-setup and
  123. # written to Makefile-template-defines, but you can override it for a
  124. # project in Makefile-project-defines and for a specific proof in the
  125. # Makefile for the proof.
  126. # Absolute path to the directory containing this Makefile.common
  127. # See https://ftp.gnu.org/old-gnu/Manuals/make-3.80/html_node/make_17.html
  128. #
  129. # Note: We compute the absolute paths to the makefiles in MAKEFILE_LIST
  130. # before we filter the list of makefiles for %/Makefile.common.
  131. # Otherwise an invocation of the form "make -f Makefile.common" will set
  132. # MAKEFILE_LIST to "Makefile.common" which will fail to match the
  133. # pattern %/Makefile.common.
  134. #
  135. MAKEFILE_PATHS = $(foreach makefile,$(MAKEFILE_LIST),$(abspath $(makefile)))
  136. PROOF_ROOT = $(dir $(filter %/Makefile.common,$(MAKEFILE_PATHS)))
  137. CBMC_ROOT = $(shell dirname $(PROOF_ROOT))
  138. PROOF_SOURCE = $(CBMC_ROOT)/sources
  139. PROOF_INCLUDE = $(CBMC_ROOT)/include
  140. PROOF_STUB = $(CBMC_ROOT)/stubs
  141. # Project-specific definitions to override default definitions below
  142. # * Makefile-project-defines will never be overwritten
  143. # * Makefile-template-defines may be overwritten when the starter
  144. # kit is updated
  145. sinclude $(PROOF_ROOT)/Makefile-project-defines
  146. sinclude $(PROOF_ROOT)/Makefile-template-defines
  147. # SRCDIR is the path to the root of the source tree
  148. # This is a default definition that is frequently overridden in
  149. # another Makefile, see the discussion of SRCDIR above.
  150. SRCDIR ?= $(abspath ../..)
  151. # PROOFDIR is the path to the directory containing the proof harness
  152. PROOFDIR ?= $(abspath .)
  153. ################################################################
  154. # Define how to run CBMC
  155. # Do property checking with the external SAT solver given by
  156. # EXTERNAL_SAT_SOLVER. Do coverage checking with the default solver,
  157. # since coverage checking requires the use of an incremental solver.
  158. # The EXTERNAL_SAT_SOLVER variable is typically set (if it is at all)
  159. # as an environment variable or as a makefile variable in
  160. # Makefile-project-defines.
  161. #
  162. # For a particular proof, if the default solver is faster, do property
  163. # checking with the default solver by including this definition in the
  164. # proof Makefile:
  165. # USE_EXTERNAL_SAT_SOLVER =
  166. #
  167. ifneq ($(strip $(EXTERNAL_SAT_SOLVER)),)
  168. USE_EXTERNAL_SAT_SOLVER ?= --external-sat-solver $(EXTERNAL_SAT_SOLVER)
  169. endif
  170. CHECKFLAGS += $(USE_EXTERNAL_SAT_SOLVER)
  171. # Job pools
  172. # For version of Litani that are new enough (where `litani print-capabilities`
  173. # prints "pools"), proofs for which `EXPENSIVE = true` is set can be added to a
  174. # "job pool" that restricts how many expensive proofs are run at a time. All
  175. # other proofs will be built in parallel as usual.
  176. #
  177. # In more detail: all compilation, instrumentation, and report jobs are run with
  178. # full parallelism as usual, even for expensive proofs. The CBMC jobs for
  179. # non-expensive proofs are also run in parallel. The only difference is that the
  180. # CBMC safety checks and coverage checks for expensive proofs are run with a
  181. # restricted parallelism level. At any one time, only N of these jobs are run at
  182. # once, amongst all the proofs.
  183. #
  184. # To configure N, Litani needs to be initialized with a pool called "expensive".
  185. # For example, to only run two CBMC safety/coverage jobs at a time from amongst
  186. # all the proofs, you would initialize litani like
  187. # litani init --pools expensive:2
  188. # The run-cbmc-proofs.py script takes care of this initialization through the
  189. # --expensive-jobs-parallelism flag.
  190. #
  191. # To enable this feature, set
  192. # the ENABLE_POOLS variable when running Make, like
  193. # `make ENABLE_POOLS=true report`
  194. # The run-cbmc-proofs.py script takes care of this through the
  195. # --restrict-expensive-jobs flag.
  196. ifeq ($(strip $(ENABLE_POOLS)),)
  197. POOL =
  198. else ifeq ($(strip $(EXPENSIVE)),)
  199. POOL =
  200. else
  201. POOL = --pool expensive
  202. endif
  203. # Similar to the pool feature above. If Litani is new enough, enable
  204. # profiling CBMC's memory use.
  205. ifeq ($(strip $(ENABLE_MEMORY_PROFILING)),)
  206. MEMORY_PROFILING =
  207. else
  208. MEMORY_PROFILING = --profile-memory
  209. endif
  210. # Property checking flags
  211. #
  212. # Each variable below controls a specific property checking flag
  213. # within CBMC. If desired, a property flag can be disabled within
  214. # a particular proof by nulling the corresponding variable. For
  215. # instance, the following line:
  216. #
  217. # CHECK_FLAG_POINTER_CHECK =
  218. #
  219. # would disable the --pointer-check CBMC flag within:
  220. # * an entire project when added to Makefile-project-defines
  221. # * a specific proof when added to the harness Makefile
  222. CBMC_FLAG_MALLOC_MAY_FAIL ?= --malloc-may-fail
  223. CBMC_FLAG_MALLOC_FAIL_NULL ?= --malloc-fail-null
  224. CBMC_FLAG_BOUNDS_CHECK ?= --bounds-check
  225. CBMC_FLAG_CONVERSION_CHECK ?= --conversion-check
  226. CBMC_FLAG_DIV_BY_ZERO_CHECK ?= --div-by-zero-check
  227. CBMC_FLAG_FLOAT_OVERFLOW_CHECK ?= --float-overflow-check
  228. CBMC_FLAG_NAN_CHECK ?= --nan-check
  229. CBMC_FLAG_POINTER_CHECK ?= --pointer-check
  230. CBMC_FLAG_POINTER_OVERFLOW_CHECK ?= --pointer-overflow-check
  231. CBMC_FLAG_POINTER_PRIMITIVE_CHECK ?= --pointer-primitive-check
  232. CBMC_FLAG_SIGNED_OVERFLOW_CHECK ?= --signed-overflow-check
  233. CBMC_FLAG_UNDEFINED_SHIFT_CHECK ?= --undefined-shift-check
  234. CBMC_FLAG_UNSIGNED_OVERFLOW_CHECK ?= --unsigned-overflow-check
  235. CBMC_FLAG_UNWINDING_ASSERTIONS ?= --unwinding-assertions
  236. CBMC_DEFAULT_UNWIND ?= --unwind 1
  237. CBMC_FLAG_FLUSH ?= --flush
  238. # CBMC flags used for property checking and coverage checking
  239. CBMCFLAGS += $(CBMC_FLAG_FLUSH)
  240. # CBMC flags used for property checking
  241. CHECKFLAGS += $(CBMC_FLAG_BOUNDS_CHECK)
  242. CHECKFLAGS += $(CBMC_FLAG_CONVERSION_CHECK)
  243. CHECKFLAGS += $(CBMC_FLAG_DIV_BY_ZERO_CHECK)
  244. CHECKFLAGS += $(CBMC_FLAG_FLOAT_OVERFLOW_CHECK)
  245. CHECKFLAGS += $(CBMC_FLAG_NAN_CHECK)
  246. CHECKFLAGS += $(CBMC_FLAG_POINTER_CHECK)
  247. CHECKFLAGS += $(CBMC_FLAG_POINTER_OVERFLOW_CHECK)
  248. CHECKFLAGS += $(CBMC_FLAG_POINTER_PRIMITIVE_CHECK)
  249. CHECKFLAGS += $(CBMC_FLAG_SIGNED_OVERFLOW_CHECK)
  250. CHECKFLAGS += $(CBMC_FLAG_UNDEFINED_SHIFT_CHECK)
  251. CHECKFLAGS += $(CBMC_FLAG_UNSIGNED_OVERFLOW_CHECK)
  252. # Additional CBMC flag to CBMC control verbosity.
  253. #
  254. # Meaningful values are
  255. # 0 none
  256. # 1 only errors
  257. # 2 + warnings
  258. # 4 + results
  259. # 6 + status/phase information
  260. # 8 + statistical information
  261. # 9 + progress information
  262. # 10 + debug info
  263. #
  264. # Uncomment the following line or set in Makefile-project-defines
  265. # CBMC_VERBOSITY ?= --verbosity 4
  266. # Additional CBMC flag to control how CBMC treats static variables.
  267. #
  268. # NONDET_STATIC is a list of flags of the form --nondet-static
  269. # and --nondet-static-exclude VAR. The --nondet-static flag causes
  270. # CBMC to initialize static variables with unconstrained value
  271. # (ignoring initializers and default zero-initialization). The
  272. # --nondet-static-exclude VAR excludes VAR for the variables
  273. # initialized with unconstrained values.
  274. NONDET_STATIC ?=
  275. # Flags to pass to goto-cc for compilation and linking
  276. COMPILE_FLAGS ?= -Wall
  277. LINK_FLAGS ?= -Wall
  278. EXPORT_FILE_LOCAL_SYMBOLS ?= --export-file-local-symbols
  279. # During instrumentation, it adds models of C library functions
  280. ADD_LIBRARY_FLAG := --add-library
  281. # Preprocessor include paths -I...
  282. INCLUDES ?=
  283. # Preprocessor definitions -D...
  284. DEFINES ?=
  285. # CBMC object model
  286. #
  287. # CBMC_OBJECT_BITS is the number of bits in a pointer CBMC uses for
  288. # the id of the object to which a pointer is pointing. CBMC uses 8
  289. # bits for the object id by default. The remaining bits in the pointer
  290. # are used for offset into the object. This limits the size of the
  291. # objects that CBMC can model. This Makefile defines this bound on
  292. # object size to be CBMC_MAX_OBJECT_SIZE. You are likely to get
  293. # unexpected results if you try to malloc an object larger than this
  294. # bound.
  295. CBMC_OBJECT_BITS ?= 8
  296. # CBMC loop unwinding (Normally set in the proof Makefile)
  297. #
  298. # UNWINDSET is a list of pairs of the form foo.1:4 meaning that
  299. # CBMC should unwind loop 1 in function foo no more than 4 times.
  300. # For historical reasons, the number 4 is one more than the number
  301. # of times CBMC actually unwinds the loop.
  302. UNWINDSET ?=
  303. # CBMC early loop unwinding (Normally set in the proof Makefile)
  304. #
  305. # Most users can ignore this variable.
  306. #
  307. # This variable exists to support the use of loop and function
  308. # contracts, two features under development for CBMC. Checking the
  309. # assigns clause for function contracts and loop invariants currently
  310. # assumes loop-free bodies for loops and functions with contracts
  311. # (possibly after replacing nested loops with their own loop
  312. # contracts). To satisfy this requirement, it may be necessary to
  313. # unwind some loops before the function contract and loop invariant
  314. # transformations are applied to the goto program. This variable
  315. # CPROVER_LIBRARY_UNWINDSET is identical to UNWINDSET, and we assume that the
  316. # loops mentioned in CPROVER_LIBRARY_UNWINDSET and UNWINDSET are disjoint.
  317. CPROVER_LIBRARY_UNWINDSET ?=
  318. # CBMC function removal (Normally set set in the proof Makefile)
  319. #
  320. # REMOVE_FUNCTION_BODY is a list of function names. CBMC will "undefine"
  321. # the function, and CBMC will treat the function as having no side effects
  322. # and returning an unconstrained value of the appropriate return type.
  323. # The list should include the names of functions being stubbed out.
  324. REMOVE_FUNCTION_BODY ?=
  325. # CBMC function pointer restriction (Normally set in the proof Makefile)
  326. #
  327. # RESTRICT_FUNCTION_POINTER is a list of function pointer restriction
  328. # instructions of the form:
  329. #
  330. # <fun_id>.function_pointer_call.<N>/<fun_id>[,<fun_id>]*
  331. #
  332. # The function pointer call number <N> in the specified function gets
  333. # rewritten to a case switch over a finite list of functions.
  334. # If some possible target functions are omitted from the list a counter
  335. # example trace will be found by CBMC, i.e. the transformation is sound.
  336. # If the target functions are file-local symbols, then mangled names must
  337. # be used.
  338. RESTRICT_FUNCTION_POINTER ?=
  339. # The project source files (Normally set set in the proof Makefile)
  340. #
  341. # PROJECT_SOURCES is the list of project source files to compile,
  342. # including the source file defining the function under test.
  343. PROJECT_SOURCES ?=
  344. # The proof source files (Normally set in the proof Makefile)
  345. #
  346. # PROOF_SOURCES is the list of proof source files to compile, including
  347. # the proof harness, and including any function stubs being used.
  348. PROOF_SOURCES ?=
  349. # The number of seconds that CBMC should be allowed to run for before
  350. # being forcefully terminated. Currently, this is set to be less than
  351. # the time limit for a CodeBuild job, which is eight hours. If a proof
  352. # run takes longer than the time limit of the CI environment, the
  353. # environment will halt the proof run without updating the Litani
  354. # report, making the proof run appear to "hang".
  355. CBMC_TIMEOUT ?= 21600
  356. # CBMC string abstraction
  357. #
  358. # Replace all uses of char * by a struct that carries that string,
  359. # and also the underlying allocation and the C string length.
  360. STRING_ABSTRACTION ?=
  361. ifdef STRING_ABSTRACTION
  362. ifneq ($(strip $(STRING_ABSTRACTION)),)
  363. CBMC_STRING_ABSTRACTION := --string-abstraction
  364. endif
  365. endif
  366. # Optional configuration library flags
  367. OPT_CONFIG_LIBRARY ?=
  368. CBMC_OPT_CONFIG_LIBRARY := $(CBMC_FLAG_MALLOC_MAY_FAIL) $(CBMC_FLAG_MALLOC_FAIL_NULL) $(CBMC_STRING_ABSTRACTION)
  369. # Proof writers could add function contracts in their source code.
  370. # These contracts are ignored by default, but may be enabled in two distinct
  371. # contexts using the following two variables:
  372. # 1. To check whether one or more function contracts are sound with respect to
  373. # the function implementation, CHECK_FUNCTION_CONTRACTS should be a list of
  374. # function names. Use CHECK_FUNCTION_CONTRACTS_REC to check contracts on
  375. # recursive functions.
  376. # 2. To replace calls to certain functions with their correspondent function
  377. # contracts, USE_FUNCTION_CONTRACTS should be a list of function names.
  378. # One must check separately whether a function contract is sound before
  379. # replacing it in calling contexts.
  380. CHECK_FUNCTION_CONTRACTS ?=
  381. CBMC_CHECK_FUNCTION_CONTRACTS := $(patsubst %,--enforce-contract %, $(CHECK_FUNCTION_CONTRACTS))
  382. CHECK_FUNCTION_CONTRACTS_REC ?=
  383. CBMC_CHECK_FUNCTION_CONTRACTS_REC := $(patsubst %,--enforce-contract-rec %, $(CHECK_FUNCTION_CONTRACTS_REC))
  384. USE_FUNCTION_CONTRACTS ?=
  385. CBMC_USE_FUNCTION_CONTRACTS := $(patsubst %,--replace-call-with-contract %, $(USE_FUNCTION_CONTRACTS))
  386. CODE_CONTRACTS := $(CHECK_FUNCTION_CONTRACTS)$(USE_FUNCTION_CONTRACTS)$(APPLY_LOOP_CONTRACTS)
  387. # Proof writers may also apply function contracts using the Dynamic Frame
  388. # Condition Checking (DFCC) mode. For more information on DFCC,
  389. # please see https://diffblue.github.io/cbmc/contracts-dev-spec-dfcc.html.
  390. USE_DYNAMIC_FRAMES ?=
  391. ifdef USE_DYNAMIC_FRAMES
  392. ifneq ($(strip $(USE_DYNAMIC_FRAMES)),)
  393. CBMC_USE_DYNAMIC_FRAMES := $(CBMC_OPT_CONFIG_LIBRARY) --dfcc $(HARNESS_ENTRY) $(CBMC_CHECK_FUNCTION_CONTRACTS_REC)
  394. endif
  395. endif
  396. # Similarly, proof writers could also add loop contracts in their source code
  397. # to obtain unbounded correctness proofs. Unlike function contracts, loop
  398. # contracts are not reusable and thus are checked and used simultaneously.
  399. # These contracts are also ignored by default, but may be enabled by setting
  400. # the APPLY_LOOP_CONTRACTS variable.
  401. APPLY_LOOP_CONTRACTS ?=
  402. ifdef APPLY_LOOP_CONTRACTS
  403. ifneq ($(strip $(APPLY_LOOP_CONTRACTS)),)
  404. CBMC_APPLY_LOOP_CONTRACTS := --apply-loop-contracts
  405. endif
  406. endif
  407. # Silence makefile output (eg, long litani commands) unless VERBOSE is set.
  408. ifndef VERBOSE
  409. MAKEFLAGS := $(MAKEFLAGS) -s
  410. endif
  411. ################################################################
  412. ################################################################
  413. ## Section II: This section defines the process of running a proof
  414. ##
  415. ## There should be no reason to edit anything below this line.
  416. ################################################################
  417. # Paths
  418. CBMC ?= cbmc
  419. GOTO_ANALYZER ?= goto-analyzer
  420. GOTO_CC ?= goto-cc
  421. GOTO_INSTRUMENT ?= goto-instrument
  422. CRANGLER ?= crangler
  423. VIEWER ?= cbmc-viewer
  424. VIEWER2 ?= cbmc-viewer
  425. CMAKE ?= cmake
  426. GOTODIR ?= $(PROOFDIR)/gotos
  427. LOGDIR ?= $(PROOFDIR)/logs
  428. PROJECT ?= project
  429. PROOF ?= proof
  430. HARNESS_GOTO ?= $(GOTODIR)/$(HARNESS_FILE)
  431. PROJECT_GOTO ?= $(GOTODIR)/$(PROJECT)
  432. PROOF_GOTO ?= $(GOTODIR)/$(PROOF)
  433. ################################################################
  434. # Useful macros for values that are hard to reference
  435. SPACE :=$() $()
  436. COMMA :=,
  437. ################################################################
  438. # Set C compiler defines
  439. CBMCFLAGS += --object-bits $(CBMC_OBJECT_BITS)
  440. COMPILE_FLAGS += --object-bits $(CBMC_OBJECT_BITS)
  441. DEFINES += -DCBMC=1
  442. DEFINES += -DCBMC_OBJECT_BITS=$(CBMC_OBJECT_BITS)
  443. DEFINES += -DCBMC_MAX_OBJECT_SIZE="(SIZE_MAX>>(CBMC_OBJECT_BITS+1))"
  444. # CI currently assumes cbmc invocation has at most one --unwindset
  445. # UNWINDSET is designed for user code (i.e., proof and project code)
  446. ifdef UNWINDSET
  447. ifneq ($(strip $(UNWINDSET)),)
  448. CBMC_UNWINDSET := --unwindset $(subst $(SPACE),$(COMMA),$(strip $(UNWINDSET)))
  449. endif
  450. endif
  451. # CPROVER_LIBRARY_UNWINDSET is designed for CPROVER library functions
  452. ifdef CPROVER_LIBRARY_UNWINDSET
  453. ifneq ($(strip $(CPROVER_LIBRARY_UNWINDSET)),)
  454. CBMC_CPROVER_LIBRARY_UNWINDSET := --unwindset $(subst $(SPACE),$(COMMA),$(strip $(CPROVER_LIBRARY_UNWINDSET)))
  455. endif
  456. endif
  457. CBMC_REMOVE_FUNCTION_BODY := $(patsubst %,--remove-function-body %, $(REMOVE_FUNCTION_BODY))
  458. ifdef RESTRICT_FUNCTION_POINTER
  459. ifneq ($(strip $(RESTRICT_FUNCTION_POINTER)),)
  460. CBMC_RESTRICT_FUNCTION_POINTER := $(patsubst %,--restrict-function-pointer %, $(RESTRICT_FUNCTION_POINTER))
  461. endif
  462. endif
  463. ################################################################
  464. # Targets for rewriting source files with crangler
  465. # Construct crangler configuration files
  466. #
  467. # REWRITTEN_SOURCES is a list of crangler output files source.i.
  468. # This target assumes that for each source.i
  469. # * source.i_SOURCE is the path to a source file,
  470. # * source.i_FUNCTIONS is a list of functions (may be empty)
  471. # * source.i_OBJECTS is a list of variables (may be empty)
  472. # This target constructs the crangler configuration file source.i.json
  473. # of the form
  474. # {
  475. # "sources": [ "/proj/code.c" ],
  476. # "includes": [ "/proj/include" ],
  477. # "defines": [ "VAR=1" ],
  478. # "functions": [ {"function_name": ["remove static"]} ],
  479. # "objects": [ {"variable_name": ["remove static"]} ],
  480. # "output": "source.i"
  481. # }
  482. # to remove the static attribute from function_name and variable_name
  483. # in the source file source.c and write the result to source.i.
  484. #
  485. # This target assumes that filenames include no spaces and that
  486. # the INCLUDES and DEFINES variables include no spaces after -I
  487. # and -D. For example, use "-DVAR=1" and not "-D VAR=1".
  488. #
  489. # Define *_SOURCE, *_FUNCTIONS, and *_OBJECTS in the proof Makefile.
  490. # The string source.i is usually an absolute path $(PROOFDIR)/code.i
  491. # to a file in the proof directory that contains the proof Makefile.
  492. # The proof Makefile usually includes the definitions
  493. # $(PROOFDIR)/code.i_SOURCE = /proj/code.c
  494. # $(PROOFDIR)/code.i_FUNCTIONS = function_name
  495. # $(PROOFDIR)/code.i_OBJECTS = variable_name
  496. # Because these definitions refer to PROOFDIR that is defined in this
  497. # Makefile.common, these definitions must appear after the inclusion
  498. # of Makefile.common in the proof Makefile.
  499. #
  500. $(foreach rs,$(REWRITTEN_SOURCES),$(eval $(rs).json: $($(rs)_SOURCE)))
  501. $(foreach rs,$(REWRITTEN_SOURCES),$(rs).json):
  502. echo '{'\
  503. '"sources": ['\
  504. '"$($(@:.json=)_SOURCE)"'\
  505. '],'\
  506. '"includes": ['\
  507. '$(subst $(SPACE),$(COMMA),$(patsubst -I%,"%",$(strip $(INCLUDES))))' \
  508. '],'\
  509. '"defines": ['\
  510. '$(subst $(SPACE),$(COMMA),$(patsubst -D%,"%",$(subst ",\",$(strip $(DEFINES)))))' \
  511. '],'\
  512. '"functions": ['\
  513. '{'\
  514. '$(subst ~, ,$(subst $(SPACE),$(COMMA),$(patsubst %,"%":["remove~static"],$($(@:.json=)_FUNCTIONS))))' \
  515. '}'\
  516. '],'\
  517. '"objects": ['\
  518. '{'\
  519. '$(subst ~, ,$(subst $(SPACE),$(COMMA),$(patsubst %,"%":["remove~static"],$($(@:.json=)_OBJECTS))))' \
  520. '}'\
  521. '],'\
  522. '"output": "$(@:.json=)"'\
  523. '}' > $@
  524. # Rewrite source files with crangler
  525. #
  526. $(foreach rs,$(REWRITTEN_SOURCES),$(eval $(rs): $(rs).json))
  527. $(REWRITTEN_SOURCES):
  528. $(LITANI) add-job \
  529. --command \
  530. '$(CRANGLER) $@.json' \
  531. --inputs $($@_SOURCE) \
  532. --outputs $@ \
  533. --stdout-file $(LOGDIR)/crangler-$(subst /,_,$(subst .,_,$@))-log.txt \
  534. --interleave-stdout-stderr \
  535. --pipeline-name "$(PROOF_UID)" \
  536. --ci-stage build \
  537. --description "$(PROOF_UID): removing static"
  538. ################################################################
  539. # Build targets that make the relevant .goto files
  540. # Compile project sources
  541. $(PROJECT_GOTO)1.goto: $(PROJECT_SOURCES) $(REWRITTEN_SOURCES)
  542. $(LITANI) add-job \
  543. --command \
  544. '$(GOTO_CC) $(CBMC_VERBOSITY) $(COMPILE_FLAGS) $(EXPORT_FILE_LOCAL_SYMBOLS) $(INCLUDES) $(DEFINES) $^ -o $@' \
  545. --inputs $^ \
  546. --outputs $@ \
  547. --stdout-file $(LOGDIR)/project_sources-log.txt \
  548. --pipeline-name "$(PROOF_UID)" \
  549. --ci-stage build \
  550. --description "$(PROOF_UID): building project binary"
  551. # Compile proof sources
  552. $(PROOF_GOTO)1.goto: $(PROOF_SOURCES)
  553. $(LITANI) add-job \
  554. --command \
  555. '$(GOTO_CC) $(CBMC_VERBOSITY) $(COMPILE_FLAGS) $(EXPORT_FILE_LOCAL_SYMBOLS) $(INCLUDES) $(DEFINES) $^ -o $@' \
  556. --inputs $^ \
  557. --outputs $@ \
  558. --stdout-file $(LOGDIR)/proof_sources-log.txt \
  559. --pipeline-name "$(PROOF_UID)" \
  560. --ci-stage build \
  561. --description "$(PROOF_UID): building proof binary"
  562. # Remove function bodies from project sources
  563. $(PROJECT_GOTO)2.goto: $(PROJECT_GOTO)1.goto
  564. $(LITANI) add-job \
  565. --command \
  566. '$(GOTO_INSTRUMENT) $(CBMC_VERBOSITY) $(CBMC_REMOVE_FUNCTION_BODY) $^ $@' \
  567. --inputs $^ \
  568. --outputs $@ \
  569. --stdout-file $(LOGDIR)/remove_function_body-log.txt \
  570. --pipeline-name "$(PROOF_UID)" \
  571. --ci-stage build \
  572. --description "$(PROOF_UID): removing function bodies from project sources"
  573. # Link project and proof sources into the proof harness
  574. $(HARNESS_GOTO)1.goto: $(PROOF_GOTO)1.goto $(PROJECT_GOTO)2.goto
  575. $(LITANI) add-job \
  576. --command '$(GOTO_CC) $(CBMC_VERBOSITY) --function $(HARNESS_ENTRY) $^ $(LINK_FLAGS) -o $@' \
  577. --inputs $^ \
  578. --outputs $@ \
  579. --stdout-file $(LOGDIR)/link_proof_project-log.txt \
  580. --pipeline-name "$(PROOF_UID)" \
  581. --ci-stage build \
  582. --description "$(PROOF_UID): linking project to proof"
  583. # Restrict function pointers
  584. $(HARNESS_GOTO)2.goto: $(HARNESS_GOTO)1.goto
  585. $(LITANI) add-job \
  586. --command \
  587. '$(GOTO_INSTRUMENT) $(CBMC_VERBOSITY) $(CBMC_RESTRICT_FUNCTION_POINTER) --remove-function-pointers $^ $@' \
  588. --inputs $^ \
  589. --outputs $@ \
  590. --stdout-file $(LOGDIR)/restrict_function_pointer-log.txt \
  591. --pipeline-name "$(PROOF_UID)" \
  592. --ci-stage build \
  593. --description "$(PROOF_UID): restricting function pointers in project sources"
  594. # Fill static variable with unconstrained values
  595. $(HARNESS_GOTO)3.goto: $(HARNESS_GOTO)2.goto
  596. ifneq ($(strip $(CODE_CONTRACTS)),)
  597. $(LITANI) add-job \
  598. --command 'cp $^ $@' \
  599. --inputs $^ \
  600. --outputs $@ \
  601. --stdout-file $(LOGDIR)/nondet_static-log.txt \
  602. --pipeline-name "$(PROOF_UID)" \
  603. --ci-stage build \
  604. --description "$(PROOF_UID): not setting static variables to nondet (will do during contract instrumentation)"
  605. else
  606. $(LITANI) add-job \
  607. --command \
  608. '$(GOTO_INSTRUMENT) $(CBMC_VERBOSITY) $(NONDET_STATIC) $^ $@' \
  609. --inputs $^ \
  610. --outputs $@ \
  611. --stdout-file $(LOGDIR)/nondet_static-log.txt \
  612. --pipeline-name "$(PROOF_UID)" \
  613. --ci-stage build \
  614. --description "$(PROOF_UID): setting static variables to nondet"
  615. endif
  616. # Link CPROVER library if DFCC mode is on
  617. $(HARNESS_GOTO)4.goto: $(HARNESS_GOTO)3.goto
  618. ifneq ($(strip $(USE_DYNAMIC_FRAMES)),)
  619. $(LITANI) add-job \
  620. --command \
  621. '$(GOTO_INSTRUMENT) $(CBMC_VERBOSITY) $(ADD_LIBRARY_FLAG) $(CBMC_OPT_CONFIG_LIBRARY) $^ $@' \
  622. --inputs $^ \
  623. --outputs $@ \
  624. --stdout-file $(LOGDIR)/linking-library-models-log.txt \
  625. --pipeline-name "$(PROOF_UID)" \
  626. --ci-stage build \
  627. --description "$(PROOF_UID): linking CPROVER library"
  628. else
  629. $(LITANI) add-job \
  630. --command 'cp $^ $@' \
  631. --inputs $^ \
  632. --outputs $@ \
  633. --stdout-file $(LOGDIR)/linking-library-models-log.txt \
  634. --pipeline-name "$(PROOF_UID)" \
  635. --ci-stage build \
  636. --description "$(PROOF_UID): not linking CPROVER library"
  637. endif
  638. # Early unwind all loops on DFCC mode; otherwise, only unwind loops in proof and project code
  639. $(HARNESS_GOTO)5.goto: $(HARNESS_GOTO)4.goto
  640. ifneq ($(strip $(USE_DYNAMIC_FRAMES)),)
  641. $(LITANI) add-job \
  642. --command \
  643. '$(GOTO_INSTRUMENT) $(CBMC_VERBOSITY) $(CBMC_UNWINDSET) $(CBMC_CPROVER_LIBRARY_UNWINDSET) $(CBMC_DEFAULT_UNWIND) $(CBMC_FLAG_UNWINDING_ASSERTIONS) $^ $@' \
  644. --inputs $^ \
  645. --outputs $@ \
  646. --stdout-file $(LOGDIR)/unwind_loops-log.txt \
  647. --pipeline-name "$(PROOF_UID)" \
  648. --ci-stage build \
  649. --description "$(PROOF_UID): unwinding all loops"
  650. else ifneq ($(strip $(CODE_CONTRACTS)),)
  651. $(LITANI) add-job \
  652. --command \
  653. '$(GOTO_INSTRUMENT) $(CBMC_VERBOSITY) $(CBMC_UNWINDSET) $(CBMC_FLAG_UNWINDING_ASSERTIONS) $^ $@' \
  654. --inputs $^ \
  655. --outputs $@ \
  656. --stdout-file $(LOGDIR)/unwind_loops-log.txt \
  657. --pipeline-name "$(PROOF_UID)" \
  658. --ci-stage build \
  659. --description "$(PROOF_UID): unwinding loops in proof and project code"
  660. else
  661. $(LITANI) add-job \
  662. --command 'cp $^ $@' \
  663. --inputs $^ \
  664. --outputs $@ \
  665. --stdout-file $(LOGDIR)/linking-library-models-log.txt \
  666. --pipeline-name "$(PROOF_UID)" \
  667. --ci-stage build \
  668. --description "$(PROOF_UID): not unwinding loops"
  669. endif
  670. # Replace function contracts, check function contracts, instrument for loop contracts
  671. $(HARNESS_GOTO)6.goto: $(HARNESS_GOTO)5.goto
  672. $(LITANI) add-job \
  673. --command \
  674. '$(GOTO_INSTRUMENT) $(CBMC_USE_DYNAMIC_FRAMES) $(NONDET_STATIC) $(CBMC_VERBOSITY) $(CBMC_CHECK_FUNCTION_CONTRACTS) $(CBMC_USE_FUNCTION_CONTRACTS) $(CBMC_APPLY_LOOP_CONTRACTS) $^ $@' \
  675. --inputs $^ \
  676. --outputs $@ \
  677. --stdout-file $(LOGDIR)/check_function_contracts-log.txt \
  678. --pipeline-name "$(PROOF_UID)" \
  679. --ci-stage build \
  680. --description "$(PROOF_UID): checking function contracts"
  681. # Omit initialization of unused global variables (reduces problem size)
  682. $(HARNESS_GOTO)7.goto: $(HARNESS_GOTO)6.goto
  683. $(LITANI) add-job \
  684. --command \
  685. '$(GOTO_INSTRUMENT) $(CBMC_VERBOSITY) --slice-global-inits $^ $@' \
  686. --inputs $^ \
  687. --outputs $@ \
  688. --stdout-file $(LOGDIR)/slice_global_inits-log.txt \
  689. --pipeline-name "$(PROOF_UID)" \
  690. --ci-stage build \
  691. --description "$(PROOF_UID): slicing global initializations"
  692. # Omit unused functions (sharpens coverage calculations)
  693. $(HARNESS_GOTO)8.goto: $(HARNESS_GOTO)7.goto
  694. $(LITANI) add-job \
  695. --command \
  696. '$(GOTO_INSTRUMENT) $(CBMC_VERBOSITY) --drop-unused-functions $^ $@' \
  697. --inputs $^ \
  698. --outputs $@ \
  699. --stdout-file $(LOGDIR)/drop_unused_functions-log.txt \
  700. --pipeline-name "$(PROOF_UID)" \
  701. --ci-stage build \
  702. --description "$(PROOF_UID): dropping unused functions"
  703. # Final name for proof harness
  704. $(HARNESS_GOTO).goto: $(HARNESS_GOTO)8.goto
  705. $(LITANI) add-job \
  706. --command 'cp $< $@' \
  707. --inputs $^ \
  708. --outputs $@ \
  709. --pipeline-name "$(PROOF_UID)" \
  710. --ci-stage build \
  711. --description "$(PROOF_UID): copying final goto-binary"
  712. ################################################################
  713. # Targets to run the analysis commands
  714. ifdef CBMCFLAGS
  715. ifeq ($(strip $(CODE_CONTRACTS)),)
  716. CBMCFLAGS += $(CBMC_UNWINDSET) $(CBMC_CPROVER_LIBRARY_UNWINDSET) $(CBMC_DEFAULT_UNWIND) $(CBMC_OPT_CONFIG_LIBRARY)
  717. else ifeq ($(strip $(USE_DYNAMIC_FRAMES)),)
  718. CBMCFLAGS += $(CBMC_CPROVER_LIBRARY_UNWINDSET) $(CBMC_DEFAULT_UNWIND) $(CBMC_OPT_CONFIG_LIBRARY)
  719. endif
  720. endif
  721. $(LOGDIR)/result.xml: $(HARNESS_GOTO).goto
  722. $(LITANI) add-job \
  723. $(POOL) \
  724. --command \
  725. '$(CBMC) $(CBMC_VERBOSITY) $(CBMCFLAGS) $(CBMC_FLAG_UNWINDING_ASSERTIONS) $(CHECKFLAGS) --trace --xml-ui $<' \
  726. --inputs $^ \
  727. --outputs $@ \
  728. --ci-stage test \
  729. --stdout-file $@ \
  730. $(MEMORY_PROFILING) \
  731. --ignore-returns 10 \
  732. --timeout $(CBMC_TIMEOUT) \
  733. --pipeline-name "$(PROOF_UID)" \
  734. --tags "stats-group:safety checks" \
  735. --stderr-file $(LOGDIR)/result-err-log.txt \
  736. --description "$(PROOF_UID): checking safety properties"
  737. $(LOGDIR)/property.xml: $(HARNESS_GOTO).goto
  738. $(LITANI) add-job \
  739. --command \
  740. '$(CBMC) $(CBMC_VERBOSITY) $(CBMCFLAGS) $(CBMC_FLAG_UNWINDING_ASSERTIONS) $(CHECKFLAGS) --show-properties --xml-ui $<' \
  741. --inputs $^ \
  742. --outputs $@ \
  743. --ci-stage test \
  744. --stdout-file $@ \
  745. --ignore-returns 10 \
  746. --pipeline-name "$(PROOF_UID)" \
  747. --stderr-file $(LOGDIR)/property-err-log.txt \
  748. --description "$(PROOF_UID): printing safety properties"
  749. $(LOGDIR)/coverage.xml: $(HARNESS_GOTO).goto
  750. $(LITANI) add-job \
  751. $(POOL) \
  752. --command \
  753. '$(CBMC) $(CBMC_VERBOSITY) $(CBMCFLAGS) $(COVERFLAGS) --cover location --xml-ui $<' \
  754. --inputs $^ \
  755. --outputs $@ \
  756. --ci-stage test \
  757. --stdout-file $@ \
  758. $(MEMORY_PROFILING) \
  759. --ignore-returns 10 \
  760. --timeout $(CBMC_TIMEOUT) \
  761. --pipeline-name "$(PROOF_UID)" \
  762. --tags "stats-group:coverage computation" \
  763. --stderr-file $(LOGDIR)/coverage-err-log.txt \
  764. --description "$(PROOF_UID): calculating coverage"
  765. COVERAGE ?= $(LOGDIR)/coverage.xml
  766. VIEWER_COVERAGE_FLAG ?= --coverage $(COVERAGE)
  767. $(PROOFDIR)/report: $(LOGDIR)/result.xml $(LOGDIR)/property.xml $(COVERAGE)
  768. $(LITANI) add-job \
  769. --command " $(VIEWER) \
  770. --result $(LOGDIR)/result.xml \
  771. $(VIEWER_COVERAGE_FLAG) \
  772. --property $(LOGDIR)/property.xml \
  773. --srcdir $(SRCDIR) \
  774. --goto $(HARNESS_GOTO).goto \
  775. --reportdir $(PROOFDIR)/report \
  776. --config $(PROOFDIR)/cbmc-viewer.json" \
  777. --inputs $^ \
  778. --outputs $(PROOFDIR)/report \
  779. --pipeline-name "$(PROOF_UID)" \
  780. --stdout-file $(LOGDIR)/viewer-log.txt \
  781. --ci-stage report \
  782. --description "$(PROOF_UID): generating report"
  783. litani-path:
  784. @echo $(LITANI)
  785. # ##############################################################
  786. # Phony Rules
  787. #
  788. # These rules provide a convenient way to run a single proof up to a
  789. # certain stage. Users can browse into a proof directory and run
  790. # "make -Bj 3 report" to generate a report for just that proof, or
  791. # "make goto" to build the goto binary. Under the hood, this runs litani
  792. # for just that proof.
  793. _goto: $(HARNESS_GOTO).goto
  794. goto:
  795. @ echo Running 'litani init'
  796. $(LITANI) init --project $(PROJECT_NAME)
  797. @ echo Running 'litani add-job'
  798. $(MAKE) -B _goto
  799. @ echo Running 'litani build'
  800. $(LITANI) run-build
  801. _result: $(LOGDIR)/result.txt
  802. result:
  803. @ echo Running 'litani init'
  804. $(LITANI) init --project $(PROJECT_NAME)
  805. @ echo Running 'litani add-job'
  806. $(MAKE) -B _result
  807. @ echo Running 'litani build'
  808. $(LITANI) run-build
  809. _property: $(LOGDIR)/property.xml
  810. property:
  811. @ echo Running 'litani init'
  812. $(LITANI) init --project $(PROJECT_NAME)
  813. @ echo Running 'litani add-job'
  814. $(MAKE) -B _property
  815. @ echo Running 'litani build'
  816. $(LITANI) run-build
  817. _coverage: $(LOGDIR)/coverage.xml
  818. coverage:
  819. @ echo Running 'litani init'
  820. $(LITANI) init --project $(PROJECT_NAME)
  821. @ echo Running 'litani add-job'
  822. $(MAKE) -B _coverage
  823. @ echo Running 'litani build'
  824. $(LITANI) run-build
  825. _report: $(PROOFDIR)/report
  826. report:
  827. @ echo Running 'litani init'
  828. $(LITANI) init --project $(PROJECT_NAME)
  829. @ echo Running 'litani add-job'
  830. $(MAKE) -B _report
  831. @ echo Running 'litani build'
  832. $(LITANI) run-build
  833. _report_no_coverage:
  834. $(MAKE) COVERAGE="" VIEWER_COVERAGE_FLAG="" _report
  835. report-no-coverage:
  836. $(MAKE) COVERAGE="" VIEWER_COVERAGE_FLAG=" " report
  837. ################################################################
  838. # Targets to clean up after ourselves
  839. clean:
  840. -$(RM) $(DEPENDENT_GOTOS)
  841. -$(RM) TAGS*
  842. -$(RM) *~ \#*
  843. -$(RM) $(REWRITTEN_SOURCES) $(foreach rs,$(REWRITTEN_SOURCES),$(rs).json)
  844. veryclean: clean
  845. -$(RM) -r report
  846. -$(RM) -r $(LOGDIR) $(GOTODIR)
  847. .PHONY: \
  848. _coverage \
  849. _goto \
  850. _property \
  851. _report \
  852. _report_no_coverage \
  853. clean \
  854. coverage \
  855. goto \
  856. litani-path \
  857. property \
  858. report \
  859. report-no-coverage \
  860. result \
  861. setup_dependencies \
  862. testdeps \
  863. veryclean \
  864. #
  865. ################################################################
  866. # Run "make echo-proof-uid" to print the proof ID of a proof. This can be
  867. # used by scripts to ensure that every proof has an ID, that there are
  868. # no duplicates, etc.
  869. .PHONY: echo-proof-uid
  870. echo-proof-uid:
  871. @echo $(PROOF_UID)
  872. .PHONY: echo-project-name
  873. echo-project-name:
  874. @echo $(PROJECT_NAME)
  875. ################################################################
  876. # Project-specific targets requiring values defined above
  877. sinclude $(PROOF_ROOT)/Makefile-project-targets
  878. # CI-specific targets to drive cbmc in CI
  879. sinclude $(PROOF_ROOT)/Makefile-project-testing
  880. ################################################################