Compare commits

...

143 Commits

Author SHA1 Message Date
Gavin Howard eb0cd870b9
Make bc work without -Wdeclaration-after-statement warnings 5 days ago
Gavin Howard 51ce0e0352
Fix a problem in the algorithms manual 1 week ago
Gavin Howard ca53adf83b
Fix bugs and style in filter_text 1 week ago
Gavin Howard 712d79c03e
Do not use uniq for blank lines in filter_text 1 week ago
Gavin Howard 319d597f9e
Increment the version and update the NEWS 2 weeks ago
Gavin Howard 34e31ad80f
Fix a build problem in FreeBSD 2 weeks ago
Gavin Howard 82f85e9d90
Make editline more efficient with no prompt 2 weeks ago
Gavin Howard 36ebd30e2b
Increment the version and update the NEWS 2 weeks ago
Gavin Howard 45df56dd2e
Make editline and readline respect BC_PROMPT 2 weeks ago
Gavin Howard 408f9090c1
Make EOF with the line libs more like the built-in history 3 weeks ago
Gavin Howard 4317afa2fa
Increment the version and update the NEWS 3 weeks ago
Gavin Howard bb4431262d
Fix a problem with the en_US locale file 3 weeks ago
Gavin Howard c58e2be43f
Fix a build problem on FreeBSD 3 weeks ago
Gavin Howard 37068c161d
Fix formatting 3 weeks ago
Gavin Howard bd5f5fdb79
Make bc history use tabs 3 weeks ago
Gavin Howard 83878f1c2f
Make gen/strgen.c work with Windows again 3 weeks ago
Gavin Howard a698a33503
Adjust the Windows build for the strgen changes 3 weeks ago
Gavin Howard d30762f5c0
Fix a problem in the builtin arg tests 3 weeks ago
Gavin Howard 74d8eb2891
Try yet again to fix all of the compiler warnings 3 weeks ago
Gavin Howard 49adcc7af5
Try again to fix the signals problem 3 weeks ago
Gavin Howard 4a07fb1580
Try to fix a problem with signals 3 weeks ago
Gavin Howard 25fe85591a
Fix another compiler warning 3 weeks ago
Gavin Howard 0ff0f67d60
Fix compiler warnings 3 weeks ago
Gavin Howard 78ba445e83
Add the new command-line options to the help texts 3 weeks ago
Gavin Howard db540c29e3
Fix a typo in the bc manual 3 weeks ago
Gavin Howard a6519f8593
Update the NEWS 3 weeks ago
Gavin Howard 4beb55fbd8
Update the manuals 3 weeks ago
Gavin Howard 44983b5d2a
Add an error test for command-line builtin variables 3 weeks ago
Gavin Howard 2db127113b
Add tests for the builtin var command-line arguments 3 weeks ago
Gavin Howard 488d48c87c
Implement command-line args to set the four builtin variables 3 weeks ago
Gavin Howard 4c34391266
Add some directives to the manpages for better style 3 weeks ago
Gavin Howard 0d8bffdb64
Fix FreeBSD issues and typos in the manuals 3 weeks ago
Gavin Howard ec41af4679
Simplify the history tests in configure.sh 3 weeks ago
Gavin Howard c36b91b024
Attempt to fix build failures on the FreeBSD port 4 weeks ago
Gavin Howard b5812f05c5
Add a note to the README about spam 4 weeks ago
Gavin Howard 7cb4597574
Remove an extra newline output 1 month ago
Gavin Howard 6b4ea3432d
Add editline and readline testing to the release script 1 month ago
Gavin Howard 95a9c99f13
Update the release checklist 1 month ago
Gavin Howard f147e34c8e
Format all C code 1 month ago
Gavin Howard 4e5556e260
Add code formatting infrastructure 1 month ago
Gavin Howard 27441fc0c2
Fix style 1 month ago
Gavin Howard 27b59e0aed
Fix lint warnings 1 month ago
Gavin Howard 495e2d7358
Add lint infrastructure 1 month ago
Gavin Howard fd2ea461e4
Increment the version and update the NEWS 1 month ago
Gavin Howard 289da0e76a
Update documentation 1 month ago
Gavin Howard 4a10f9c786
Add the line library configure options to the build manual 1 month ago
Gavin Howard debc6cd31a
Do not initialize history with a bad terminal 1 month ago
Gavin Howard a1ef58d12f
Add comments 1 month ago
Gavin Howard 82eb41312e
Fix a typo in the manuals 1 month ago
Gavin Howard 467b54c78e
Add an explanatory comment 1 month ago
Gavin Howard ecf128aaa0
Make sure there's no UB from changing const strings 1 month ago
Gavin Howard dddc69be47
Get history working on Windows 1 month ago
Gavin Howard 4eb4b699f6
Fix style 1 month ago
Gavin Howard 99eb8bbbb3
Merge branch 'master' into line_libs 1 month ago
Gavin Howard 411e1a8b16
Fix the README folder list 1 month ago
Gavin Howard 75d300d74d
Merge branch 'master' into line_libs 1 month ago
Gavin Howard 1b77c55148
Fix the README file list 1 month ago
Gavin Howard 0549afca5c
Add a missing #include 1 month ago
Gavin Howard 8896082204
Rename two globals 1 month ago
Gavin Howard 0632f1d60d
Make sure ^C is printed without sigint reset for editline 1 month ago
Gavin Howard 6ff6592fd2
Make SIGINT work with editline as well 1 month ago
Gavin Howard 30f96cd088
Make readline handle SIGINT correctly 1 month ago
Gavin Howard 3efc3b9f42
Clean up a lot of the line lib code and consolidate 1 month ago
Gavin Howard dda04344dd
Attempt to fix no newline on EOF 1 month ago
Gavin Howard 9d4a878f66
Fix the version output 1 month ago
Gavin Howard c74c2a56d4
Make history work under editline 1 month ago
Gavin Howard 7bbf1eec59
Make SIGWINCH work on FreeBSD 1 month ago
Gavin Howard 7701612501
Switch static_assert to _Static_assert 1 month ago
Gavin Howard 88e2894e25
Attempt to make bc build in FreeBSD base 1 month ago
Gavin Howard 7112520efe
Make sure to error if the new configure arguments are wrong 1 month ago
Gavin Howard 73a1a62f59
Merge branch 'master' into line_libs 1 month ago
Gavin Howard 54a7ca1a8d
Fix a compile error that I did not catch 1 month ago
Gavin Howard f8b5ab0dfd
Make the build work on FreeBSD 1 month ago
Gavin Howard 38e85d7ea3
Implement support for editline and readline 1 month ago
Gavin Howard e1bd08f895
Fix style 1 month ago
Gavin Howard 04ef32e888
Fix a bug 1 month ago
Gavin Howard c96de7c0f6
Add gzip to the package script 2 months ago
Gavin Howard d24ea601aa
Tweak the release notes 2 months ago
Gavin Howard 7fa5dce636
Increment the version and update the NEWS 2 months ago
Gavin Howard cef94931a4
Change the history EOF test for the recent change two commits ago 2 months ago
Gavin Howard 5e0a30e2a9
Fix style 2 months ago
Warner Losh f8fa6febf7 Emacs delete-next-character 2 months ago
Gavin Howard cad172d8f0
Increment the version and update the NEWS 3 months ago
Piotr P. Stefaniak cb7bde2181
Make Home and End keys work in tmux in history 3 months ago
Gavin Howard 8ec0c24751
Add a comment warning of the bug that was found 3 months ago
Gavin Howard 24be19250c
Quiet a useless clang warning 3 months ago
Piotr P. Stefaniak e0fb717308
Fix a bug in history refresh 3 months ago
Gavin Howard 3d6c2e4645
Update copyright for the bc banner 3 months ago
Gavin Howard b5c7f6942b
Add a comment 3 months ago
Gavin Howard 5ba4e300a7
Make sure to not run a generated test if not able to generate 3 months ago
Gavin Howard fd1e659aa6
Increment the version and update the NEWS 4 months ago
Gavin Howard 621adbd71d
Workaround a clang bug 4 months ago
Gavin Howard 6d26f2ac3e
Fix another gcc warning 4 months ago
Gavin Howard ca6dd9ecf6
Fix style 4 months ago
Gavin Howard de4fa1bd4a
Fix a compile warning from GCC 4 months ago
Gavin Howard 5fc73c7443
Add more tests for multiline comments and strings in expression files 4 months ago
Gavin Howard dbc4dc4c4e
Fix a problem found with the fix in last commit 4 months ago
Gavin Howard d778d0b917
Fix the bug mentioned in the last commit 4 months ago
Gavin Howard 824859ba47
Add a test for a bug found by a user 4 months ago
Gavin Howard 85dbc9578e
Increment the version and update the NEWS 5 months ago
Gavin Howard 81905ee8e2
Fix the argv[0] == NULL bug 5 months ago
Gavin Howard 52f7667c88
Fix style 5 months ago
Gavin Howard 3962313c8b
Fix a wrong doc comment 5 months ago
Gavin Howard 329a29def7
Add a static_assert for instructions 6 months ago
Gavin Howard d5b5a5c400
Fix typos 6 months ago
Gavin Howard 84ed5cc276
Tweak something in the development manual 6 months ago
Gavin Howard eca74533b6
Fix style 6 months ago
Firas Khalil Khana 232a12f687 Add missing newline character 6 months ago
Gavin Howard c3b2d28b2d
Fix still another typo 7 months ago
Gavin Howard db200ed396
Fix yet another typo 7 months ago
Gavin Howard cec89461df
Fix another typo 7 months ago
Gavin Howard 8f0e794f49
Fix a typo 7 months ago
Gavin Howard daf643af7e
Make sure to guard locale-specific stuff 7 months ago
Gavin Howard 23799b7747
Increment the version and update the NEWS 7 months ago
Gavin Howard 9ffdd5ec69
Fix the second parse bug found by oguz-ismail 7 months ago
Gavin Howard 81f838f657
Add a test for the fix in the previous commit 7 months ago
Gavin Howard 5b2fe303c8
Fix one of two parse bugs found by oguz-ismail 7 months ago
Gavin Howard b20fe46e1c
Update the configure help 8 months ago
Gavin Howard ddd6bb9daf
Revert "Attempt to make dc.exe a link on Windows" 8 months ago
Gavin Howard a2cbd36b53
Try again to make release.sh use out-of-source builds 8 months ago
Gavin Howard a945358c87
Make release script do parallel history test 8 months ago
Gavin Howard 0c84e0bf15
Remove a part of a history test that is too flaky 8 months ago
Gavin Howard 8e1928493c
Make the release script not test history in parallel 8 months ago
Gavin Howard e12eafcf7a
Tweak a doc comment 8 months ago
Gavin Howard e38c88a415
Make the release script able to do out-of-source builds 8 months ago
Gavin Howard 8b7e59f29e
Update README files 8 months ago
Gavin Howard 29055cfd83
Attempt to make dc.exe a link on Windows 8 months ago
Gavin Howard 9e688779a0
Add documentation for out-of-source builds to README and manuals 8 months ago
Gavin Howard c8d0d016fb
Change something back 8 months ago
Gavin Howard 6bd6c61f52
Fix some problems with out-of-source builds 8 months ago
Gavin Howard 56a8da67d1
Implement out-of-source builds 8 months ago
Gavin Howard fb2428ca63
Add a gitignore for testing out-of-source builds 8 months ago
Gavin Howard 2427756509
Fix a problem with make clean 8 months ago
Gavin Howard dc3a588cf9
Update the NEWS 8 months ago
Gavin Howard c891c10097
Implement a pkg-config file for bcl 8 months ago
Gavin Howard d92530bad8
Fix the install and uninstall targets for bcl 8 months ago
Gavin Howard f463085c46
Update the README for the Windows build 8 months ago
Gavin Howard 5d9b40c2f6
Add a blurb about global data and signals to the dev manual 9 months ago
Gavin Howard 4277d5ad1a
Fix a bug in the unlock for the library 9 months ago
Gavin Howard 7ad047d503
Fix interaction between signals and globals 9 months ago
Gavin Howard de699c3c22
Fight against flakiness of history tests 9 months ago
Gavin Howard c4e3e23057
Add BC_EXPR_EXIT back with setting default 9 months ago
Gavin Howard 80f165451f
Increment the version and update the NEWS 9 months ago
  1. 152
      .clang-format
  2. 43
      .clang-tidy
  3. 2
      .gitignore
  4. 219
      Makefile.in
  5. 85
      NEWS.md
  6. 92
      README.md
  7. 8
      bcl.pc.in
  8. 289
      configure.sh
  9. 33
      gen/bc_help.txt
  10. 33
      gen/dc_help.txt
  11. 308
      gen/strgen.c
  12. 31
      gen/strgen.sh
  13. 4
      include/args.h
  14. 65
      include/bc.h
  15. 258
      include/bcl.h
  16. 15
      include/dc.h
  17. 80
      include/file.h
  18. 177
      include/history.h
  19. 100
      include/lang.h
  20. 58
      include/lex.h
  21. 104
      include/library.h
  22. 161
      include/num.h
  23. 24
      include/opt.h
  24. 49
      include/parse.h
  25. 1065
      include/program.h
  26. 48
      include/rand.h
  27. 12
      include/read.h
  28. 129
      include/status.h
  29. 106
      include/vector.h
  30. 2
      include/version.h
  31. 168
      include/vm.h
  32. 10
      locales/de_DE.ISO8859-1.msg
  33. 10
      locales/de_DE.UTF-8.msg
  34. 10
      locales/en_US.msg
  35. 10
      locales/es_ES.ISO8859-1.msg
  36. 10
      locales/es_ES.UTF-8.msg
  37. 10
      locales/fr_FR.ISO8859-1.msg
  38. 10
      locales/fr_FR.UTF-8.msg
  39. 10
      locales/ja_JP.UTF-8.msg
  40. 10
      locales/ja_JP.eucJP.msg
  41. 10
      locales/nl_NL.ISO8859-1.msg
  42. 10
      locales/nl_NL.UTF-8.msg
  43. 10
      locales/pl_PL.ISO8859-2.msg
  44. 10
      locales/pl_PL.UTF-8.msg
  45. 10
      locales/pt_PT.ISO8859-1.msg
  46. 10
      locales/pt_PT.UTF-8.msg
  47. 10
      locales/ru_RU.CP1251.msg
  48. 10
      locales/ru_RU.CP866.msg
  49. 10
      locales/ru_RU.ISO8859-5.msg
  50. 10
      locales/ru_RU.KOI8-R.msg
  51. 10
      locales/ru_RU.UTF-8.msg
  52. 10
      locales/zh_CN.GB18030.msg
  53. 10
      locales/zh_CN.GB2312.msg
  54. 10
      locales/zh_CN.GBK.msg
  55. 10
      locales/zh_CN.UTF-8.msg
  56. 10
      locales/zh_CN.eucCN.msg
  57. 2
      manuals/algorithms.md
  58. 153
      manuals/bc.1.md.in
  59. 137
      manuals/bc/A.1
  60. 148
      manuals/bc/A.1.md
  61. 109
      manuals/bc/E.1
  62. 128
      manuals/bc/E.1.md
  63. 109
      manuals/bc/EH.1
  64. 128
      manuals/bc/EH.1.md
  65. 109
      manuals/bc/EHN.1
  66. 128
      manuals/bc/EHN.1.md
  67. 109
      manuals/bc/EN.1
  68. 128
      manuals/bc/EN.1.md
  69. 137
      manuals/bc/H.1
  70. 148
      manuals/bc/H.1.md
  71. 137
      manuals/bc/HN.1
  72. 148
      manuals/bc/HN.1.md
  73. 137
      manuals/bc/N.1
  74. 148
      manuals/bc/N.1.md
  75. 16
      manuals/bcl.3
  76. 10
      manuals/bcl.3.md
  77. 56
      manuals/build.md
  78. 71
      manuals/dc.1.md.in
  79. 86
      manuals/dc/A.1
  80. 66
      manuals/dc/A.1.md
  81. 69
      manuals/dc/E.1
  82. 55
      manuals/dc/E.1.md
  83. 69
      manuals/dc/EH.1
  84. 55
      manuals/dc/EH.1.md
  85. 69
      manuals/dc/EHN.1
  86. 55
      manuals/dc/EHN.1.md
  87. 69
      manuals/dc/EN.1
  88. 55
      manuals/dc/EN.1.md
  89. 86
      manuals/dc/H.1
  90. 66
      manuals/dc/H.1.md
  91. 86
      manuals/dc/HN.1
  92. 66
      manuals/dc/HN.1.md
  93. 86
      manuals/dc/N.1
  94. 66
      manuals/dc/N.1.md
  95. 53
      manuals/development.md
  96. 4
      manuals/header_bc.txt
  97. 4
      manuals/header_bcl.txt
  98. 4
      manuals/header_dc.txt
  99. 36
      manuals/release.md
  100. 40
      scripts/bitfuncgen.c
  101. Some files were not shown because too many files have changed in this diff Show More

