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 5939327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:48:46+00:00 2026-05-22T15:48:46+00:00

I have several widgets denoted by a config.xml in their root in a directory

  • 0

I have several widgets denoted by a config.xml in their root in a directory layout.

The GNUmakefile I have here is able to build them. Though if I update the folders, the dependencies aren’t tracked. I don’t want to depend on a clean target obviously, so how do I track the contents of each folder?

WGTS := $(shell find -name 'config.xml' | while read wgtdir; do echo `dirname $$wgtdir`.wgt; done )
all: $(WGTS)
%.wgt: 
    @cd $* && zip -q -r ../$(shell basename $*).wgt .
    @echo Created $@
clean:
     rm -f $(WGTS)

I hoped something like:

 %.wgt: $(shell find $* -type f)

Would work, but it doesn’t. Help.

  • 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-22T15:48:46+00:00Added an answer on May 22, 2026 at 3:48 pm

    Combining Beta’s idea with mine:

    WGTS := $(shell find -name config.xml)
    WGTS := $(WGTS:/config.xml=.wgt)
    WGTS_d := $(WGTS:.wgt=.wgt.d)
    
    all: $(WGTS)
    clean:
        rm -f $(WGTS) $(WGTS_d)
    
    -include $(WGTS_d)
    
    define WGT_RULE
    $(1): $(shell find $(1:.wgt=))
    $(1:.wgt=)/%:
        @
    endef
    $(foreach targ,$(WGTS),$(eval $(call WGT_RULE,$(targ))))
    %.wgt:
        @echo Creating $@
        @(echo -n "$@: "; find $* -type f | tr '\n' ' ') > $@.d
        @cd $* && zip -q -r ../$(shell basename $*).wgt .
    

    Example:

    $ mkdir -p foo bar/nested
    $ touch {foo,bar/nested}/config.xml
    $ make
    Creating bar/nested.wgt
    Creating foo.wgt
    $ make
    make: Nothing to be done for `all'.
    $ touch foo/a
    $ make
    Creating foo.wgt
    $ rm foo/a
    $ make
    Creating foo.wgt
    $ make
    make: Nothing to be done for `all'.
    

    The only potential problem here is the dummy rule that lets make ignore targets it doesn’t know how to build which are nested inside the directories. (foo/a in my example.) If those are real targets that make needs to know how to build, the duplicate recipe definition may be a problem.

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

Sidebar

Related Questions

I have a wx.Frame, in which there is a main wx.Panel with several widgets
I currently have a Table [org.eclipse.swt.widgets.Table] with several TableColumns; however, due to UI space
We have several jobs that run concurrently that have to use the same config
I have a QDialog that contains several dock widgets and one QGraphicsView. The widget
I have several widgets involved in a presentation that need to interact with each
I'm getting in to a situation where I have several interacting widgets (on a
I have a class in my Python module that frobs widgets. It has several
I have created a sort of CMS with GWT. This CMS has several widgets
I have a page that uses several dijit form widgets. I also have an
I have a Gallery whose Adapter creates several LinearLayout instances. Those linear layout instances

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.