Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Makefile Enhancement Proposal #213

Closed
wilmoore opened this issue Dec 23, 2012 · 5 comments
Closed

Makefile Enhancement Proposal #213

wilmoore opened this issue Dec 23, 2012 · 5 comments

Comments

@wilmoore
Copy link
Contributor

Proposing the following:

COMPONENT ?= $(firstword $(shell which $(CURDIR)/node_modules/.bin/component) $(shell which component))

build: components index.js
    @$(COMPONENT) build --dev

components: component.json
    @$(COMPONENT) install --dev

clean:
    $(RM) -fr build components template.js

Rationale

  • The $(COMPONENT) variable allows allows automatic use of either local component (if it exists) or the globally installed component.
  • The ?= allows you to pass in some other path to component (not sure there is a use-case for that, but why not -- it's free with GNU Make)
  • The $(RM) variable is just a little more portable this way (this is pretty pendantic, but I can't see any downside) - The only way this is bad is if someone uses turns on -R or --no-builtin-variables; though, anyone doing that knows what they are doing and know how to correct the issue.

Let me know...if this looks good, I'll issue a PR.

@wilmoore
Copy link
Contributor Author

The original for context:

build: components index.js
    @component build --dev

components: component.json
    @component install --dev

clean:
    rm -fr build components template.js

.PHONY: clean

@timoxley
Copy link
Contributor

Why not just issue a PR?

@wilmoore
Copy link
Contributor Author

@timoxley easier to bat the mockup around in an issue in case it isn't desirable as-is :)

@wilmoore
Copy link
Contributor Author

That being said, #214 has been created.

@wilmoore
Copy link
Contributor Author

We should close this also :)

@tj tj closed this as completed Dec 31, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants