1 ## Note: starting comments with ## means they don't end up in Makefile
3 AUTOMAKE_OPTIONS = 1.5 foreign
9 AM_CPPFLAGS = -I$(srcdir)/$(INCDIR) -DPKGDATADIR='"$(pkgdatadir)"'
27 GRAMSRC = $(PARSERS) $(SCANNERS)
72 functionClauseList.c \
73 functionConstraint.c \
77 metaStateConstraint.c \
78 metaStateConstraintList.c \
79 metaStateExpression.c \
80 metaStateSpecifier.c \
115 constraintResolve.c \
116 constraintGeneration.c \
118 constraintExprData.c \
151 stateCombinationTable.c \
157 mtDeclarationNode.c \
158 mtDeclarationPieces.c \
159 mtDeclarationPiece.c \
163 mtAnnotationsNode.c \
167 mtTransferClauseList.c \
170 mtLoseReferenceList.c \
172 mtDefaultsDeclList.c \
178 ## These are only used if LCL is enabled
181 usymtab_interface.c \
214 declaratorInvNodeList.c \
215 interfaceNodeList.c \
217 declaratorNodeList.c \
231 varDeclarationNodeList.c \
233 quantifierNodeList.c \
257 $(INCDIR)/abstBodyNode.h \
258 $(INCDIR)/abstract.h \
259 $(INCDIR)/abstractNode.h \
260 $(INCDIR)/aliasTable.h \
261 $(INCDIR)/annotationInfo.h \
262 $(INCDIR)/annotationTable.h \
263 $(INCDIR)/arrayQualNode.h \
266 $(INCDIR)/checking.h \
267 $(INCDIR)/clabstract.h \
268 $(INCDIR)/claimNode.h \
270 $(INCDIR)/clauseStack.h \
272 $(INCDIR)/constants.h \
273 $(INCDIR)/constDeclarationNode.h \
274 $(INCDIR)/constraintExprData.h \
275 $(INCDIR)/constraintExpr.h \
276 $(INCDIR)/constraint.h \
277 $(INCDIR)/constraintList.h \
278 $(INCDIR)/constraintOutput.h \
279 $(INCDIR)/constraintResolve.h \
280 $(INCDIR)/constraintTerm.h \
281 $(INCDIR)/context.h \
282 $(INCDIR)/cppconf.h \
283 $(INCDIR)/cpperror.h \
286 $(INCDIR)/cpphash.h \
289 $(INCDIR)/cscanner.h \
290 $(INCDIR)/cscannerHelp.h \
291 $(INCDIR)/cstring.h \
292 $(INCDIR)/cstringHash.h \
293 $(INCDIR)/cstringList.h \
294 $(INCDIR)/cstringSList.h \
295 $(INCDIR)/cstringTable.h \
296 $(INCDIR)/ctypeList.h \
297 $(INCDIR)/CTypesNode.h \
298 $(INCDIR)/declaratorInvNode.h \
299 $(INCDIR)/declaratorInvNodeList.h \
300 $(INCDIR)/declaratorNode.h \
301 $(INCDIR)/declaratorNodeList.h \
303 $(INCDIR)/enumNameList.h \
304 $(INCDIR)/enumNameSList.h \
305 $(INCDIR)/enumSpecNode.h \
306 $(INCDIR)/exportNode.h \
307 $(INCDIR)/exposedNode.h \
308 $(INCDIR)/exprChecks.h \
309 $(INCDIR)/exprData.h \
310 $(INCDIR)/exprNode.h \
311 $(INCDIR)/exprNodeList.h \
312 $(INCDIR)/exprNodeSList.h \
313 $(INCDIR)/fcnNode.h \
314 $(INCDIR)/fcnNodeList.h \
316 $(INCDIR)/fileIdList.h \
317 $(INCDIR)/fileLib.h \
318 $(INCDIR)/fileloc.h \
319 $(INCDIR)/filelocList.h \
320 $(INCDIR)/filelocStack.h \
321 $(INCDIR)/fileTable.h \
322 $(INCDIR)/flagMarker.h \
323 $(INCDIR)/flagMarkerList.h \
325 $(INCDIR)/flagSpec.h \
326 $(INCDIR)/forwardTypes.h \
327 $(INCDIR)/functionClause.h \
328 $(INCDIR)/functionClauseList.h \
329 $(INCDIR)/functionConstraint.h \
330 $(INCDIR)/general.h \
331 $(INCDIR)/genericTable.h \
332 $(INCDIR)/globalList.h \
333 $(INCDIR)/globalsClause.h \
334 $(INCDIR)/globals.h \
335 $(INCDIR)/globSet.h \
336 $(INCDIR)/guardSet.h \
339 $(INCDIR)/idDeclList.h \
340 $(INCDIR)/importNode.h \
341 $(INCDIR)/importNodeList.h \
342 $(INCDIR)/imports.h \
343 $(INCDIR)/initDeclNode.h \
344 $(INCDIR)/initDeclNodeList.h \
345 $(INCDIR)/inputStream.h \
346 $(INCDIR)/interfaceNode.h \
347 $(INCDIR)/interfaceNodeList.h \
349 $(INCDIR)/iterNode.h \
350 $(INCDIR)/lcl_constants.h \
351 $(INCDIR)/lclctypes.h \
352 $(INCDIR)/lclForwardTypes.h \
353 $(INCDIR)/lclinit.h \
354 $(INCDIR)/library.h \
355 $(INCDIR)/lclMisc.h \
356 $(INCDIR)/lclPredicateNode.h \
357 $(INCDIR)/lclscan.h \
358 $(INCDIR)/lclscanline.h \
359 $(INCDIR)/lclsyntable.h \
360 $(INCDIR)/lcltokentable.h \
361 $(INCDIR)/lclTypeSpecNode.h \
363 $(INCDIR)/letDeclNode.h \
364 $(INCDIR)/letDeclNodeList.h \
366 $(INCDIR)/llerror.h \
367 $(INCDIR)/llglobals.h \
370 $(INCDIR)/lslinit.h \
372 $(INCDIR)/lslOpList.h \
373 $(INCDIR)/lslOpSet.h \
374 $(INCDIR)/lslparse.h \
375 $(INCDIR)/lslscan.h \
376 $(INCDIR)/lslscanline.h \
377 $(INCDIR)/lslsyntable.h \
378 $(INCDIR)/lsltokentable.h \
379 $(INCDIR)/lsymbol.h \
380 $(INCDIR)/lsymbolList.h \
381 $(INCDIR)/lsymbolSet.h \
383 $(INCDIR)/ltokenList.h \
384 $(INCDIR)/macrocache.h \
385 $(INCDIR)/mapping.h \
386 $(INCDIR)/message.h \
387 $(INCDIR)/messageLog.h \
388 $(INCDIR)/metaStateConstraint.h \
389 $(INCDIR)/metaStateConstraintList.h \
390 $(INCDIR)/metaStateExpression.h \
391 $(INCDIR)/metaStateInfo.h \
392 $(INCDIR)/metaStateSpecifier.h \
393 $(INCDIR)/metaStateTable.h \
395 $(INCDIR)/modifiesClause.h \
396 $(INCDIR)/modifyNode.h \
397 $(INCDIR)/mstring.h \
398 $(INCDIR)/mtAnnotationDecl.h \
399 $(INCDIR)/mtAnnotationList.h \
400 $(INCDIR)/mtAnnotationsNode.h \
401 $(INCDIR)/mtContextNode.h \
402 $(INCDIR)/mtDeclarationNode.h \
403 $(INCDIR)/mtDeclarationPiece.h \
404 $(INCDIR)/mtDeclarationPieces.h \
405 $(INCDIR)/mtDefaultsDecl.h \
406 $(INCDIR)/mtDefaultsDeclList.h \
407 $(INCDIR)/mtDefaultsNode.h \
408 $(INCDIR)/mtincludes.h \
409 $(INCDIR)/mtLoseReference.h \
410 $(INCDIR)/mtLoseReferenceList.h \
411 $(INCDIR)/mtMergeClause.h \
412 $(INCDIR)/mtMergeClauseList.h \
413 $(INCDIR)/mtMergeItem.h \
414 $(INCDIR)/mtMergeNode.h \
415 $(INCDIR)/mtreader.h \
416 $(INCDIR)/mtscanner.h \
418 $(INCDIR)/mtTransferAction.h \
419 $(INCDIR)/mtTransferClause.h \
420 $(INCDIR)/mtTransferClauseList.h \
421 $(INCDIR)/mtValuesNode.h \
422 $(INCDIR)/multiVal.h \
423 $(INCDIR)/nameChecks.h \
424 $(INCDIR)/nameNode.h \
425 $(INCDIR)/opFormNode.h \
427 $(INCDIR)/pairNode.h \
428 $(INCDIR)/pairNodeList.h \
429 $(INCDIR)/paramNode.h \
430 $(INCDIR)/paramNodeList.h \
431 $(INCDIR)/pointers.h \
432 $(INCDIR)/privateNode.h \
433 $(INCDIR)/programNode.h \
434 $(INCDIR)/programNodeList.h \
437 $(INCDIR)/qualList.h \
438 $(INCDIR)/quantifiedTermNode.h \
439 $(INCDIR)/quantifierNode.h \
440 $(INCDIR)/quantifierNodeList.h \
441 $(INCDIR)/rcfiles.h \
443 $(INCDIR)/renamingNode.h \
444 $(INCDIR)/replaceNode.h \
445 $(INCDIR)/replaceNodeList.h \
447 $(INCDIR)/signNode.h \
448 $(INCDIR)/sigNode.h \
449 $(INCDIR)/sigNodeSet.h \
451 $(INCDIR)/sortList.h \
452 $(INCDIR)/sortSet.h \
453 $(INCDIR)/sortSetList.h \
455 $(INCDIR)/sRefSet.h \
456 $(INCDIR)/sRefSetList.h \
457 $(INCDIR)/sRefTable.h \
458 $(INCDIR)/stateClause.h \
459 $(INCDIR)/stateClauseList.h \
460 $(INCDIR)/stateCombinationTable.h \
461 $(INCDIR)/stateInfo.h \
462 $(INCDIR)/stateValue.h \
463 $(INCDIR)/stDeclNode.h \
464 $(INCDIR)/stDeclNodeList.h \
465 $(INCDIR)/stmtNode.h \
466 $(INCDIR)/storeRefNode.h \
467 $(INCDIR)/storeRefNodeList.h \
468 $(INCDIR)/strOrUnionNode.h \
469 $(INCDIR)/structNames.h \
470 $(INCDIR)/symtable.h \
471 $(INCDIR)/system_constants.h \
472 $(INCDIR)/taggedUnionNode.h \
473 $(INCDIR)/termNode.h \
474 $(INCDIR)/termNodeList.h \
475 $(INCDIR)/traitRefNode.h \
476 $(INCDIR)/traitRefNodeList.h \
477 $(INCDIR)/transferChecks.h \
478 $(INCDIR)/typeExpr.h \
480 $(INCDIR)/typeIdSet.h \
481 $(INCDIR)/typeNameNode.h \
482 $(INCDIR)/typeNameNodeList.h \
483 $(INCDIR)/typeNamePack.h \
484 $(INCDIR)/typeNode.h \
486 $(INCDIR)/uentryList.h \
488 $(INCDIR)/usymIdSet.h \
489 $(INCDIR)/usymtab.h \
490 $(INCDIR)/usymtab_interface.h \
491 $(INCDIR)/valueTable.h \
492 $(INCDIR)/varDeclarationNode.h \
493 $(INCDIR)/varDeclarationNodeList.h \
494 $(INCDIR)/varKinds.h \
495 $(INCDIR)/varNode.h \
496 $(INCDIR)/varNodeList.h \
497 $(INCDIR)/libversion.h \
498 $(INCDIR)/warnClause.h \
501 splint_SOURCES = $(COMMONSRC) $(GRAMSRC) $(HEADERSRC)
503 dist_bin_SCRIPTS = genflagcodes
505 ## Sources that need to be built.
506 ## Automake knows how to handle yacc generated C files, but for C headers
507 ## it needs to have these added explicitly for correct dependency tracking.
509 $(srcdir)/cgrammar.h \
510 $(srcdir)/mtgrammar.h \
511 $(srcdir)/llgrammar.h \
512 $(srcdir)/lslgrammar.h \
513 $(srcdir)/flag_codes.h
519 EXTRAGRAMMARFILES = bison.head bison.reset flex.head flex.reset
523 $(srcdir)/flag_codes.h \
524 $(srcdir)/reservedNames.c \
525 $(INCDIR)/splintMacros.nf \
526 $(EXTRAGRAMMARFILES) \
533 $(srcdir)/flag_codes.h: flags.def genflagcodes
534 @if $(AM_V_P); then set -x; else echo " GEN " $(notdir $@); fi; \
535 $(srcdir)/genflagcodes "$<" "$@.temp"; \
536 if test $$? -eq 0; then \
537 if test -f "$@" && cmp -s "$@" "$@.temp"; then \
538 echo $(notdir $@) "is unchanged"; \
541 echo "updating" $(notdir $@); \
542 mv -f "$@.temp" "$@"; \
553 # files to run Splint on; some scanners are hand-written and shouldn't
554 # cause (much) problems; lex/yacc generated files don't play nice and
555 # thus need some pampering (with some prefixing/suffixing).
557 # TODO: these files have been disactivated for some time; I (mg) might
558 # have removed some of the inclusion of these head/reset files from the
559 # source *.{l,y} files.
560 CHK_GRAMSRC = $(HAND_SCANNERS)
562 ## original used LFLAGS=-L to suppress #line from output
564 # chk_cscanner.c: cscanner.c
565 # $(CAT) flex.head $< flex.reset > $@
567 # CHK_GRAMSRC += chk_cscanner.c
568 # EXTRA_DIST += flex.head flex.reset
570 # chk_lslgrammar.c: lslgrammar.c
571 # $(CAT) bison.head $< bison.reset > $@
572 # chk_lslgrammar.h: lslgrammar.h
573 # $(CAT) bison.head $< bison.reset > $@
574 # CHK_GRAMSRC += chk_lslgrammar.c
576 # chk_llgrammar.c: llgrammar.c
577 # $(CAT) bison.head $< bison.reset > $@
578 # chk_llgrammar.h: llgrammar.h
579 # $(CAT) bison.head $< bison.reset > $@
580 # CHK_GRAMSRC += chk_llgrammar.c
582 # chk_mtgrammar.c: mtgrammar.c
583 # $(CAT) bison.head $< bison.reset > $@
584 # chk_mtgrammar.h: mtgrammar.h
585 # $(CAT) bison.head $< bison.reset > $@
586 # CHK_GRAMSRC += chk_mtgrammar.c
588 # chk_cgrammar.c: cgrammar.c
589 # $(CAT) bison.head $< bison.reset > $@
590 # chk_cgrammar.h: cgrammar.h
591 # $(CAT) bison.head $< bison.reset > $@
592 # CHK_GRAMSRC += chk_cgrammar.c
594 # EXTRA_DIST += bison.head bison.reset
596 LINTSRC = $(COMMONSRC) $(CHK_GRAMSRC)
598 # Define INTERCEPT environment variable before calling make to interpose some
599 # other program before splint, e.g.
600 # INTERCEPT = valgrind -v --leak-resolution=high --num-callers=20 \
601 # --show-reachable=no --leak-check=yes
603 RUNSPLINT = $(INTERCEPT) $(builddir)/splint \
604 -mts file -mts filerw -mts tainted \
605 +singleinclude +forcehints +showsourceloc \
606 -misplacedsharequal -fcnuse -incondefs -exportlocal -constuse \
607 $(DEFAULT_INCLUDES) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS)
611 $(RUNSPLINT) -dump splint $(LINTSRC)
613 .PHONY: splintme-bounds
615 $(RUNSPLINT) -dump splint +bounds +impboundsconstraints $(LINTSRC)
617 .PHONY: splintme-supcounts
619 $(RUNSPLINT) -dump splint -unrecogcomments -supcounts $(LINTSRC)
621 .PHONY: splintme-bufchk
623 $(RUNSPLINT) -dump splint -unrecogcomments -supcounts +bounds -DLINTBUFFERCHECK $(LINTSRC)
625 # Example of a partial (one file) analysis
626 .PHONY: splintme-some
628 $(RUNSPLINT) -load splint -unrecogcomments -supcounts +partial library.c