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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:24:31+00:00 2026-06-09T22:24:31+00:00

This question extends question How to handle subprojects with autotools? So I have some

  • 0

This question extends question How to handle subprojects with autotools?

So I have some project with its own Makefile (not GNU autotools) in
modules/libfoo

I added SUBDIRS = include/jsonbox Makefile.am and it compiles fine, but only if I invoke ./configure and make from top dir.

If I create a subdir, say build, and run ../configure from it I got an error during make:

   Making all in modules/libfoo
   /bin/sh: line 17: cd: modules/libfoo: No such file or directory
   make: *** [all-recursive] Error 1

Is it possible to handle this? I need several build dirs for different archs and CFLAGS.

EDIT:
As it sugected in docs I created a GNUmakefile.in in a nested project. But it still doesn’t work with VPATH:

Making all in modules/libfoo
make[1]: Entering directory `/home/galadog/test/build/moudles/libfoo'
GNUmakefile:2: Makefile: No such file or directory
make[1]: *** No rule to make target `Makefile'.  Stop.
make[1]: Leaving directory `/home/galadog/test/build/moudles/libfoo'
make: *** [all-recursive] Error 1

Edit2
The actual Makefile can be seen here:
https://github.com/anhero/JsonBox/blob/master/Makefile

  • 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-06-09T22:24:32+00:00Added an answer on June 9, 2026 at 10:24 pm

    Sadly, you can’t achieve this correctly without either:

    1. Modifying/replacing the upstream Makefile,
    2. Adding your own make rules for the upstream library and ignoring their Makefile.

    The docs you linked are mostly focused on working around the issues with make distcheck, without supporting actual builds.

    There’s, however, one simple hack which would work with minimal work required — it is to copy the whole sub-tree to the build directory. It is not a very good solution but it will make sub-tree builds working:

    SUBDIRS = modules/libfoo
    
    # and possibly all other -recursive targets you'll be using
    all-recursive: copy-libfoo
    
    copy-libfoo:
        mkdir -p modules
        cp -R -H $(top_srcdir)/modules/libfoo modules/
    

    But as I said, it’s ugly. The upstream Makefile still needs to define correct automake targets (all, install etc.), so in your case you would as well to need to add a GNUmakefile in the project subdir like:

    include Makefile
    INSTALL:
    

    which would provide a dummy target to avoid *** No rule to make target 'install'; and possibly that as well. Then EXTRA_DIST if you want to use make dist but that’s all covered in the linked doc.


    Honestly, you’re on a slippery ground. If I were you, I would either simply not use that project and ignore it because maintaining it will be harder than writing the same thing from scratch.

    The second solution I would consider, and one which would work correct would be to duplicate the Makefile in your main Makefile.am and not use recursive automake for that subdirectory:

    LIBRARIES = modules/libfoo/libfoo.a
    
    modules_libfoo_libfoo_a_SOURCES = modules/libfoo/src/a.c # ...
    
    # and possibly some...
    EXTRA_DIST = # ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my first question on the site and I hope it's not too
I have run into a wall trying to find an answer to this question
Is someone intelligent there who can answer this question? I m doing some task
This is a common question, and I have read up on the various ways
This is homework, and this questions Extends this one So there is a button
this question is an extension of the question here i tried to extend Dane's
This question is directly related to this SO question I posed about 15 minutes
This question is kind of a follow up to this question I asked a
This question is really basic. What is the performance difference between removing a UIView
This question is similar in concept to this one , except I see I

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.