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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:14:02+00:00 2026-05-28T07:14:02+00:00

I have been crafting a makefile for a while now. It supports easy creation

  • 0

I have been crafting a makefile for a while now. It supports easy creation of exe, lib and dll type projects, through the use of includes.

Now that I have started using mercurial again, I notice that everything is nice and clean until I do a build. You see I have my object files going into sub directories below the source directory for each sub-project. And I have my lib, exe, and dll files being built to directories which are below the main working directory. This means whenever I do hg status, it will list these temporary binary files with ‘?’, which is visual clutter I don’t want. (It’s not mercurial’s fault and of course I wouldn’t be so naive to check them in to the repo or anything like that.) I only want hg status to uncover files that I may have forgot to add properly, not these temporary built ones.

The current dir structure is like this:

projroot
-- subproj1 (for source files)
-- subproj1/intr  (for object files, release build)
-- subproj2 (for source files)
-- subproj2/intr  (for object files, release build)
-- bin (for exes and dlls)
-- lib (for libraries that I build)

So I’m thinking of restructuring the makefile to keep the files that are built (objs libs dlls and exes) outside the working directory. Do most people keep all the binaries in a directory one level above projroot to avoid SCM seeing them? There must be some best practice. What I was using seemed good but it’s a bit dated I think, certainly since I have seen ant’s way of having a completely seperate tree for Java src and classes.

What about this structure?

projroot (contains common makefile includes and repo in here)
-- subproj1 (for source files)
-- subproj2 (for source files)
build
-- subproj1/intr (.o / .obj files in release build)
-- subproj1/intd
-- subproj2/intr
-- subproj2/intd
-- lib (all built libs)
-- bin (all built exes and DLLs)

The build directory is outside of the working directory and so is ignored by whatever SCM we would use.

Your answer has to take into account the common makefile source code in projroot and the fact that there are multiple projects, each with their own collection of built binaries which you may possibly want to distribute seperately.

  • 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-28T07:14:03+00:00Added an answer on May 28, 2026 at 7:14 am

    Personally I prefer such a directory structure as I don’t like any of the source subfolders to be polluted with compiled intermediate files. Doing a clean is just a matter of deleting the output folder

    projroot
    -- subproj1 (for source files)
    -- subproj2 (for source files)
    -- output/bin (for exes and dlls)
    -- output/lib (for libraries that I build)
    -- output/subproj1/ ( for *.o files )
    -- output/subproj2/ ( for *.o files )
    

    This has the added benefit that I can set the whole of output folder to be ignored by the source control management and I don’t have to to check the SCM software to see what files are generated and what are revision controlled.

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

Sidebar

Related Questions

I have been working with android for a little while now and feel pretty
Have been struggling with Javascript closure for a while trying to wrap brain around
We have been using CruiseControl for quite a while with NUnit and NAnt. For
have been able to output images from BLOB, however I am now wanting to
Have been stuck with this issue for a few days now, and really need,
Have been googling for a while, but I don't find any page which explains
Have been wondering about this for days now: I have a basic wxpython program
Have been trying to fix this for the past hour. Here goes: <script type=text/javascript>
Have been working in Ruby for a while, but usually in the context of
have been trying couple of hours now to make my iphone app universal. The

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.