I'm trying to run make
using the makefile below from my command line. I then receive the following error make: nothing can be done for all
. The contents of the makefile are given below.
GENERATED_FILES = \
dw.js/dw-2.0.js \
www/static/css/datawrapper.css \
www/static/css/chart.base.css
all: $(GENERATED_FILES)
clean:
rm -f -- $(GENERATED_FILES)
dw.js/dw-2.0.js: dw.js/src/*.js
cd dw.js
grunt
assets: www/static/css/datawrapper.css www/static/css/chart.base.css
# www/static/js/dw-2.0.js: dw.js/dw-2.0.js
# @cp dw.js/dw-2.0.js www/static/js/
# www/static/js/dw-2.0.min.js: dw.js/dw-2.0.js
# @php -r "require 'vendor/autoload.php'; file_put_contents('www/static/js/dw-2.0.min.js', \JShrink\Minifier::minify(file_get_contents('dw.js/dw-2.0.js')));"
messages:
scripts/update-messages.sh
www/static/css/datawrapper.css: assets/styles/datawrapper/* assets/styles/datawrapper/**/*
node_modules/.bin/lessc assets/styles/datawrapper/main.less > $@
www/static/css/chart.base.css: assets/styles/chart.base/*
node_modules/.bin/lessc assets/styles/chart.base/main.less > $@`
What is most likely happening is that the files you're attempting to generate already exist. Why does this prevent the make command from building you're files? It's because of the way make
interprets makefiles.
Let's look at a generic makefile rule below and interpret it manually.
target: prerequistes
actions
make target
will check and compare the time-stamp of the file target
to the timestamps of all the prerequisite files. If any of the prerequisites have a more recent time-stamp than the target (ie one of the prereqs is "younger"), then actions
will be executed.
So, if the prerequisites
have already been made and all have the same timestamp has target
, then make
will write the message make: nothing can be done for target
So, you can do two things. The best thing to do is to ensure that the files you're trying to generate do not exist. Another solution would to run make -B target
which will cause make
to always make your targets
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.