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

make Makefile GNU make v3.82 compatible #328

Merged
merged 2 commits into from Oct 6, 2011
Merged

make Makefile GNU make v3.82 compatible #328

merged 2 commits into from Oct 6, 2011

Conversation

larskotthoff
Copy link
Contributor

Quote from NEWS file:

In previous versions of make it was acceptable to list one or more explicit
targets followed by one or more pattern targets in the same rule and it
worked "as expected". However, this was not documented as acceptable and if
you listed any explicit targets AFTER the pattern targets, the entire rule
would be mis-parsed. This release removes this ability completely: make
will generate an error message if you mix explicit and pattern targets in
the same rule.

Quote from NEWS file:

In previous versions of make it was acceptable to list one or more explicit
targets followed by one or more pattern targets in the same rule and it
worked "as expected". However, this was not documented as acceptable and if
you listed any explicit targets AFTER the pattern targets, the entire rule
would be mis-parsed. This release removes this ability completely: make
will generate an error message if you mix explicit and pattern targets in
the same rule.
@mbostock
Copy link
Member

mbostock commented Oct 3, 2011

Is there a way to do this without duplicating the rule definition?

@larskotthoff
Copy link
Contributor Author

Well.

d3%js: Makefile
@rm -f $@
cat $(filter %js,$^) > $@
@chmod a-w $@

This works as well. Maybe a bit hacky without the dots?

@mbostock
Copy link
Member

mbostock commented Oct 3, 2011

Yeah. That's better. A small tweak:

d3.%: Makefile
    @rm -f $@
    cat $(filter %.js,$^) > $@
    @chmod a-w $@

I'm also tempted to add:

JS_FILES = \
    d3.js \
    d3.chart.js \
    d3.layout.js \
    d3.csv.js \
    d3.geo.js \
    d3.geom.js \
    d3.time.js

all: \
  $(JS_FILES) \
  $(JS_FILES:.js=.min.js) \
  package.json

mbostock added a commit that referenced this pull request Oct 6, 2011
make Makefile GNU make v3.82 compatible
@mbostock mbostock merged commit f70ab33 into d3:master Oct 6, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants