- Using Dependencies on Make.
- Make: sequences
Please @AirCrewMentor check this post to see if I got the process right. Any tuto for make that I could follow?
1. Using Dependencies on Make.
We created Dependencies so make can keep track of the files that are being modified and act only at the ones that have been modified.
In this example, when we run
Make dist the order followed would be this:
- Go to dist/ and it would create the dir and it would copy from public/ all the files that were modified, this is what public dependencies specifies.
- dist/js/main.browserify it would be run only if on of the files on the Browserfy Dependencies has been modified.
BROWSERIFY_DEPENDENCIES = $(wildcard lib/*.js package.json node_modules/*/package.json)
PUBLIC_DEPENDENCIES = $(wildcard public/**)
dist/js/main.browserify.js: dist/ $(BROWSERIFY_DEPENDENCIES)
echo "Generating browserify file…"
browserify lib/index.js > dist/js/main.browserify.js
mkdir -p dist
cp -av public/* dist/
2. Make: sequences
Since the commands with slashes doesn’t appear on bash when tabbing with make written, we create a
dist: dist/js/main.browserify.js that will concatenate all the commands with their dependencies.
dist/js/main.browserify.js: dist/ $(BROWSERIFY_DEPENDENCIES) before running the proper commands it would run the
dist/ command, later will check the BROWSERIFY_DEPENDENCIES and proceed with its commands.
- Back to the code.
- Show some work