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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:29:26+00:00 2026-06-03T01:29:26+00:00

I am a beginner in using autotool, I want to add some shell script

  • 0

I am a beginner in using autotool, I want to add some shell script in the Makefile.am, when I use the method below, the Makefile created by autotool is not I am expected. How can I write to create the correct one.
Thanks for your reply!

PS:
this is my configure.in and Makefile.am(parts)

configure.in:

if test "$sample" = yes;then
    DEFS="$DEFS -DSAMPLE=1"
    AC_SUBST(SAMPLE, [yes])
fi

Makefile.am:

if test "$SAMPLE" = yes;then
    noinst_PROGRAMS = test
    test_SOURCES = test.c
else
    bin_PROGRAMS = release
    release_SOURCES = main.c
fi

Makefile autotool created:

 ........
 ........
 .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
 clean-libLTLIBRARIES clean-libtool clean-noinstPROGRAMS ctags \
 distclean distclean-compile distclean-generic \
 distclean-libtool distclean-tags distdir dvi dvi-am html \
 html-am info info-am install install-am install-data \
 install-data-am install-dvi install-dvi-am install-exec \
 install-exec-am install-html install-html-am \
 install-includeHEADERS install-info install-info-am \
 install-libLTLIBRARIES install-man install-pdf install-pdf-am \
 install-ps install-ps-am install-strip installcheck \
 installcheck-am installdirs maintainer-clean \
 maintainer-clean-generic mostlyclean mostlyclean-compile \
 mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
 tags uninstall uninstall-am uninstall-includeHEADERS \
 uninstall-libLTLIBRARIES

if test "yes" = yes;then
fi
  • 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-03T01:29:27+00:00Added an answer on June 3, 2026 at 1:29 am

    Automake conditionals don’t work like that. See the manual.

    Here’s how it should look:

    configure.ac:

    AM_CONDITIONAL([SAMPLE], [test "$SAMPLE" = yes])
    

    Makefile.am:

    if SAMPLE
    noinst_PROGRAMS = test
    test_SOURCES = test.c
    else
    bin_PROGRAMS = release
    release_SOURCES = main.c
    endif
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a beginner using S3 and I want to use it to store
Being a beginner of using Django, i am trying to add some module for
I am a beginner programmer, using python on Mac. I created a function as
I am a beginner in using Blend and WPF in general. I created three
I am a beginner in using Prototype library. I want to know how we
im a beginner in using solr. i know that you can either use ajax
Greetings All; I am a beginner in using regex. What I want to do
I started using Prestashop yesterday so I’m a total beginner, but I've got some
I am a beginner at C++ but I have some experience using Java. I
I'm a Flask beginner and I want to build a poll app using flask

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.