bug-automake
[Top][All Lists]
Advanced

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

how to create dependencies for conditional sources


From: Roumen Petrov
Subject: how to create dependencies for conditional sources
Date: Thu, 28 Jun 2007 23:26:31 +0300
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.10) Gecko/20070306 SeaMonkey/1.0.8

Please find attached test case "bootstrap.sh".

How to write Makefile.am so that created makefiles to contain dependencies for conditional sources ?

Roumen

#! /bin/sh

cat > configure.ac <<EOF
AC_INIT([test], [0.0])
AC_PREREQ(2.59)

AM_INIT_AUTOMAKE

AC_PROG_CC

AM_CONDITIONAL(WITH_CASE1, [test x = x])
AM_CONDITIONAL(WITH_CASE2, [test x != x])

AC_OUTPUT([Makefile])
EOF

cat > Makefile.am <<EOF
if WITH_CASE1
DEPS1=case1.lo
else
DEPS1=
endif

if WITH_CASE2
DEPS2=
else
DEPS2=case2.lo
endif

noinst_PROGRAMS=target

target_SOURCES = main.c
target_LDADD= \$(DEPS1) \$(DEPS2)
target_DEPENDENCIES= \$(DEPS1) \$(DEPS2)
EOF

cat /dev/null > main.c

aclocal
automake --foreign --add-missing --copy
#autoconf
#./configure

grep AMDEP.*am__include Makefile.in

reply via email to

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