152
.clang-format

@ -0,0 +1,152 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: 1
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveBitFields: true
AlignConsecutiveDeclarations: false
AlignConsecutiveMacros: false
AlignEscapedNewlines: Left
AlignOperands: Align
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: false
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: All
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
#AttributeMacros: []
BinPackArguments: true
BinPackParameters: true
#BitFieldColonSpacing: Both
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: true
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakAfterJavaFieldAnnotations: true
BreakBeforeBinaryOperators: None
#BreakBeforeConceptDeclarations: true
BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
BreakStringLiterals: false
ColumnLimit: 80
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DeriveLineEnding: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<(sys|arpa|net|netinet)/.*\.h>'
Priority: 2
- Regex: '^<(args|bc|bcl|dc|file|history|lang|lex|library|num|opt|parse|program|rand|read|status|vector|version|vm)\.h>'
Priority: 3
- Regex: '^<.*\.h>'
Priority: 0
- Regex: '^<.*>'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: true
IndentExternBlock: NoIndent
IndentGotoLabels: false
IndentPPDirectives: None
#IndentPragmas: false
#IndentRequires: true
IndentWidth: 4
IndentWrappedFunctionNames: false
InsertTrailingCommas: None
JavaImportGroups: []
JavaScriptQuotes: Double
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
NamespaceMacros: []
ObjCBinPackProtocolList: Always
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 1000
PenaltyBreakBeforeFirstCallParameter: 429496720
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 42949672
PenaltyBreakString: 10000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 42949672
PenaltyIndentedWhitespace: 1
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
#RawStringFormats:
# This is used to get spaces around a bitwise and operator.
ReferenceAlignment: Middle
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
#SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: true
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInConditionalStatement: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Latest
TabWidth: 4
TypenameMacros: []
UseCRLF: false
UseTab: ForIndentation
WhitespaceSensitiveMacros: []
...

43
.clang-tidy

@ -0,0 +1,43 @@
Checks: 'clang-diagnostic-*,clang-analyzer-*'
WarningsAsErrors: 'clang-diagnostic-*,clang-analyzer-*'
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: file
CheckOptions:
- key: llvm-else-after-return.WarnOnConditionVariables
value: 'false'
- key: modernize-loop-convert.MinConfidence
value: reasonable
- key: modernize-replace-auto-ptr.IncludeStyle
value: llvm
- key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons
value: 'false'
- key: google-readability-namespace-comments.ShortNamespaceLines
value: '10'
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
value: 'false'
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: 'true'
- key: cert-dcl16-c.NewSuffixes
value: 'L;LL;LU;LLU'
- key: google-readability-braces-around-statements.ShortStatementLines
value: '1'
- key: modernize-pass-by-value.IncludeStyle
value: llvm
- key: google-readability-namespace-comments.SpacesBeforeComments
value: '2'
- key: modernize-loop-convert.MaxCopySize
value: '16'
- key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
value: 'true'
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: llvm-qualified-auto.AddConstToQualified
value: 'false'
- key: modernize-loop-convert.NamingStyle
value: CamelCase
- key: llvm-else-after-return.WarnOnUnfixable
value: 'false'
- key: google-readability-function-size.StatementThreshold
value: '800'
...

