configure: Make sure that certain build directories exist.

When builddir != srcdir, this ensures that certain build directories
which might not exist are created by configure.
This commit is contained in:
Richard W.M. Jones
2013-04-24 20:32:25 +01:00
parent c4255fd0e3
commit 88271bab7c
5 changed files with 15 additions and 28 deletions

View File

@@ -78,13 +78,11 @@ excludelist: excludelist.in Makefile
supermin.d/base.img supermin.d/hostfiles: stamp-supermin
stamp-supermin: make.sh packagelist excludelist
mkdir -p supermin.d
rm -f $@ supermin.d/base.img supermin.d/hostfiles
./make.sh
touch $@
supermin.d/daemon.img: ../daemon/guestfsd guestfsd.suppressions
mkdir -p supermin.d
rm -f $@ $@-t
rm -rf tmp-d
mkdir -p tmp-d$(DAEMON_SUPERMIN_DIR) tmp-d/etc
@@ -96,7 +94,6 @@ supermin.d/daemon.img: ../daemon/guestfsd guestfsd.suppressions
supermin.d/init.img: init
cmp -s $(srcdir)/init $(builddir)/init || cp $(srcdir)/init $(builddir)/init
mkdir -p supermin.d
rm -f $@ $@-t
echo "init" | cpio --quiet -o -H newc > $@-t
mv $@-t $@
@@ -104,7 +101,6 @@ supermin.d/init.img: init
# We should put this file in /lib/udev/rules.d, but put it in /etc so
# we don't have to deal with all the UsrMove crap in Fedora.
supermin.d/udev-rules.img: 99-guestfs-serial.rules
mkdir -p supermin.d
rm -f $@ $@-t
rm -rf tmp-u
mkdir -p tmp-u/etc/udev/rules.d
@@ -140,7 +136,5 @@ stamp-libguestfs-make-fixed-appliance.pod: libguestfs-make-fixed-appliance.pod
CLEANFILES = packagelist excludelist \
libguestfs-make-fixed-appliance.1 \
stamp-libguestfs-make-fixed-appliance.pod
clean-local:
rm -rf supermin.d
stamp-libguestfs-make-fixed-appliance.pod \
supermin.d/*

View File

@@ -1528,7 +1528,19 @@ LIBTOOL='bash $(top_srcdir)/libtool-kill-dependency_libs.sh $(top_builddir)/libt
AC_SUBST([LIBTOOL])
dnl Produce output files.
AC_CONFIG_HEADERS([config.h])
dnl For separated builds, make sure that certain build directories exist.
dnl This avoids having to sprinkle 'mkdir -p' statements throughout
dnl many Makefile.am rules.
mkdir -p \
appliance/supermin.d \
java/t \
ocaml/html \
ocaml/t \
tests/guests/guest-aux
dnl http://www.mail-archive.com/automake@gnu.org/msg10204.html
AC_CONFIG_FILES([appliance/libguestfs-make-fixed-appliance],
[chmod +x,-w appliance/libguestfs-make-fixed-appliance])
@@ -1540,6 +1552,7 @@ AC_CONFIG_FILES([podwrapper.pl],
[chmod +x,-w podwrapper.pl])
AC_CONFIG_FILES([run],
[chmod +x,-w run])
AC_CONFIG_FILES([Makefile
align/Makefile
appliance/Makefile

View File

@@ -132,7 +132,6 @@ TESTS_ENVIRONMENT = $(top_builddir)/run --test
noinst_DATA = Bindtests.class $(java_tests:.java=.class)
t/%.class: t/%.java libguestfs-$(VERSION).jar
mkdir -p t
$(JAVAC) $(JAVAC_FLAGS) -classpath libguestfs-$(VERSION).jar -d $(builddir)/t $<
Bindtests.class: Bindtests.java libguestfs-$(VERSION).jar

View File

@@ -90,7 +90,6 @@ if HAVE_OCAMLDOC
noinst_DATA += html/index.html
html/index.html: $(srcdir)/guestfs*.mli $(srcdir)/guestfs*.ml
mkdir -p html
-$(OCAMLDOC) -d html -html $^
endif
@@ -120,75 +119,59 @@ noinst_DATA += \
$(test_progs:%=%.opt)
bindtests.bc: bindtests.cmo mlguestfs.cma
mkdir -p t
$(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
bindtests.opt: bindtests.cmx mlguestfs.cmxa
mkdir -p t
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@
t/guestfs_005_load.bc: t/guestfs_005_load.cmo mlguestfs.cma
mkdir -p t
$(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
t/guestfs_005_load.opt: t/guestfs_005_load.cmx mlguestfs.cmxa
mkdir -p t
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@
t/guestfs_010_basic.bc: t/guestfs_010_basic.cmo mlguestfs.cma
mkdir -p t
$(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
t/guestfs_010_basic.opt: t/guestfs_010_basic.cmx mlguestfs.cmxa
mkdir -p t
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@
t/guestfs_070_threads.bc: t/guestfs_070_threads.cmo mlguestfs.cma
mkdir -p t
$(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix,threads -thread -linkpkg mlguestfs.cma $< -o $@
t/guestfs_070_threads.opt: t/guestfs_070_threads.cmx mlguestfs.cmxa
mkdir -p t
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix,threads -thread -linkpkg mlguestfs.cmxa $< -o $@
t/guestfs_080_optargs.bc: t/guestfs_080_optargs.cmo mlguestfs.cma
mkdir -p t
$(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
t/guestfs_080_optargs.opt: t/guestfs_080_optargs.cmx mlguestfs.cmxa
mkdir -p t
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@
t/guestfs_400_events.bc: t/guestfs_400_events.cmo mlguestfs.cma
mkdir -p t
$(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
t/guestfs_400_events.opt: t/guestfs_400_events.cmx mlguestfs.cmxa
mkdir -p t
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@
t/guestfs_400_progress.bc: t/guestfs_400_progress.cmo mlguestfs.cma
mkdir -p t
$(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \
$(OCAMLFIND) ocamlc $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
t/guestfs_400_progress.opt: t/guestfs_400_progress.cmx mlguestfs.cmxa
mkdir -p t
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@
t/guestfs_500_mount_local.bc: t/guestfs_500_mount_local.cmo mlguestfs.cma
mkdir -p t
$(top_builddir)/libtool -dlopen $(top_builddir)/src/.libs/libguestfs.la --mode=execute \
$(OCAMLFIND) ocamlc -custom $(OCAMLCFLAGS) -I . -package unix -linkpkg mlguestfs.cma $< -o $@
t/guestfs_500_mount_local.opt: t/guestfs_500_mount_local.cmx mlguestfs.cmxa
mkdir -p t
$(OCAMLFIND) ocamlopt $(OCAMLOPTFLAGS) -cclib -L$(top_builddir)/src/.libs -I . -package unix -linkpkg mlguestfs.cmxa $< -o $@
# Explicit rules for these tests which require 'threads' package.

View File

@@ -106,13 +106,11 @@ fedora-btrfs.img: guest-aux/make-fedora-img.pl \
guest-aux/fedora-name.db: guest-aux/fedora-name.db.txt
rm -f $@ $@-t
mkdir -p guest-aux
$(DB_LOAD) $@-t < $<
mv $@-t $@
guest-aux/fedora-packages.db: guest-aux/fedora-packages.db.txt
rm -f $@ $@-t
mkdir -p guest-aux
$(DB_LOAD) $@-t < $<
mv $@-t $@