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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:30:10+00:00 2026-05-31T05:30:10+00:00

I have a basic makefile-based project on Linux. It also builds in Visual Studio

  • 0

I have a basic makefile-based project on Linux. It also builds in Visual Studio on Windows.

I’d like to modify my Linux makefile to create multiple builds with different binaries, Debug and Release to start, but will probably add others.

How do I set up a Makefile project to build source in different ways to different paths?

For instance, debug build would be something like:

g++ -ggdb -Wall -DDEBUG
.o files in ./Debug/obj
.so and binary files in ./Debug/bin

And release output would be:

g++ -Os -Wall
.o files in ./Release/obj
.so and binary files in ./Release/bin

Make debug or make release would make them, or make all would do everything.

I how to create multiple build types in a Makefile, but the part I’m really unclear on is setting output directory and setting which .o file directory to check to see whether source files have been built.

A pointer to relevant examples and docs would be welcome.

  • 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-31T05:30:11+00:00Added an answer on May 31, 2026 at 5:30 am

    Make some time for reading, head over to Paul Smith’s homepage, who is the maintainer of GNU Make, and read these two articles:

    • How Not to Use VPATH
    • Multi-Architecture Builds Using GNU make

    You will then probably understand that it’s not a good idea to build in directories other than the current one because it means going against the grain of Make.

    The articles will also guide you on how to organise a build, and it might just fit your particular situation.

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

Sidebar

Related Questions

I have created a really basic project (Make) like this: (ede-proj-project zrm :name zrm
Does anyone have experience using makefiles for Visual Studio C++ builds (under VS 2005)
I have a basic quiz/survey type application I'm working on, and I'd like to
I have seen a basic Makefile tutorial today, but I still don't understand a
I have a very basic question about the LocalMon print monitor found at http://msdn.microsoft.com/en-us/library/windows/hardware/ff556478%28v=vs.85%29.aspx
I'm mostly a spoiled Windows + Visual Studio (or Borland C++ or whatever, in
I have basic idea about running PHP in different configurations like mod_php, cgi, FastCGI,
I have basic code that looks like this: while(inputfileStream.good()) { for(int i = 0;i<levels;i++)
I am working on Windows 64 and we need a makefile for our project.
I have a git repository with multiple branches. The repository has a makefile which

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.