[Top][All Lists]

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

how to handle new subdirectories?

From: Steffen Dettmer
Subject: how to handle new subdirectories?
Date: Tue, 2 Mar 2010 16:25:50 +0100


how to handle new subdirectories?

1) new automake but no new autoconf directories:

For new subdirectories with new autoconf/automake
fails because seems not to be created automatically,
so we usually add in a call to a macro similar like

  dnl Trying to avoid that reconfigure fails because of the new
  dnl    directory - we simply call ./config.status.
  if ! test -e $Makefile ; then
    dnl ... specific stuff here ...
    autoreconf $srcdir || exit 9
    dnl New directories often have new source files, just in case,
    dnl   let's run the depfiles command
    ./config.status depfiles $Makefile || exit 9
    if test -e $Makefile ; then
      AC_MSG_NOTICE([   (looks good)])
      AC_MSG_WARN([Sorry, should not happen, but I could not create $Makefile])

How to do this better/correctly?

2) new autoconf directories:

The macro from above works for new subdirectories with but not for new files
(AC_CONFIG_SUBDIRS). I tried to write something similar for this
case, but had no idea how to do that.

We usually have a high level Makefile to iterate all build
directories (all the cross compiling configurations). This is
simple because for each cross compiling configuration configure
is called in a subdirectory build/<platform-string>, so we have
build/Makefile with

DIRS=$(shell cat .subdirs)

# required for 'make' without explicit target to work
        for dir in $(DIRS) ; do \
          make -C $$dir $@ || exit 5; \

        for dir in $(DIRS) ; do \
          make -C $$dir $@ || exit 5; \

via top level configure we can run autoreconf and later (auto-)make
invokes some ./config.status --recheck which gets --no-create
--no-recursion. By this, the newdirectory/configure
script isn't run for build/* and thus no
build/*/newdirectory/Makefile are created and make aborts (no
rule to make target).

I tried to run in build/*/ something like `./config.status
--recheck --recursion --create' doesn't work.

So the only way I found was to use some `topsrcdir/':

        @echo "In directory `pwd`:"
        ../../configure `cat .config-opts`

and then run `make -C build recheck-recursive' and `make -C build'.

This seems to work but has the disadvantage that all config.h
files of course are recreated and thus really everything is
recompiled completely.

Are there simple ways to improve this?



reply via email to

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