Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7187061
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:45:48+00:00 2026-05-28T18:45:48+00:00

I’m trying to learn Make and building a Makefile into my app to help

  • 0

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.

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.

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.

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

Current output:

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

I’d like to see only the cp of the changed files.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:45:49+00:00Added an answer on May 28, 2026 at 6:45 pm

    I think you intended to make a pattern rule but used the wrong syntax. For example, this:

    $(BOOKIE_JS)/y*-min.js: $(BOOKIE_JS)/y*.js
        scripts/js/jsmin_all.py $(JS_BUILD_PATH)/bookie
    

    means each of the $(BOOKIE_JS)/y*-min.js files depends on the $(BOOKIE_JS)/y*.js files — all of them, not just the one with a similar name. If you do this:

    $(BOOKIE_JS)/y%-min.js: $(BOOKIE_JS)/y%.js
        scripts/js/jsmin_all.py $(JS_BUILD_PATH)/bookie
    

    then the % must be replaced with the same string on each side, so for example $(BOOKIE_JS)/yapi-min.js depends only on $(BOOKIE_JS)/yapi.js

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
We're building an app, our first using Rails 3, and we're having to build
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.