Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GNU make-style variables #2

Merged
merged 11 commits into from Nov 28, 2016
Merged

GNU make-style variables #2

merged 11 commits into from Nov 28, 2016

Conversation

ihh
Copy link
Member

@ihh ihh commented Nov 28, 2016

Brings variables into line with GNU make in various ways, including:

  • $A for single-letter variable names, $(ABC) for multi-letter variable names
  • allow variables to be specified from the plmake command line with ABC=foo syntax
  • three different ways to set a variable, as per here:
    • ABC := $(DEF) defines a simply expanded variable, which means $(DEF) is evaluated at the time of assignment. This was the former default
    • ABC = $(DEF) defines a recursively expanded variable, which just means $(DEF) is evaluated whenever $(ABC) is used (I think of this as lazy evaluation, rather than being particularly recursive; hopefully I have not misunderstood what GNU make is doing here)
    • ABC ?= $(DEF) is a conditional variable assignment, so variable ABC is only overwritten if it has not already been set (e.g. on the command line)
    • NB there are new operators for := and ?= so you can also use them in the Prolog dialect of makespec.pro makeprogs

Also added

  • change in default makefile-seeking behavior (now looks for a Prolog makespec.pro, then a GNU Makefile)
  • include directives for GNU Makefiles, so you can recursively include makefiles inside other makefiles, as per here
  • line numbers for syntax errors when parsing GNU Makefiles, which work in include'd files
  • some examples in examples/Makefile.foo (probably should make these into proper tests... any thoughts on a good test framework?)

Prolog is kicking my arse in general, I am still only half-understanding most of the code, but this all seems to work... famous last words.

@cmungall cmungall merged commit 37fdebe into evoldoers:master Nov 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants