Makefile: Run npm install when necessary
Also mark phony targets as such.
This commit is contained in:
parent
ea2149157f
commit
23031d8b2f
2 changed files with 8 additions and 4 deletions
7
Makefile
7
Makefile
|
|
@ -1,6 +1,6 @@
|
||||||
PACKAGE_NAME := $(shell python3 -c "import json; print(json.load(open('package.json'))['name'])")
|
PACKAGE_NAME := $(shell python3 -c "import json; print(json.load(open('package.json'))['name'])")
|
||||||
|
|
||||||
all:
|
all: node_modules/react-lite
|
||||||
NODE_ENV=$(NODE_ENV) npm run build
|
NODE_ENV=$(NODE_ENV) npm run build
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
@ -40,3 +40,8 @@ rpm: dist-gzip
|
||||||
find `pwd`/output -name '*.rpm' -printf '%f\n' -exec mv {} . \;
|
find `pwd`/output -name '*.rpm' -printf '%f\n' -exec mv {} . \;
|
||||||
rm -r "`pwd`/rpmbuild"
|
rm -r "`pwd`/rpmbuild"
|
||||||
rm -r "`pwd`/output" "`pwd`/build"
|
rm -r "`pwd`/output" "`pwd`/build"
|
||||||
|
|
||||||
|
node_modules/react-lite:
|
||||||
|
npm install
|
||||||
|
|
||||||
|
.PHONY: all clean install install-only dist-gzip srpm rpm
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,8 @@ Scaffolding for a [Cockpit](http://www.cockpit-project.org) module.
|
||||||
|
|
||||||
# Building
|
# Building
|
||||||
|
|
||||||
Run `npm install` to install dependencies and `make` to build the package. It
|
Run `make` to build the package. It builds into the `dist` directory. Link or
|
||||||
builds into the `dist` directory. Link or copy that to a location were
|
copy that to a location were `cockpit-bridge` looks for packages.
|
||||||
`cockpit-bridge` looks for packages.
|
|
||||||
|
|
||||||
`make install` compiles and installs the package in `/usr/share/cockpit/`. The
|
`make install` compiles and installs the package in `/usr/share/cockpit/`. The
|
||||||
convenience targets `srpm` and `rpm` build the source and binary rpms,
|
convenience targets `srpm` and `rpm` build the source and binary rpms,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue