[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFE: Generating a stub Makefile

From: Bob Proulx
Subject: Re: RFE: Generating a stub Makefile
Date: Tue, 26 Jun 2007 01:06:36 -0600
User-agent: Mutt/1.5.9i

Mark Heily wrote:
> This seems I would like Autoconf to generate a stub Makefile to  
> include in the top-level of each tarball. The purpose of this stub  
> Makefile is to call ./configure
> to generate the real Makefile and then re-invoke make(1) using the  
> real Makefile.

I also like the ability to simply check out a pristine copy of the
source and then simply type 'make'.  Fortunately this is quite easy.
I have always been fond of Jim's GNUmakefile in Coreutils.;a=blob;f=GNUmakefile

Here is a derivation that is maximally condensed for discussion and
modified to automatically run autoreconf and ./configure if needed.  I
have been using this in my own projects.

  have-Makefile := $(shell test -f Makefile && echo yes)
  have-configure := $(shell test -f configure && echo yes)
  have-Makefile-maint := $(shell test -f Makefile.maint && echo yes)
  ifeq ($(have-Makefile),yes)
  include Makefile
  ifeq ($(have-configure),yes)
        @echo "There seems to be no Makefile in this directory."
        @echo "Running ./configure before running 'make'."
        sh ./configure
        @echo "There seems to be no Makefile in this directory."
        @echo "There seems to be no configure script in this directory."
        @echo "Running 'autoreconf' to generate the configure script."
        autoreconf --install
  ifeq ($(have-Makefile-maint),yes)
  include Makefile.maint

By including a GNUmakefile such as in a project then what you are
suggesting is available but without a conflict over the generated

> My intention is to save typing for power users and make it easier for  
> novice users to build programs from source. This effectively hides  
> the Autoconf/Automake mechanism unless someone wants to pass specific  
> options to the configure script.
> Any thoughts?

I am not sure there is enough drudgery in ./configure to really
warrant doing crazy stuff.  :-)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]