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

Automatic Make variables, part 2 #20

Merged
merged 6 commits into from
Mar 17, 2022
Merged

Conversation

turboencabulator
Copy link
Contributor

This contains a few replacements that didn't make it into #17:

  • Use $@ and $< in the rules (particularly suffix rules), except don't use $< outside of pattern/suffix rules since it isn't portable (a GNU Make extension for the first prerequisite).
  • Replace cd dir; cmd with (cd dir && cmd).
  • Replace make with $(MAKE).

Three other small changes that help when using these automatic variables:

  • I've split the all-scripts target in contrib/jobling/Makefile into rules to build each of its constituent files, using $@ as appropriate. Removes the need to touch all-scripts to prevent unnecessarily rebuilding these.
  • I've moved all chmod +x commands to where the target file is created so these can also use $@.
  • I've removed the .nw.o suffix rule from src/c/Makefile, instead relying on the .nw.c rule followed by the usually built-in .c.o rule.

Check their status using && instead of assuming they succeed.

Always execute them in a subshell.  Some flavors of make allow all
commands to run in the same shell.
$< should only be used in suffix rules for portability.
Replace the all-scripts target with targets for each .awk file.
@nrnrnr nrnrnr merged commit faaaefe into nrnrnr:master Mar 17, 2022
@turboencabulator turboencabulator deleted the autovar branch March 18, 2022 06:47
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