2
.gitignore vendored

@ -33,7 +33,9 @@ dc_help.c
config.mak
timeconst.bc
Makefile
bcl.pc
build/*
tests/fuzzing/bc_outputs1/*
tests/fuzzing/bc_outputs2/*
tests/fuzzing/bc_outputs3/*

219
Makefile.in

@ -29,6 +29,15 @@
#
.POSIX:
ROOTDIR = %%ROOTDIR%%
INCDIR = $(ROOTDIR)/include
SRCDIR = $(ROOTDIR)/src
TESTSDIR = $(ROOTDIR)/tests
SCRIPTSDIR = $(ROOTDIR)/scripts
GENDIR = $(ROOTDIR)/gen
BUILDDIR = %%BUILDDIR%%
SRC = %%SRC%%
OBJ = %%OBJ%%
GCDA = %%GCDA%%
@ -39,46 +48,45 @@ BC_ENABLED = %%BC_ENABLED%%
DC_ENABLED_NAME = DC_ENABLED
DC_ENABLED = %%DC_ENABLED%%
HEADERS = include/args.h include/file.h include/lang.h include/lex.h include/num.h include/opt.h include/parse.h include/program.h include/read.h include/status.h include/vector.h include/vm.h
BC_HEADERS = include/bc.h
DC_HEADERS = include/dc.h
HISTORY_HEADERS = include/history.h
EXTRA_MATH_HEADERS = include/rand.h
LIBRARY_HEADERS = include/bcl.h include/library.h
HEADERS = $(INCDIR)/args.h $(INCDIR)/file.h $(INCDIR)/lang.h $(INCDIR)/lex.h $(INCDIR)/num.h $(INCDIR)/opt.h $(INCDIR)/parse.h $(INCDIR)/program.h $(INCDIR)/read.h $(INCDIR)/status.h $(INCDIR)/vector.h $(INCDIR)/vm.h
BC_HEADERS = $(INCDIR)/bc.h
DC_HEADERS = $(INCDIR)/dc.h
HISTORY_HEADERS = $(INCDIR)/history.h
EXTRA_MATH_HEADERS = $(INCDIR)/rand.h
LIBRARY_HEADERS = $(INCDIR)/bcl.h $(INCDIR)/library.h
GEN_DIR = gen
GEN = %%GEN%%
GEN_EXEC = $(GEN_DIR)/$(GEN)
GEN_C = $(GEN_DIR)/$(GEN).c
GEN_C = $(GENDIR)/$(GEN).c
GEN_EMU = %%GEN_EMU%%
BC_LIB = $(GEN_DIR)/lib.bc
BC_LIB = $(GENDIR)/lib.bc
BC_LIB_C = $(GEN_DIR)/lib.c
BC_LIB_O = %%BC_LIB_O%%
BC_LIB_GCDA = $(GEN_DIR)/lib.gcda
BC_LIB_GCNO = $(GEN_DIR)/lib.gcno
BC_LIB2 = $(GEN_DIR)/lib2.bc
BC_LIB2 = $(GENDIR)/lib2.bc
BC_LIB2_C = $(GEN_DIR)/lib2.c
BC_LIB2_O = %%BC_LIB2_O%%
BC_LIB2_GCDA = $(GEN_DIR)/lib2.gcda
BC_LIB2_GCNO = $(GEN_DIR)/lib2.gcno
BC_HELP = $(GEN_DIR)/bc_help.txt
BC_HELP = $(GENDIR)/bc_help.txt
BC_HELP_C = $(GEN_DIR)/bc_help.c
BC_HELP_O = %%BC_HELP_O%%
BC_HELP_GCDA = $(GEN_DIR)/bc_help.gcda
BC_HELP_GCNO = $(GEN_DIR)/bc_help.gcno
DC_HELP = $(GEN_DIR)/dc_help.txt
DC_HELP = $(GENDIR)/dc_help.txt
DC_HELP_C = $(GEN_DIR)/dc_help.c
DC_HELP_O = %%DC_HELP_O%%
DC_HELP_GCDA = $(GEN_DIR)/dc_help.gcda
DC_HELP_GCNO = $(GEN_DIR)/dc_help.gcno
BIN = bin
LOCALES = locales
EXEC_SUFFIX = %%EXECSUFFIX%%
EXEC_PREFIX = %%EXECPREFIX%%
@ -97,7 +105,7 @@ LIB_NAME = $(LIB).a
LIBBC = $(BIN)/$(LIB_NAME)
BCL = bcl
BCL_TEST = $(BIN)/$(BCL)
BCL_TEST_C = tests/$(BCL).c
BCL_TEST_C = $(TESTSDIR)/$(BCL).c
MANUALS = manuals
BC_MANPAGE_NAME = $(EXEC_PREFIX)$(BC)$(EXEC_SUFFIX).1
@ -112,9 +120,13 @@ BCL_MD = $(BCL_MANPAGE).md
MANPAGE_INSTALL_ARGS = -Dm644
BINARY_INSTALL_ARGS = -Dm755
PC_INSTALL_ARGS = $(MANPAGE_INSTALL_ARGS)
BCL_PC = $(BCL).pc
PC_PATH = %%PC_PATH%%
BCL_HEADER_NAME = bcl.h
BCL_HEADER = include/$(BCL_HEADER_NAME)
BCL_HEADER = $(INCDIR)/$(BCL_HEADER_NAME)
%%DESTDIR%%
BINDIR = %%BINDIR%%
@ -135,6 +147,7 @@ BC_ENABLE_EXTRA_MATH_NAME = BC_ENABLE_EXTRA_MATH
BC_ENABLE_EXTRA_MATH = %%EXTRA_MATH%%
BC_ENABLE_NLS = %%NLS%%
BC_LONG_BIT = %%LONG_BIT%%
BC_EXCLUDE_EXTRA_MATH = %%EXCLUDE_EXTRA_MATH%%
BC_ENABLE_AFL = %%FUZZ%%
BC_ENABLE_MEMCHECK = %%MEMCHECK%%
@ -146,6 +159,8 @@ BC_DEFAULT_TTY_MODE = %%BC_DEFAULT_TTY_MODE%%
DC_DEFAULT_TTY_MODE = %%DC_DEFAULT_TTY_MODE%%
BC_DEFAULT_PROMPT = %%BC_DEFAULT_PROMPT%%
DC_DEFAULT_PROMPT = %%DC_DEFAULT_PROMPT%%
BC_DEFAULT_EXPR_EXIT = %%BC_DEFAULT_EXPR_EXIT%%
DC_DEFAULT_EXPR_EXIT = %%DC_DEFAULT_EXPR_EXIT%%
RM = rm
MKDIR = mkdir
@ -158,13 +173,13 @@ MINISTAT_EXEC = $(SCRIPTS)/$(MINISTAT)
BITFUNCGEN = bitfuncgen
BITFUNCGEN_EXEC = $(SCRIPTS)/$(BITFUNCGEN)
INSTALL = $(SCRIPTS)/exec-install.sh
SAFE_INSTALL = $(SCRIPTS)/safe-install.sh
LINK = $(SCRIPTS)/link.sh
MANPAGE = $(SCRIPTS)/manpage.sh
KARATSUBA = $(SCRIPTS)/karatsuba.py
LOCALE_INSTALL = $(SCRIPTS)/locale_install.sh
LOCALE_UNINSTALL = $(SCRIPTS)/locale_uninstall.sh
INSTALL = $(SCRIPTSDIR)/exec-install.sh
SAFE_INSTALL = $(SCRIPTSDIR)/safe-install.sh
LINK = $(SCRIPTSDIR)/link.sh
MANPAGE = $(SCRIPTSDIR)/manpage.sh
KARATSUBA = $(SCRIPTSDIR)/karatsuba.py
LOCALE_INSTALL = $(SCRIPTSDIR)/locale_install.sh
LOCALE_UNINSTALL = $(SCRIPTSDIR)/locale_uninstall.sh
VALGRIND_ARGS = --error-exitcode=100 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all
@ -176,23 +191,25 @@ BC_DEFS0 = -DBC_DEFAULT_BANNER=$(BC_DEFAULT_BANNER)
BC_DEFS1 = -DBC_DEFAULT_SIGINT_RESET=$(BC_DEFAULT_SIGINT_RESET)
BC_DEFS2 = -DBC_DEFAULT_TTY_MODE=$(BC_DEFAULT_TTY_MODE)
BC_DEFS3 = -DBC_DEFAULT_PROMPT=$(BC_DEFAULT_PROMPT)
BC_DEFS = $(BC_DEFS0) $(BC_DEFS1) $(BC_DEFS2) $(BC_DEFS3)
BC_DEFS4 = -DBC_DEFAULT_EXPR_EXIT=$(BC_DEFAULT_EXPR_EXIT)
BC_DEFS = $(BC_DEFS0) $(BC_DEFS1) $(BC_DEFS2) $(BC_DEFS3) $(BC_DEFS4)
DC_DEFS1 = -DDC_DEFAULT_SIGINT_RESET=$(DC_DEFAULT_SIGINT_RESET)
DC_DEFS2 = -DDC_DEFAULT_TTY_MODE=$(DC_DEFAULT_TTY_MODE)
DC_DEFS3 = -DDC_DEFAULT_PROMPT=$(DC_DEFAULT_PROMPT)
DC_DEFS = $(DC_DEFS1) $(DC_DEFS2) $(DC_DEFS3)
DC_DEFS4 = -DDC_DEFAULT_EXPR_EXIT=$(DC_DEFAULT_EXPR_EXIT)
DC_DEFS = $(DC_DEFS1) $(DC_DEFS2) $(DC_DEFS3) $(DC_DEFS4)
CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED)
CPPFLAGS2 = $(CPPFLAGS1) -I./include/ -DBUILD_TYPE=$(BC_BUILD_TYPE) %%LONG_BIT_DEFINE%%
CPPFLAGS2 = $(CPPFLAGS1) -I$(INCDIR)/ -DBUILD_TYPE=$(BC_BUILD_TYPE) %%LONG_BIT_DEFINE%%
CPPFLAGS3 = $(CPPFLAGS2) -DEXECPREFIX=$(EXEC_PREFIX) -DMAINEXEC=$(MAIN_EXEC)
CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 %%BSD%%
CPPFLAGS4 = $(CPPFLAGS3) %%BSD%%
CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN)
CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS)
CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH)
CPPFLAGS8 = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY)
CPPFLAGS = $(CPPFLAGS8) -DBC_ENABLE_MEMCHECK=$(BC_ENABLE_MEMCHECK) -DBC_ENABLE_AFL=$(BC_ENABLE_AFL)
CFLAGS = $(CPPFLAGS) $(BC_DEFS) $(DC_DEFS) %%CPPFLAGS%% %%CFLAGS%%
LDFLAGS = %%LDFLAGS%%
CFLAGS = $(CPPFLAGS) $(BC_DEFS) $(DC_DEFS) %%CPPFLAGS%% %%CFLAGS%% -I$(INCLUDEDIR)
LDFLAGS = %%LDFLAGS%% -L$(LIBDIR)
HOSTCFLAGS = %%HOSTCFLAGS%%
@ -212,29 +229,32 @@ all: %%DEFAULT_TARGET%%
%%SECOND_TARGET%%: %%SECOND_TARGET_PREREQS%%
%%SECOND_TARGET_CMD%%
$(GEN_EXEC):
$(GEN_DIR):
mkdir -p $(GEN_DIR)
$(GEN_EXEC): $(GEN_DIR)
%%GEN_EXEC_TARGET%%
$(BC_LIB_C): $(GEN_EXEC) $(BC_LIB)
$(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_LIB_C_ARGS)
$(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB_C_ARGS)
$(BC_LIB_O): $(BC_LIB_C)
$(CC) $(CFLAGS) -o $@ -c $<
$(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2)
$(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_LIB2_C_ARGS)
$(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_EXCLUDE_EXTRA_MATH) $(BC_LIB2_C_ARGS)
$(BC_LIB2_O): $(BC_LIB2_C)
$(CC) $(CFLAGS) -o $@ -c $<
$(BC_HELP_C): $(GEN_EXEC) $(BC_HELP)
$(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help "" $(BC_ENABLED_NAME)
$(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) bc_help "" $(BC_ENABLED_NAME)
$(BC_HELP_O): $(BC_HELP_C)
$(CC) $(CFLAGS) -o $@ -c $<
$(DC_HELP_C): $(GEN_EXEC) $(DC_HELP)
$(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help "" $(DC_ENABLED_NAME)
$(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) $(BC_EXCLUDE_EXTRA_MATH) dc_help "" $(DC_ENABLED_NAME)
$(DC_HELP_O): $(DC_HELP_C)
$(CC) $(CFLAGS) -o $@ -c $<
@ -242,13 +262,18 @@ $(DC_HELP_O): $(DC_HELP_C)
$(BIN):
$(MKDIR) -p $(BIN)
src:
$(MKDIR) -p src
headers: %%HEADERS%%
$(MINISTAT):
$(HOSTCC) $(HOSTCFLAGS) -lm -o $(MINISTAT_EXEC) scripts/ministat.c
mkdir -p $(SCRIPTS)
$(HOSTCC) $(HOSTCFLAGS) -lm -o $(MINISTAT_EXEC) $(ROOTDIR)/scripts/ministat.c
$(BITFUNCGEN):
$(HOSTCC) $(HOSTCFLAGS) -lm -o $(BITFUNCGEN_EXEC) scripts/bitfuncgen.c
mkdir -p $(SCRIPTS)
$(HOSTCC) $(HOSTCFLAGS) -lm -o $(BITFUNCGEN_EXEC) $(ROOTDIR)/scripts/bitfuncgen.c
help:
@printf 'available targets:\n'
@ -314,18 +339,18 @@ test_bc_tests:%%BC_TESTS%%
test_bc_scripts:%%BC_SCRIPT_TESTS%%
test_bc_stdin:
@sh tests/stdin.sh bc %%BC_TEST_EXEC%%
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/stdin.sh bc %%BC_TEST_EXEC%%
test_bc_read:
@sh tests/read.sh bc %%BC_TEST_EXEC%%
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/read.sh bc %%BC_TEST_EXEC%%
test_bc_errors: test_bc_error_lines%%BC_ERROR_TESTS%%
test_bc_error_lines:
@sh tests/errors.sh bc %%BC_TEST_EXEC%%
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/errors.sh bc %%BC_TEST_EXEC%%
test_bc_other:
@sh tests/other.sh bc $(BC_ENABLE_EXTRA_MATH) %%BC_TEST_EXEC%%
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/other.sh bc $(BC_ENABLE_EXTRA_MATH) %%BC_TEST_EXEC%%
test_bc_header:
@printf '$(TEST_STARS)\n\nRunning bc tests...\n\n'
@ -338,18 +363,18 @@ test_dc_tests:%%DC_TESTS%%
test_dc_scripts:%%DC_SCRIPT_TESTS%%
test_dc_stdin:
@sh tests/stdin.sh dc %%DC_TEST_EXEC%%
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/stdin.sh dc %%DC_TEST_EXEC%%
test_dc_read:
@sh tests/read.sh dc %%DC_TEST_EXEC%%
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/read.sh dc %%DC_TEST_EXEC%%
test_dc_errors: test_dc_error_lines%%DC_ERROR_TESTS%%
test_dc_error_lines:
@sh tests/errors.sh dc %%DC_TEST_EXEC%%
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/errors.sh dc %%DC_TEST_EXEC%%
test_dc_other:
@sh tests/other.sh dc $(BC_ENABLE_EXTRA_MATH) %%DC_TEST_EXEC%%
@export BC_TEST_OUTPUT_DIR="$(BUILDDIR)/tests"; sh $(TESTSDIR)/other.sh dc $(BC_ENABLE_EXTRA_MATH) %%DC_TEST_EXEC%%
test_dc_header:
@printf '$(TEST_STARS)\n\nRunning dc tests...\n\n'
@ -368,107 +393,110 @@ test_bc_history_skip:
@printf 'No bc history tests to run\n'
test_bc_history0:
@sh tests/history.sh bc 0 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 0 %%BC_TEST_EXEC%%
test_bc_history1:
@sh tests/history.sh bc 1 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 1 %%BC_TEST_EXEC%%
test_bc_history2:
@sh tests/history.sh bc 2 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 2 %%BC_TEST_EXEC%%
test_bc_history3:
@sh tests/history.sh bc 3 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 3 %%BC_TEST_EXEC%%
test_bc_history4:
@sh tests/history.sh bc 4 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 4 %%BC_TEST_EXEC%%
test_bc_history5:
@sh tests/history.sh bc 5 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 5 %%BC_TEST_EXEC%%
test_bc_history6:
@sh tests/history.sh bc 6 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 6 %%BC_TEST_EXEC%%
test_bc_history7:
@sh tests/history.sh bc 7 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 7 %%BC_TEST_EXEC%%
test_bc_history8:
@sh tests/history.sh bc 8 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 8 %%BC_TEST_EXEC%%
test_bc_history9:
@sh tests/history.sh bc 9 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 9 %%BC_TEST_EXEC%%
test_bc_history10:
@sh tests/history.sh bc 10 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 10 %%BC_TEST_EXEC%%
test_bc_history11:
@sh tests/history.sh bc 11 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 11 %%BC_TEST_EXEC%%
test_bc_history12:
@sh tests/history.sh bc 12 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 12 %%BC_TEST_EXEC%%
test_bc_history13:
@sh tests/history.sh bc 13 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 13 %%BC_TEST_EXEC%%
test_bc_history14:
@sh tests/history.sh bc 14 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 14 %%BC_TEST_EXEC%%
test_bc_history15:
@sh tests/history.sh bc 15 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 15 %%BC_TEST_EXEC%%
test_bc_history16:
@sh tests/history.sh bc 16 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 16 %%BC_TEST_EXEC%%
test_bc_history17:
@sh tests/history.sh bc 17 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 17 %%BC_TEST_EXEC%%
test_bc_history18:
@sh tests/history.sh bc 18 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 18 %%BC_TEST_EXEC%%
test_bc_history19:
@sh tests/history.sh bc 19 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 19 %%BC_TEST_EXEC%%
test_bc_history20:
@sh tests/history.sh bc 20 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 20 %%BC_TEST_EXEC%%
test_bc_history21:
@sh tests/history.sh bc 21 %%BC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh bc 21 %%BC_TEST_EXEC%%
test_dc_history:%%DC_HISTORY_TEST_PREREQS%%
test_dc_history_all: test_dc_history0 test_dc_history1 test_dc_history2 test_dc_history3 test_dc_history4 test_dc_history5 test_dc_history6 test_dc_history7 test_dc_history8 test_dc_history9
test_dc_history_all: test_dc_history0 test_dc_history1 test_dc_history2 test_dc_history3 test_dc_history4 test_dc_history5 test_dc_history6 test_dc_history7 test_dc_history8 test_dc_history9 test_dc_history10
test_dc_history_skip:
@printf 'No dc history tests to run\n'
test_dc_history0:
@sh tests/history.sh dc 0 %%DC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh dc 0 %%DC_TEST_EXEC%%
test_dc_history1:
@sh tests/history.sh dc 1 %%DC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh dc 1 %%DC_TEST_EXEC%%
test_dc_history2:
@sh tests/history.sh dc 2 %%DC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh dc 2 %%DC_TEST_EXEC%%
test_dc_history3:
@sh tests/history.sh dc 3 %%DC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh dc 3 %%DC_TEST_EXEC%%
test_dc_history4:
@sh tests/history.sh dc 4 %%DC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh dc 4 %%DC_TEST_EXEC%%
test_dc_history5:
@sh tests/history.sh dc 5 %%DC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh dc 5 %%DC_TEST_EXEC%%
test_dc_history6:
@sh tests/history.sh dc 6 %%DC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh dc 6 %%DC_TEST_EXEC%%
test_dc_history7:
@sh tests/history.sh dc 7 %%DC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh dc 7 %%DC_TEST_EXEC%%
test_dc_history8:
@sh tests/history.sh dc 8 %%DC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh dc 8 %%DC_TEST_EXEC%%
test_dc_history9:
@sh tests/history.sh dc 9 %%DC_TEST_EXEC%%
@sh $(TESTSDIR)/history.sh dc 9 %%DC_TEST_EXEC%%
test_dc_history10:
@sh $(TESTSDIR)/history.sh dc 10 %%DC_TEST_EXEC%%
test_history_header:
@printf '$(TEST_STARS)\n\nRunning history tests...\n\n'
@ -505,18 +533,17 @@ clean:%%CLEAN_PREREQS%%
@$(RM) -f $(BC_EXEC)
@$(RM) -f $(DC_EXEC)
@$(RM) -fr $(BIN)
@$(RM) -f $(LOCALES)/*.cat
@$(RM) -f $(BC_LIB_C) $(BC_LIB_O)
@$(RM) -f $(BC_LIB2_C) $(BC_LIB2_O)
@$(RM) -f $(BC_HELP_C) $(BC_HELP_O)
@$(RM) -f $(DC_HELP_C) $(DC_HELP_O)
@$(RM) -fr Debug/ Release/
@$(RM) -fr vs/bin/ vs/lib/
clean_benchmarks:
@printf 'Cleaning benchmarks...\n'
@$(RM) -f $(MINISTAT_EXEC)
@$(RM) -f benchmarks/bc/*.txt
@$(RM) -f benchmarks/dc/*.txt
@$(RM) -f $(ROOTDIR)/benchmarks/bc/*.txt
@$(RM) -f $(ROOTDIR)/benchmarks/dc/*.txt
clean_config: clean clean_benchmarks
@printf 'Cleaning config...\n'
@ -544,19 +571,19 @@ clean_tests: clean clean_config clean_coverage
@printf 'Cleaning test files...\n'
@$(RM) -fr $(BC_TEST_OUTPUTS) $(DC_TEST_OUTPUTS)
@$(RM) -fr $(BC_FUZZ_OUTPUTS) $(DC_FUZZ_OUTPUTS)
@$(RM) -f tests/bc/parse.txt tests/bc/parse_results.txt
@$(RM) -f tests/bc/print.txt tests/bc/print_results.txt
@$(RM) -f tests/bc/bessel.txt tests/bc/bessel_results.txt
@$(RM) -f tests/bc/strings2.txt tests/bc/strings2_results.txt
@$(RM) -f tests/bc/scripts/bessel.txt
@$(RM) -f tests/bc/scripts/parse.txt
@$(RM) -f tests/bc/scripts/print.txt
@$(RM) -f tests/bc/scripts/add.txt
@$(RM) -f tests/bc/scripts/divide.txt
@$(RM) -f tests/bc/scripts/multiply.txt
@$(RM) -f tests/bc/scripts/subtract.txt
@$(RM) -f tests/bc/scripts/strings2.txt
@$(RM) -f tests/dc/scripts/prime.txt
@$(RM) -f $(TESTSDIR)/bc/parse.txt $(TESTSDIR)/bc/parse_results.txt
@$(RM) -f $(TESTSDIR)/bc/print.txt $(TESTSDIR)/bc/print_results.txt
@$(RM) -f $(TESTSDIR)/bc/bessel.txt $(TESTSDIR)/bc/bessel_results.txt
@$(RM) -f $(TESTSDIR)/bc/strings2.txt $(TESTSDIR)/bc/strings2_results.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/bessel.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/parse.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/print.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/add.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/divide.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/multiply.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/subtract.txt
@$(RM) -f $(TESTSDIR)/bc/scripts/strings2.txt
@$(RM) -f $(TESTSDIR)/dc/scripts/prime.txt
@$(RM) -f .log_*.txt
@$(RM) -f .math.txt .results.txt .ops.txt
@$(RM) -f .test.txt
@ -581,10 +608,11 @@ install_bcl_header:
$(SAFE_INSTALL) $(MANPAGE_INSTALL_ARGS) $(BCL_HEADER) $(DESTDIR)$(INCLUDEDIR)/$(BCL_HEADER_NAME)
install_execs:
$(INSTALL) $(DESTDIR)$(BINDIR) "$(EXEC_SUFFIX)"
$(INSTALL) $(DESTDIR)$(BINDIR) "$(EXEC_SUFFIX)" "$(BUILDDIR)/bin"
install_library:
install_library: install_bcl_header
$(SAFE_INSTALL) $(BINARY_INSTALL_ARGS) $(LIBBC) $(DESTDIR)$(LIBDIR)/$(LIB_NAME)
%%PKG_CONFIG_INSTALL%%
install:%%INSTALL_LOCALES_PREREQS%%%%INSTALL_MAN_PREREQS%%%%INSTALL_PREREQS%%
@ -603,8 +631,9 @@ uninstall_dc_manpage:
uninstall_dc:
$(RM) -f $(DESTDIR)$(BINDIR)/$(EXEC_PREFIX)$(DC)$(EXEC_SUFFIX)
uninstall_library:
uninstall_library: uninstall_bcl_header
$(RM) -f $(DESTDIR)$(LIBDIR)/$(LIB_NAME)
%%PKG_CONFIG_UNINSTALL%%
uninstall_bcl_header:
$(RM) -f $(DESTDIR)$(INCLUDEDIR)/$(BCL_HEADER_NAME)

85
NEWS.md

@ -1,5 +1,90 @@
# News
## 5.3.3
This is a production release that fixes a build problem in the FreeBSD base
system.
All other users do **NOT** need to upgrade.
## 5.3.2
This is a production release that fixes prompt bugs with editline and readline
where the `BC_PROMPT` environment variable was not being respected.
This also fixes editline and readline output on `EOF`.
## 5.3.1
This is a production release that fixes a build problem in the FreeBSD base
system, as well as a problem in the `en_US` locale. If you don't have problems
with either, you do not need to upgrade.
## 5.3.0
This is a production release that adds features and has a few bug fixes.
First, support for editline and readline history has been added. To use
editline, pass `-e` to `configure.sh`, and to use readline, pass `-r`.
Second, history support for Windows has been fixed and re-enabled.
Third, command-line options to set `scale`, `ibase`, `obase`, and `seed` were
added. This was requested long ago, and I originally disagreed with the idea.
Fourth, the manuals had typos and were missing information. That has been fixed.
Fifth, the manuals received different formatting to be more readable as
manpages.
## 5.2.5
This is a production release that fixes this `bc`'s behavior on `^D` to match
GNU `bc`.
## 5.2.4
This is a production release that fixes two bugs in history:
* Without prompt, the cursor could not be placed on the first character in a
line.
* Home and End key handling in `tmux` was fixed.
Any users that do not care about these improvements do not need to upgrade.
## 5.2.3
This is a production release that fixes one bug, a parse error when passing a
file to `bc` using `-f` if that file had a multiline comment or string in it.
## 5.2.2
This is a production release that fixes one bug, a segmentation fault if
`argv[0]` equals `NULL`.
This is not a critical bug; there will be no vulnerability as far as I can tell.
There is no need to update if you do not wish to.
## 5.2.1
This is a production release that fixes two parse bugs when in POSIX standard
mode. One of these bugs was due to a quirk of the POSIX grammar, and the other
was because `bc` was too strict.
## 5.2.0
This is a production release that adds a new feature, fixes some bugs, and adds
out-of-source builds and a `pkg-config` file for `bcl`.
The new feature is the ability to turn off exiting on expressions. It is also
possible to set the default using `configure.sh`. This behavior used to exist
with the `BC_EXPR_EXIT` environment variable, which is now used again.
Bugs fixed include: