Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


Makefile Enhancement Proposal #213

wilmoore opened this Issue · 5 comments

3 participants

Wil Moore III Tim Oxley TJ Holowaychuk
Wil Moore III

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

    $(RM) -fr build components template.js


  • 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.

Wil Moore III

The original for context:

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

components: component.json
    @component install --dev

    rm -fr build components template.js

.PHONY: clean
Tim Oxley

Why not just issue a PR?

Wil Moore III

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

Wil Moore III

That being said, #214 has been created.

Wil Moore III

We should close this also :)

TJ Holowaychuk tj closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.