Re: RFE: Generating a stub Makefile

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

 



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.

  http://git.sv.gnu.org/gitweb/?p=coreutils.git;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
  else
  ifeq ($(have-configure),yes)
  all:
  	@echo "There seems to be no Makefile in this directory."
  	@echo "Running ./configure before running 'make'."
  	sh ./configure
  	@$(MAKE)
  else
  all:
  	@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
  	@$(MAKE)
  endif
  endif
  ifeq ($(have-Makefile-maint),yes)
  include Makefile.maint
  endif

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

> 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.  :-)

Bob


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux