[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
automake training tutorial: distcheck, separate build directory and gene
From: |
Michel Briand |
Subject: |
automake training tutorial: distcheck, separate build directory and generated files |
Date: |
Tue, 14 Oct 2008 12:44:09 +0200 |
Hi all,
(I've put the tutorial on a small website. So that I can release
easily. http://kheb.homelinux.org/publish/autotraining/ : you'll find
two files, one for a minimal release, another for a normal release).
I've looked at 'make dist' to release the package. So after some
readings I tried 'make distcheck'.
-- 1/
I discovered that, if we build the source in a separate directory, we
need to fix some minor things:
in Makefile.am I used to write:
LIBTRAINING_DIR=../lib
AM_CPPFLAGS = -I$(LIBTRAINING_DIR)
[...]
training_LDADD = ../lib/libtraining.la
Now, thanks to the tries with 'make distcheck', I must be more strict:
LIBTRAINING_SRCDIR=$(top_srcdir)/src/lib
LIBTRAINING_BUILDDIR=$(top_builddir)/src/lib
AM_CPPFLAGS = -I$(LIBTRAINING_SRCDIR)
bin_PROGRAMS = training
training_SOURCES = training.c internal_version.c
training_LDADD = $(LIBTRAINING_BUILDDIR)/libtraining.la
Is there a better way to do that, a libtool trick that I missed for
example ?
-- 2/
I want to create a minimal tar, so I can restart from scratch to test
all autotools stuff... With autogen.sh.
I'm using Subversion. And my top source directory is named
'autotraining'. So I need to do some trick to release a minimal tar:
dist-minimal: clean distclean
if test -f autotraining-$(PACKAGE_VERSION).tar.gz; then \
rm -f autotraining-$(PACKAGE_VERSION).tar.gz; fi
find . -type f -name "*~" -exec rm {} \;
-rm -rf aclocal.m4 autom4te.cache config config.h.in configure $$(find
. -type f -name Makefile.in)
-rm -f src/bin/internal_version.c src/lib/internal_version.c
cd .. && \
if test -h autotraining-$(PACKAGE_VERSION); then \
rm -f autotraining-$(PACKAGE_VERSION); fi && \
ln -s autotraining autotraining-$(PACKAGE_VERSION) && \
tar cfz autotraining-minimal-$(PACKAGE_VERSION).tar.gz \
autotraining-$(PACKAGE_VERSION)/* --exclude '.svn'
Is it correct ?
-- 3/
I generate some files during build: src/lib/internal_version.c and
src/bin/internal_version.c.
I want to remove them. So I added those files to the CLEANFILES
variable.
Is this correct ?
Cheers,
Michel
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- automake training tutorial: distcheck, separate build directory and generated files,
Michel Briand <=