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

  • Home
  • SEARCH
  • 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 7416191
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:26:44+00:00 2026-05-29T07:26:44+00:00

You can see the first problem here , it was solved, thx Eldar Abusalimov.

  • 0

You can see the first problem here, it was solved, thx Eldar Abusalimov. Now I need to put right targets and dependencies for uic.exe call.
The beginning of the code is:

ui_files := $(wildcard $(SUBDIRS:%=%/*.ui))
ui_headers := $(foreach ui_files,$(ui_files),$(dir $(ui_files))ui_$(notdir $(ui_files:.ui=.h)))
ui_cpp := $(patsubst %.h, %.cpp, $(ui_headers))

First, I need to do is to generate headers what I was trying to do by this code:

<directory/ui_<ui_file_name>.h>: <ui_file_path>
    $(QT_BIN)/uic -o $@ $< 

Second, I generate cpps :

<directory/ui_<ui_file_name>.cpp>: <ui_file_path> <header_file_path>
$(QT_BIN)/uic -i <header_file_path> -o <target> <ui_file_path>

Help me please, to fill this not-make syntax by make syntax or give me an appropriate method.

Thanks.

  • 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-29T07:26:45+00:00Added an answer on May 29, 2026 at 7:26 am

    I guess it should be something like this (however, I’m not sure, how Make will deal with directory part of the files):

    $(ui_headers) : ui_%.h : %.ui
        $(QT_BIN)/uic -o $@ $< 
    
    $(ui_cpp) : %.cpp : %.ui ui_%.h
        $(QT_BIN)/uic -i $(word 2,$^) -o $@ $<
    

    Both rules are static pattern rules.

    UPD.

    Static pattern rule are not good here, because the pattern is applied to the whole file name (with a path). Instead, one should use regular pattern rules:

    ui_%.h : %.ui
        $(QT_BIN)/uic -o $@ $< 
    
    %.cpp : %.ui ui_%.h
        $(QT_BIN)/uic -i $(word 2,$^) -o $@ $<
    

    How Patterns Match chapter explains how does it work:

    When the target pattern does not contain a slash (and it usually does not), directory names in the file names are removed from the file name before it is compared with the target prefix and suffix. After the comparison of the file name to the target pattern, the directory names, along with the slash that ends them, are added on to the prerequisite file names generated from the pattern rule’s prerequisite patterns and the file name. The directories are ignored only for the purpose of finding an implicit rule to use, not in the application of that rule.

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

Sidebar

Related Questions

You can easily see the problem on the first page here: http://m.vancouverislandlife.com/ Scroll down
You can see my posted code here . My original problem was more or
update I solved this problem by myself. I put it here for further reference.
I can see it looks like an alias for an unsigned int pointer, right?
This problem has been solved thanks to your suggestions. See the bottom for details.
(Problem solved, please see the updates) I have some files that have incorrect filenames
Problem: Need to sort array before operating on them with function. First, array is
I have sliced a design (see the first psd here ) for my practice,
I can see people asking all the time whether multiple inheritance should be included
We can see in a directory files ordered by Name in Windows Explorer. If

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.