Souparno Majumder Souparno Majumder - 4 months ago 28
Node.js Question

Buiding javascript with Makefile

I have cloned a nodejs project, and the project containes a Makefile

SRC = $(wildcard lib/**/*.js)
CSS = $(wildcard lib/**/*.css)
HTML = $(wildcard lib/**/*.html)
COMPONENTJSON = $(wildcard lib/*/component.json)
TEMPLATES = $(HTML:.html=.js)

build: components $(SRC) $(CSS) $(TEMPLATES)
@echo building
@component build

components: component.json $(COMPONENTJSON)
@echo installing
@component install

%.js: %.html
@echo converting
@component convert $<

minify:
@component build --use component-minify

clean:
@echo cleaning
rm -fr build components $(TEMPLATES)

.PHONY: clean minify


I didnot know before that make can be used to build javascript, and when i am running
make
I am getting the error

installing
make: component: Command not found
make: *** [components] Error 127


My qestion is,


1.is it using the same default make provided by unix system, or is it using some kind of other node library?


2.if it is the same system default, why I am getting the error?



link to the example project

Answer

The file is using the same make found in any unix/linux system. The error was due to the unavailability of the component package. I installed component using:

npm install -g component
Comments