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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T06:20:13+00:00 2026-05-11T06:20:13+00:00

I am looking for suggestions to properly handle separate debug and release build subdirectories,

  • 0

I am looking for suggestions to properly handle separate debug and release build subdirectories, in a recursive makefile system that uses the $(SUBDIRS) target as documented in the gnumake manual to apply make targets to (source code) subdirectories.

Specifically, I’m interested in possible strategies to implement targets like ‘all’, ‘clean’, ‘realclean’ etc. that either assume one of the trees or should work on both trees are causing a problem.

Our current makefiles use a COMPILETYPE variable that gets set to Debug (default) or Release (the ‘release’ target), which properly does the builds, but cleaning up and make all only work on the default Debug tree. Passing down the COMPILETYPE variable gets clumsy, because whether and how to do this depends on the value of the actual target.

  • 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. 2026-05-11T06:20:14+00:00Added an answer on May 11, 2026 at 6:20 am

    One option is to have specific targets in the subdirectories for each build type. So if you do a ‘make all’ at the top level, it looks at COMPILETYPE and invokes ‘make all-debug’ or ‘make all-release’ as appropriate.

    Alternatively, you could set a COMPILETYPE environment variable at the top level, and have each sub-Makefile deal with it.

    The real solution is to not do a recursive make, but to include makefiles in subdirectories in the top level file. This will let you easily build in a different directory than the source lives in, so you can have build_debug and build_release directories. It also allows parallel make to work (make -j). See Recursive Make Considered Harmful for a full explanation.

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

Sidebar

Related Questions

Looking for suggestions on file system management tools. We have several terabytes of images,
I'm looking for suggestions on possible IPC mechanisms that I can implement in my
I'm looking for tips, suggestions, advice or examples of applications build using Google's Web
I am looking for a simple JavaScript example that updates DOM. Any suggestions?
I'm looking for suggestions on Flash realtime servers. Currently, we use a combination of
I'm looking for suggestions for a beginner level ASP/XML test. Essentially I'm trying to
I'm looking for suggestions on how to inject runtime dependencies into JPA entities retrieved
I'm looking for some suggestions on how to go about this. Any input is
I'm am looking for specific suggestions or references to an algorithm and/or data structures
I am looking at the performance suggestions lots of pages have about asp.net. Specifically

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.