automake
[Top][All Lists]
Advanced

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

How to auto probe a directory


From: David Yu
Subject: How to auto probe a directory
Date: Sun, 6 Jan 2013 16:45:02 +0800

Hi guys:
          I want my project auto probe the Makefile.am entry all
directories, if a directory has Makefile.am,  I will create Makefile.in
with automake.
          After that, I will create Makefile with configure.

Here is my key codes of configure.in and Makefile.am
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#configure.in
DEVICE_COMPILE="shell find ./ -mindepth 2 -name Makefile.am | sed
's/Makefile.am/ /'"
AC_SUBST(DEVICE_COMPILE)
# probe the device modules
for DEVICE_MODULES in `find device -mindepth 2 -name Makefile.am | sed
's/Makefile.am/Makefile/'`
do
       echo $DEVICE_MODULES
        AC_CONFIG_FILES($DEVICE_MODULES)
done
AC_OUTPUT
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
#Makefile.am
SUBDIRS = $(@DEVICE_COMPILE@)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

1. I can probe the Makefile.am of every directory.
2. But I can't create Makefile.in with "automake --add-missing --copy
--force-missing".
3. I added "AC_CONFIG_FILES(test/Makefile)" into configure.in, It can
create Makefile.in in test/.
4. I removed  "AC_CONFIG_FILES(test/Makefile)" from configure.in, I can
create Makefile with Makefile.in that is created in step 3.

I guess automake use "AC_CONFIG_FILES($DEVICE_MODULES)" create Makefile.in,
but automake can't run the shell command, So "$DEVICE_MODULES" is NULL or
invalid. While It can execute the shell command in the process of
configure, so configure can create Makefile entry every directory that has
Makefile.am, But there is not Makefile.in. then  I get a error :
*config.status:
error: cannot find input file: `test/Makefile.in'*
*
*
My question is  how to use shell command in the process of automake.
Other method is ok too.

My English is not good, I hope you can get it.


David Yu
Thanks

*地址:清华大学 FIT楼 4区308*
*手机:13552980886*
*邮箱: address@hidden <address@hidden>
*MSN: address@hidden <address@hidden>


reply via email to

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