summaryrefslogtreecommitdiff
path: root/lib/Automake
Commit message (Collapse)AuthorAgeFilesLines
* Updated include directive and added test cases.experimental/gsoc/astVishal Gupta2018-08-0411-26/+70
| | | | | | | After parsing the file given in the include directive, the tree generated is printed to standard input using Data::Dumper and this is evaled in the program having include directive. As a result the tree gets appended to the parent AST.
* Added case for testing recursive automake at multiple depthVishal Gupta2018-08-042-1/+3
|
* Updated make install to make parser work from any directoryVishal Gupta2018-08-046-37/+53
| | | | | | | | | | *Added parser.pl to /usr/bin so that it can work from any directory Modules are copied to /tmp/parser and the location is updated in parser.pl. This is for development purpose only and it can be changed in future. *Added a basedir variable so that recursive automake can work to arbitrary depth
* Added support for include directiveVishal Gupta2018-07-255-33/+49
| | | | Added lexer and parser support for include directive to handle fragements.
* Subdirs implementationVishal Gupta2018-07-128-37/+40
| | | | | | Added support to recursively call parser.pl on the directories defined in SUBDIRS variable. Added test case.
* Updated parser to tokenize and parse line by line.Vishal Gupta2018-07-066-48/+46
| | | | | | Lexer tokenizes the current line whenever it is called by parser. "end" token is returned when EOF is encountered. Currently assumes that newline is their before EOF.
* Added support for SUBDIRS and nested if/else statementVishal Gupta2018-07-026-27/+64
|
* Updated multiline statement and conditional statements.Vishal Gupta2018-06-2415-89/+158
| | | | | | | | * Added new test cases. * Added support for += . * Updated conditional statements to handle multiple statements inside * if/else block. * Prints error when comment follow trailing backslash.
* Added support for Conditional statement and Test files.Vishal Gupta2018-06-1616-129/+312
| | | | | | | | | | | | | | | * automake.y : Updated to handle conditional statement and empty variable * defination * parser.pl : Updated to read from standard input and write to standard * output. In debug mode, output on standard error stream. * Converter.pl : Updated to handle empty grammar definitions. * Tree.pm : Updated to handle conditional statements and write output to * standard output * Makefile : Added action test. * test.sh : Read all text files in t directory and generates corresponding * standard output * Makefile : Added action test. * t/*.txt : test files.
* Added support for multiline and comments.Vishal Gupta2018-06-118-89/+287
| | | | | | | | * automake.y : Updated the grammar to handle multiline statements and two * type of comments. * Lexer.pm, Tree.pm, parser.pl : Updated to support new features. * input.txt : Updated to test combination of multiline statements and * comments.
* Update Converter.pl to read write from Standard I/OVishal Gupta2018-06-043-24/+38
| | | | | | *Converter.pl: Updated the file to use input/output redirection in Makefile. *Makefile: Updated Makefile to support IO in converter.pl
* Use the ‘perl’ found in the PATH environment variableMathieu Lirzin2018-06-021-3/+3
|
* Remove generated ‘.png’ filesMathieu Lirzin2018-06-023-1/+2
|
* Automatic conversion of bison graph to parsing table.Vishal Gupta2018-06-017-41/+140
| | | | | | | | | * Converter.pl: Converts graph generated by bison (automake.dot) to table used by the parser. * Makefile: Executes the parser on input.txt file. build target builds the grammar and executes Converter.pl * Lexer.pm: Return "newline" as token instead of "\n". * automake.y, automake.png: Updated to handle "newline" token.
* Implemented Lexer, Parser and AST module.vishalgupta972018-05-269-0/+368
| | | | | | | | | | | | | The grammar seperates the automake rule into left side and right side. It divides the left side according to the primaries like PROGRAMS, LIBRARIES. * Lexer.pm: Lexer module. Converts a string into tokens. * ParserTable.pm: Contains the parsing table. * automake.y: Contains the grammar. * automake.png: Contains the state transition diagram generated by the grammar. * Tree.pm: Contains submodules for creating tree nodes. * parser.pl: Implements the parser.
* automake: Don't rely on List::Util to provide 'none'Mathieu Lirzin2018-03-081-1/+19
| | | | | | | | | | | | | This change fixes automake bug#30631. This removes the use of List::Util which is not supported by Perl 5.6, by reimplementing the 'none' subroutine. * lib/Automake/General.pm (none): New subroutine. * bin/automake.in (handle_single_transform): Use it. * t/pm/General.pl: New test. * t/list-of-tests.mk (perl_TESTS): Add it. * NEWS: Update.
* maint: Update copyright years to 2018Mathieu Lirzin2018-01-0422-22/+22
| | | | This update has been made with 'make update-copyright'.
* maint: Make Emacs use 'makefile-automake-mode'Mathieu Lirzin2017-09-231-2/+1
| | | | | | | | | | | * bin/local.mk: Specify mode name in the first line. * contrib/t/local.mk: Likewise. * doc/local.mk: Likewise. * lib/Automake/local.mk: Likewise. * lib/am/local.mk: Likewise. * lib/local.mk: Likewise. * m4/local.mk: Likewise. * t/local.mk: Likewise.
* maint: Configure Emacs automatically with ".dir-locals.el"Mathieu Lirzin2017-09-2221-357/+0
| | | | | * .dir-locals.el: New Emacs directory configuration file. All perl files adapted.
* Prefer https: URLsPaul Eggert2017-09-1922-22/+22
| | | | | | | | | | | | | | | | | | | | | In Gnulib, Emacs, etc. we are changing ftp: and http: URLs to use https:, to discourage man-in-the-middle attacks when downloading software. The attached patch propagates these changes upstream to Automake. This patch does not affect files that Automake is downstream of, which I'll patch separately. Althouth the resources are not secret, plain HTTP is vulnerable to malicious routers that tamper with responses from GNU servers, and this sort of thing is all too common when people in some other countries browse US-based websites. See, for example: Aceto G, Botta A, Pescapé A, Awan MF, Ahmad T, Qaisar S. Analyzing internet censorship in Pakistan. RTSI 2016. https://dx.doi.org/10.1109/RTSI.2016.7740626 HTTPS is not a complete solution here, but it can be a significant help. The GNU project regularly serves up code to users, so we should take some care here.
* build: Rename "Makefile.inc" Makefile fragments to "local.mk"Mathieu Lirzin2017-08-311-0/+0
| | | | | | | | | | | | | | | | | | | | | | This is done to follow a convention used by a lot of GNU packages. * bin/Makefile.inc: Rename to ... * bin/local.mk: ... this. * doc/Makefile.inc: Rename to ... * doc/local.mk: ... this. * lib/Automake/Makefile.inc: Rename to ... * lib/Automake/local.mk: ... this. * lib/am/Makefile.inc: Rename to ... * lib/am/local.mk: ... this. * lib/Makefile.inc: Rename to ... * lib/local.mk: ... this. * m4/Makefile.inc: Rename to ... * m4/local.mk: ... this. * contrib/t/Makefile.inc: Rename to ... * contrib/t/local.mk: ... this. * t/Makefile.inc: Rename to ... * t/local.mk: ... this. Adapt. * Makefile.am: Adapt.
* config: Support AUTOMAKE_LIBDIR environment variableMathieu Lirzin2017-08-301-1/+1
| | | | | | | | * lib/Automake/Config.in: Let AUTOMAKE_LIBDIR environment variable override the default location for '$libdir'. * doc/automake.texi (automake Invocation): Document AUTOMAKE_LIBDIR. * pre-inst-env.in (AUTOMAKE_LIBDIR): Set AUTOMAKE_LIBDIR. * bin/wrap-automake.in: Don't use "--libdir" option.
* maint: Update copyright years to 2017.Mathieu Lirzin2017-03-0222-22/+22
| | | | This update has been made with 'make update-copyright'.
* maint: update copyright years to 2015 (branch 'micro')Stefano Lattarini2015-01-0522-22/+22
| | | | Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* maint: update copyright yearsStefano Lattarini2014-04-2122-22/+22
| | | | | | We've been in 2014 already for few months now... Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* Allow user to extend .PRECIOUS targetStefano Lattarini2013-12-261-1/+1
| | | | | | | | | | | | | | | | | | References: <http://lists.freedesktop.org/archives/systemd-devel/2013-July/012155.html> <http://lists.gnu.org/archive/html/automake/2013-07/msg00011.html> * bin/automake.in: Adjust to ensure we handle '.PRECIOUS' the same way we do for '.PHONY' and '.MAKE'. * lib/Automake/Rule.pm: Likewise. * t/precious.sh: New test. * t/list-of-tests.mk: Add it. * t/phony.sh: Enhance a little while at it. * NEWS: Update. * THANKS: Likewise. Reported-by: Holger Hans Peter Freyther <holger@freyther.de> Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* automake: account for perl hash order randomizationStefano Lattarini2013-10-311-7/+7
| | | | | | | | | | | | | | | | | | | | | Try to explicitly order the keys of some perl hashes when looping on them to do sanity/correctness checks and possibly display warning messages; this should ensure a more reproducible output. Not really a big deal, but I prefer to keep the order of such output reproducible if possible. Issue revealed by spurious testsuite failures with perl 5.18, as reported in automake bug#14891. See also: <http://search.cpan.org/dist/perl-5.18.0/pod/perldelta.pod#Hash_randomization> <http://onionstand.blogspot.ie/2012/12/are-you-relying-on-hash-keys-being.html> * lib/Automake/Variable.pm (variables): Explicitly order the values of the returned Automake::Variable instances. (variables_dump): Simplify, using the knowledge that 'variables()' now sorts its output. * t/preproc-errmsg.sh: Adjust. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* Merge branch 'micro' into maintStefano Lattarini2013-06-121-14/+1
|\ | | | | | | | | | | | | | | | | * micro: THANKS: update e-mall address for Ralf Corsepius lang, suffix rules: don't require C stuff needlessly tests: expose automake bug#14560 Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
| * lang, suffix rules: don't require C stuff needlesslyStefano Lattarini2013-06-121-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change fixes automake bug#14560: when two or more user-defined suffix rules were present in a single Makefile.am, automake would needlessly include definition of some make variables related to C compilation in the generated Makefile.in. * automake.in (handle_languages): Fix logic to decide whether or not to include definitions of C compilation related variables in the generated Makefile.in: instead of doing so when two or more user-defined suffix rules are seen (which is a completely bogus criterion), do so when two or more compiled languages are used. * lib/Automake/Rule.pm (suffix_rules_count): Remove as no longer used. (@EXPORT): Adjust. * t/list-of-tests.mk (XFAIL_TESTS): No longer list the test script 'suffix-extra-c-stuff-pr14560.sh', which now passes. * NEWS: Update. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* | Merge branch 'micro' into maintStefano Lattarini2013-06-091-2/+2
|\ \ | |/ | | | | | | | | | | | | | | * micro: maint: add a missing copyright notice sync: update config.guess from upstream tests: expose automake bug#13928 comments: fix some out-of-sync refs to test scripts tests: expose automake bug#13940
| * comments: fix some out-of-sync refs to test scriptsStefano Lattarini2013-06-081-2/+2
| | | | | | | | | | | | | | | | | | Those script has been renamed since those comments where written. * lib/Automake/Rule.pm: Adjust. * lib/am/distdir.am: Likewise. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* | Merge branch 'micro' into maintStefano Lattarini2013-05-291-54/+55
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | * micro: NEWS: fix typos and grammaros NEWS: document fix for bug#14441 Automake::Rule: consistently prepend underscore to private variables Automake::Rule: rename: suffix_rule() -> next_in_suffix_chain() Automake::Rule: adjust comments and POD according to previous changes Automake::Rule: make private variables lexically scoped suffix rules: better distinction between builtin and user-derived Automake::Rule: expose suffix rules as a function, not a scalar tests: expose automake bug#14441
| * Automake::Rule: consistently prepend underscore to private variablesStefano Lattarini2013-05-281-15/+15
| | | | | | | | | | | | | | | | | | | | | | * lib/Automake/Rule.pm (%suffix_rules): Rename ... (%_suffix_rules): ... like this. (%suffix_rules_builtin): Rename ... (%_suffix_rules_builtin): ... like this. (reset, next_in_suffix_chain, register_suffix_rule, suffix_rules_count): Adjust. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
| * Automake::Rule: rename: suffix_rule() -> next_in_suffix_chain()Stefano Lattarini2013-05-281-5/+6
| | | | | | | | | | | | | | | | | | | | * lib/Automake/Rule.pm (suffix_rule): Rename ... (next_in_suffix_chain): ... like this. (%suffix_rules): Adjust comments. (@EXPORT): Adjust. * automake.in (derive_suffix): Likewise. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
| * Automake::Rule: adjust comments and POD according to previous changesStefano Lattarini2013-05-281-38/+32
| | | | | | | | | | | | | | * lib/Automake/Rule.pm: Here, in several places. * automake.in (register_language): And a tiny adjustment here as well. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
| * Automake::Rule: make private variables lexically scopedStefano Lattarini2013-05-281-5/+4
| | | | | | | | | | | | | | | | * lib/Automake/Rule.pm (@_known_extensions_list): This one. (@_suffixes): And this one. (%_rule_dict): And this one. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
| * suffix rules: better distinction between builtin and user-derivedStefano Lattarini2013-05-281-19/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes automake bug#14441. * lib/Automake/Rule.pm ($_suffix_rules_default): Remove, superseded by ... (%suffix_rules_builtin): ... this lexical variable. ($suffix_rules): Remove, superseded by ... (%suffix_rules): ... this lexical variable. (suffix_rules, suffix_rules_count): Adjust. (register_suffix_rule): Update '%suffix_rules_builtin' rather than '%suffix_rules' if the location (as passed by the '$where' argument) is an "internal" one (doesn't come from user-provided Makefile.am). (reset): Simplify resetting of '%suffix_rules' to the default ones accordingly. * t/list-of-tests.mk (XFAIL_TESTS): Drop test 'suffix-custom-pr14441.sh'. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
| * Automake::Rule: expose suffix rules as a function, not a scalarStefano Lattarini2013-05-281-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is just a preparatory refactoring in view of future patches. No semantic change is intended. * lib/Automake/Rule.pm ($suffix_rules): Turn from a package-level variable to a lexical variable. (suffix_rule): New function, expose the details of $suffix_rules that are actually required by code outside thus modules --- and only those details, no more. (@EXPORT): Adjust. * automake.in (derive_suffix): Likewise. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* | options: tiny simplification in dealing with incompatible versionsStefano Lattarini2013-05-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * lib/Automake/Options.pm (_process_option_list): Here, when an incompatible version number option is detected, there's no need to call error() with the "uniq_scope => US_GLOBAL" switch. In fact, if the same incompatible version number is specified in AUTOMAKE_OPTIONS in both (say) 'Makefile.am' and 'sub/Makefile.am', we want each such erroneous usage reported separately, rather than just the first time it is encountered (as we'd expect to happen when "uniq_scope => US_GLOBAL" is used). Ideally, this change should have been folded into the similar commit 'v1.13.1d-129-gf7ef16f', but we noticed that too late. Oh well. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* | options: try to report as much errors as possibleStefano Lattarini2013-05-111-8/+11
| | | | | | | | | | | | | | | | | | | | For example, if two invalid options are used in AUTOMAKE_OPTIONS, don't report just the first one, but both of them. * lib/Automake/Options.pm (_process_option_list): Do so by avoiding early returns in here. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* | refactor: fix few "inverted boolean" usagesStefano Lattarini2013-05-101-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some subroutines, we used a return value of 0 to indicate success, and a return status of 1 to indicate failure. That was not very consistent with the perl interpretation of 0 as a false value and 1 as a true value. So we now invert the meaning of the exit statuses. * lib/Automake/Options.pm (_process_option_list): Here. (process_global_option_list, process_option_list): And by reflex, here as well. * bin/automake.in (handle_options): And here. (generate_makefile, scan_autoconf_traces): Adjust. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* | options: better name for an internal functionStefano Lattarini2013-05-101-3/+3
| | | | | | | | | | | | | | * lib/Automake/Options.pm (_option_must_be_from_configure): Rename ... (_option_is_from_configure): ... like this. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* | options: more consistency in use of return statuses to report errorsStefano Lattarini2013-05-101-2/+6
| | | | | | | | | | | | | | | | * lib/Automake/Options.pm (_option_must_be_from_configure): By giving a proper return status here. (_process_option_list): And using it here. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* | options: tiny simplification in dealing with erroneous optsStefano Lattarini2013-05-101-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | * lib/Automake/Options.pm (_process_option_list): Here, when an invalid option is detected, there's no need to call &error with the "uniq_scope => US_GLOBAL" switch. In fact, if the same erroneous option is specified in AUTOMAKE_OPTIONS in both (say) 'Makefile.am' and 'sub/Makefile.am', we want each such erroneous usage reported separately, rather than just the first time it is encountered (as happens when "uniq_scope => US_GLOBAL" is used). Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* | options: consistently use return statuses to report errorsStefano Lattarini2013-05-101-3/+6
| | | | | | | | | | | | | | | | * lib/Automake/Options.pm (_process_option_list): Here. (process_option_list, process_global_option_list): Remove redundant use of 'return'. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* | options: re-enable some sanity checksStefano Lattarini2013-05-101-2/+2
| | | | | | | | | | | | | | | | | | | | They had been unwittingly disabled by a slightly incorrect code ordering. * lib/Automake/Options.pm (process_option_list): Here. (process_global_option_list): And here. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* | dist: deprecated shar and tar+compress formatsStefano Lattarini2013-05-101-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See also discussion about automake wishlist bug#13324. * lib/Automake/Options.pm: Give proper warnings in the 'obsolete' category if the 'dist-shar' or 'dist-tarZ' options are used. * lib/distdir.am: When the 'dist-tarZ' or 'dist-shar' targets are invoked, make them give a non-fatal warning. * doc/automake.texi: Report the new deprecations. * t/dist-shar.sh: New test. * t/dist-tarZ.sh: Likewise. * t/lzma.sh: While at it, rename ... * t/dist-lzma.sh: ... like this, and tweak it to keep more in sync with the new tests. * t/dist-formats.tap: Remove references to deprecated formats. * t/list-of-tests.mk: Adjust. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* | build: break up monolithic Makefile.am in subdir-specific fragmentsStefano Lattarini2013-05-091-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is convenient to do, now that we have improved "relative directory" support with the '%reladir%' (a.k.a. '%D%') and '%canon_reladir%' (a.k.a. '%C%') Automake-time substitutions for included makefile fragments. This move also satisfy our philosophy of using new Automake features in our own build system, as a way of facilitating early discovery of possible bugs or interface warts. * Makefile.am: Break up ... * doc/Makefile.inc, lib/Automake/Makefile.inc, lib/Makefile.inc, lib/am/Makefile.inc, m4/Makefile.inc, t/Makefile.inc): ... in this new included fragments. Adjust as needed, and make deliberate use of the '%D%' substitution. * contrib/t/local.am: Rename ... * contrib/t/Makefile.inc: ... like this. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
* | Merge branch 'branch-1.13.2' into maintStefano Lattarini2013-04-191-1/+1
|\ \ | |/ | | | | | | | | * branch-1.13.2: Add missing '$' for variable expansion in depout.m4 fixup: one stray reference to older versioning scheme
| * fixup: one stray reference to older versioning schemeStefano Lattarini2013-02-211-1/+1
| | | | | | | | | | | | | | * lib/Automake/Options.pm: Here, in a FIXME comment: reference "Automake 3.0" rather than "Automake 1.15". Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>