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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T12:15:04+00:00 2026-05-23T12:15:04+00:00

I have a directory /src containing all of my source files, and /bin to

  • 0

I have a directory /src containing all of my source files, and /bin to store all binary after running make command. The directory is something like below:

/BuildDirectory
- - /src
- - /bin
- - configure
- - Makefile.am
- - configure.ac 
- - ... 

Now in Makefile.am, I have to specified:

bin_PROGRAMS = bin/x bin/y bin/z bin/k ...

bin_x_SOURCES = src/x.cpp
bin_y_SOURCES = src/y.cpp
bin_z_SOURCES = src/z.cpp

Is there any variable that can help to get rid of all “bin/” and “src/” ?
For example I just specify:

$BIN = bin
$SRC = src 

And they will look for the correct files in correct folders and compile it to the correct places.

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-23T12:15:05+00:00Added an answer on May 23, 2026 at 12:15 pm

    You could take advantage of remote building. Place this makefile in the bin dir:

    VPATH = ../src
    bin_PROGRAMS = x y z k ...
    
    x_SOURCES = x.cpp
    y_SOURCES = y.cpp
    z_SOURCES = z.cpp
    

    Now replace the current Makefile.am with this one:

    SUBDIRS = bin
    

    Now tweak your configure.ac to also generate bin/Makefile

    AC_CONFIG_FILES([Makefile
            bin/Makefile])
    

    and you should be set for life.

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

Sidebar

Related Questions

I have a directory src/ that contain many .cc files and its binary. For
I have directory with > 1000 .html files, and would like to check all
I have the following directory structure. root --src ---tests src contains the source &
I have a list of files on host machine say in directory /src/. The
Now I have two directory, all of header files *.h are included in directory
I have a directory with several subdirectories with files. How can I copy all
I have a directory structure D:\workspace 2\project\lib where I have all the files AgentMain.java(which
I have directory A with files matching directory B. Directory A may have other
I have a directory containing multiple subdirectories. I want to list only those subdirectories
Let's say I have this directory structure: SConstruct src/ a.cpp b.cpp include/ a.h b.h

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.