Note that there are some explanatory texts on larger screens.

plurals
  1. POhave make build/minimize JS files that have changed
    text
    copied!<p>I'm trying to learn Make and building a Makefile into my app to help me with building and minimizing my .js files for use of a combo loader server application later on.</p> <p>What I'm trying to accomplish is that when I run make, it'll copy over to the build directory only the .js files that have changed since the last run, and then minify that file and generate a -min.js copy. Finally I need to always make sure I generate a new meta.js file.</p> <p>I've pasted what I have working below, the trouble with this is that it's not picking only the changed .js files, but each file on each run. I'm missing something in how to get Make to pick only changed files in this instance.</p> <pre><code>BOOKIE_JS = bookie/static/js/bookie JS_BUILD_PATH = bookie/static/js/build JS_META_SCRIPT = scripts/js/generate_meta.py jsbuild: $(JS_BUILD_PATH)/bookie/meta.js clean_js: rm -rf $(JS_BUILD_PATH)/* $(JS_BUILD_PATH)/bookie/meta.js: $(BOOKIE_JS)/y*-min.js $(JS_META_SCRIPT) -n YUI_MODULES -s $(BOOKIE_JS)/y* -o $(JS_BUILD_PATH)/bookie/meta.js $(BOOKIE_JS)/y*-min.js: $(BOOKIE_JS)/y*.js scripts/js/jsmin_all.py $(JS_BUILD_PATH)/bookie # this is the part that runs for each .js file and I'd like it to only run for the *modified* files $(BOOKIE_JS)/y*.js: $(JS_BUILD_PATH)/bookie cp $@ $(JS_BUILD_PATH)/bookie/ $(JS_BUILD_PATH)/bookie: mkdir $(JS_BUILD_PATH)/bookie clean: clean_js .PHONE: clean clean_js </code></pre> <p>Current output:</p> <pre><code>cp bookie/static/js/bookie/yapi.js bookie/static/js/build/bookie/ cp bookie/static/js/bookie/ymodel.js bookie/static/js/build/bookie/ cp bookie/static/js/bookie/ytagcontrol.js bookie/static/js/build/bookie/ cp bookie/static/js/bookie/yview.js bookie/static/js/build/bookie/ scripts/js/jsmin_all.py bookie/static/js/build/bookie scripts/js/generate_meta.py -n YUI_MODULES -s bookie/static/js/bookie/y* -o bookie/static/js/build/bookie/meta.js </code></pre> <p>I'd like to see only the cp of the changed files.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload