automake
[Top][All Lists]
Advanced

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

Re: Large project support


From: Boehne, Robert
Subject: Re: Large project support
Date: Mon, 15 Apr 2002 17:46:56 -0500

Timo,

After reading this thread it didn't look like anyone answered
your second question, "has anyone wrote a script..."
Depending on your directory layout it could be as simple as:

echo "foo_SOURCES = \ " >> Makefile.am   ## and whatever else...
find ./ -name \*.c -print | sed 's%\./%%' | sed 's/$/ \\/' >>
Makefile.am

For the Open CASCADE project
http://sourceforge.net/projects/autoopencas/
The script was a bit more complicated.  This project consists of about
50 rather large C++ shred libraries, and in fact, is the first project
I autoconf-iscated, automake-abled, and libtool-ized.  There is
somthing
like 180 Megabytes of source, so I'd say it qualifies as a large
project. ;)
This script will not work for your project, but it may illustrate
how to write one that will.  As a last note, you will need to learn
bourne shell to make much use of Automake/Autoconf/Libtool, so go
ahead and jump in.

HTH,

Robert

#! /bin/sh -x
#################################################################
# File:    domake
# Language: shell
# Purpose: Create Makefile.am's in each src/${UD} directory for
#          input to GNU Automake.
#################################################################
cd ${CASROOT}/src
echo "# Makefile.am for package $1"
echo "srcdir = @srcdir@"
echo
# Make VPATH entry with all required directories in it.
len=`cat $1/PACKAGES | wc -l`
len=`expr $len - 1`
echo 'VPATH = @srcdir@ : \'
for UD in `head -$len $1/PACKAGES`
do
  echo '@top_srcdir@/drv/'${UD}' : @top_srcdir@/src/'${UD}': \'
done
UD=`tail -1 $1/PACKAGES`
echo '@top_srcdir@/drv/'${UD}' : @top_srcdir@/src/'${UD}' '
#
# Make INCLUDES entry with all required directories in it.
#  Some directories under src/ need to be included for pxx and gxx
files.
echo
echo 'address@hidden@/inc \'
cd ${CASROOT}/src
for UD in `head -$len $1/PACKAGES`
do
  if test 'ls -al src/${UD}/*.[gp]xx' >/dev/null; then
    echo 'address@hidden@/src/'${UD}' \'
  fi
  echo 'address@hidden@/drv/'${UD}' \'
done
UD=`tail -1 $1/PACKAGES`
if test 'ls src/${UD}/*.[gp]xx' >/dev/null; then
  echo 'address@hidden@/src/'${UD}' \'
fi
echo 'address@hidden@/drv/'${UD}
echo
echo 'lib_LTLIBRARIES=lib'$1'.la'
num=`cat ${CASROOT}/src/$1/EXTERNLIB | wc -w`
case ${num}  in
 *0)
    echo
  ;;
 *1)
    echo
    echo 'lib'$1'_la_LIBADD = ../'`head -1
${CASROOT}/src/$1/EXTERNLIB`'/lib'`head -1
${CASROOT}/src/$1/EXTERNLIB`'.la'
  ;;
 *)
  nlibs=`cat ${CASROOT}/src/$1/EXTERNLIB | wc -w`
  echo 'lib'$1'_la_LIBADD = ../'`head -1
${CASROOT}/src/$1/EXTERNLIB`'/lib'`head -1
${CASROOT}/src/$1/EXTERNLIB`'.la \'
  for LIB in `cat ${CASROOT}/src/$1/EXTERNLIB`
  do
     if test ${LIB}!=`head -1 ${CASROOT}/src/$1/EXTERNLIB`; then
       echo ' ../'$LIB'/lib'$LIB'.la \'
     fi
  done
  ;;
esac
echo
echo 'lib'$1'_la_SOURCES = \'
for UD in `cat $1/PACKAGES`
do
   cd ${CASROOT}/src/${UD}
   ls -1 *.c | uniq | awk '{ printf("%s \\\n",$1)}'
   cd ${CASROOT}/drv/${UD}
   ls -1 *.c | uniq | awk '{ printf("%s \\\n",$1)}'
   cd ${CASROOT}/src/${UD}
   ls -1 *.cxx | uniq | awk '{ printf("%s \\\n",$1)}'
   cd ${CASROOT}/drv/${UD}
   ls -1 *.cxx | uniq | awk '{ printf("%s \\\n",$1)}'
done
echo

-- 
Robert Boehne             Software Engineer
Ricardo Software   Chicago Technical Center
TEL: (630)789-0003 x. 238
FAX: (630)789-0127
email:  address@hidden



reply via email to

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