makefiles: Generate the top-level .gitignore and the distclean rules.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2016-02-26 18:06:25 +09:00
parent fb43551a0d
commit 77c1b7e352
5 changed files with 28 additions and 121 deletions

View File

@ -96,6 +96,7 @@ LIBWINE_INSTALL_DEV = @LIBWINE_INSTALL_DEV@
LIBWINE_LDFLAGS = @LIBWINE_LDFLAGS@ LIBWINE_LDFLAGS = @LIBWINE_LDFLAGS@
LIBWINE_DEPENDS = @LIBWINE_DEPENDS@ LIBWINE_DEPENDS = @LIBWINE_DEPENDS@
ALL_TEST_RESOURCES = @ALL_TEST_RESOURCES@ ALL_TEST_RESOURCES = @ALL_TEST_RESOURCES@
CONFIGURE_TARGETS = @CONFIGURE_TARGETS@
@ALL_VARS_RULES@ @ALL_VARS_RULES@
@SET_MAKE@ @SET_MAKE@
@ -117,7 +118,6 @@ include/stamp-h: $(srcdir)/include/config.h.in config.status
clean:: __clean__ clean:: __clean__
distclean:: clean distclean:: clean
$(RM) config.* configure.lineno TAGS tags include/config.h include/stamp-h Makefile Make.tmp .gitignore
$(RM) -r autom4te.cache documentation/html documentation/api-guide documentation/api-guide-xml documentation/man$(api_manext) $(RM) -r autom4te.cache documentation/html documentation/api-guide documentation/api-guide-xml documentation/man$(api_manext)
# Rules for uninstalling # Rules for uninstalling

28
aclocal.m4 vendored
View File

@ -199,8 +199,8 @@ dnl
AC_DEFUN([WINE_CONFIG_HELPERS], AC_DEFUN([WINE_CONFIG_HELPERS],
[wine_rules_file=conf$$rules.make [wine_rules_file=conf$$rules.make
rm -f $wine_rules_file rm -f $wine_rules_file
GITIGNORE="# Automatically generated by configure; DO NOT EDIT!!"
AC_SUBST(SUBDIRS,"") AC_SUBST(SUBDIRS,"")
AC_SUBST(CONFIGURE_TARGETS,"")
AC_SUBST(ALL_TEST_RESOURCES,"") AC_SUBST(ALL_TEST_RESOURCES,"")
wine_fn_append_file () wine_fn_append_file ()
@ -208,15 +208,6 @@ wine_fn_append_file ()
AS_VAR_APPEND($[1]," \\$as_nl $[2]") AS_VAR_APPEND($[1]," \\$as_nl $[2]")
} }
wine_fn_ignore_file ()
{
case "$[1]" in
*/*) AS_VAR_APPEND([GITIGNORE],"$as_nl$[1]") ;;
\**) AS_VAR_APPEND([GITIGNORE],"$as_nl$[1]") ;;
*) AS_VAR_APPEND([GITIGNORE],"$as_nl/$[1]") ;;
esac
}
wine_fn_append_rule () wine_fn_append_rule ()
{ {
AS_ECHO("$[1]") >>$wine_rules_file AS_ECHO("$[1]") >>$wine_rules_file
@ -454,15 +445,6 @@ __uninstall__: $ac_dir/uninstall"
$ac_file.cross.a: $srcdir/$ac_dir/$ac_name.spec \$(WINEBUILD) $ac_file.cross.a: $srcdir/$ac_dir/$ac_name.spec \$(WINEBUILD)
\$(WINEBUILD) \$(CROSSTARGET:%=-b %)$ac_implibflags -w --implib -o \$[@] --export $srcdir/$ac_dir/$ac_name.spec" \$(WINEBUILD) \$(CROSSTARGET:%=-b %)$ac_implibflags -w --implib -o \$[@] --export $srcdir/$ac_dir/$ac_name.spec"
fi fi
if test "$ac_name" != "$ac_implib"
then
wine_fn_ignore_file "dlls/lib$ac_implib.$IMPLIBEXT"
if test -n "$CROSSTARGET" -a -z "$ac_implibflags"
then
wine_fn_ignore_file "dlls/lib$ac_implib.cross.a"
fi
fi
fi fi
} }
@ -594,10 +576,8 @@ wine_fn_config_symlink ()
ac_links=$[@] ac_links=$[@]
wine_fn_append_rule \ wine_fn_append_rule \
"$ac_links: "$ac_links:
@./config.status \$[@] @./config.status \$[@]"
distclean:: for f in $ac_links; do wine_fn_append_file CONFIGURE_TARGETS $f; done
\$(RM) $ac_links"
for f in $ac_links; do wine_fn_ignore_file $f; done
test -n "$ac_linkdir" || return test -n "$ac_linkdir" || return
wine_fn_append_rule "$ac_linkdir/depend: $ac_links" wine_fn_append_rule "$ac_linkdir/depend: $ac_links"
}]) }])
@ -692,7 +672,7 @@ dnl
dnl Usage: WINE_IGNORE_FILE(file,enable) dnl Usage: WINE_IGNORE_FILE(file,enable)
dnl dnl
AC_DEFUN([WINE_IGNORE_FILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl AC_DEFUN([WINE_IGNORE_FILE],[AC_REQUIRE([WINE_CONFIG_HELPERS])dnl
m4_ifval([$2],[test "x$[$2]" = xno || ])wine_fn_ignore_file $1]) m4_ifval([$2],[test "x$[$2]" = xno || ])wine_fn_append_file CONFIGURE_TARGETS $1])
dnl **** Add a message to the list displayed at the end **** dnl **** Add a message to the list displayed at the end ****
dnl dnl

80
configure vendored
View File

@ -716,6 +716,7 @@ SOCKET_LIBS
DLLTOOL DLLTOOL
WINELOADER_PROGRAMS WINELOADER_PROGRAMS
ALL_TEST_RESOURCES ALL_TEST_RESOURCES
CONFIGURE_TARGETS
SUBDIRS SUBDIRS
READELF READELF
OTOOL OTOOL
@ -7414,9 +7415,10 @@ fi
wine_rules_file=conf$$rules.make wine_rules_file=conf$$rules.make
rm -f $wine_rules_file rm -f $wine_rules_file
GITIGNORE="# Automatically generated by configure; DO NOT EDIT!!"
SUBDIRS="" SUBDIRS=""
CONFIGURE_TARGETS=""
ALL_TEST_RESOURCES="" ALL_TEST_RESOURCES=""
@ -7425,15 +7427,6 @@ wine_fn_append_file ()
as_fn_append $1 " \\$as_nl $2" as_fn_append $1 " \\$as_nl $2"
} }
wine_fn_ignore_file ()
{
case "$1" in
*/*) as_fn_append GITIGNORE "$as_nl$1" ;;
\**) as_fn_append GITIGNORE "$as_nl$1" ;;
*) as_fn_append GITIGNORE "$as_nl/$1" ;;
esac
}
wine_fn_append_rule () wine_fn_append_rule ()
{ {
$as_echo "$1" >>$wine_rules_file $as_echo "$1" >>$wine_rules_file
@ -7681,15 +7674,6 @@ __uninstall__: $ac_dir/uninstall"
$ac_file.cross.a: $srcdir/$ac_dir/$ac_name.spec \$(WINEBUILD) $ac_file.cross.a: $srcdir/$ac_dir/$ac_name.spec \$(WINEBUILD)
\$(WINEBUILD) \$(CROSSTARGET:%=-b %)$ac_implibflags -w --implib -o \$@ --export $srcdir/$ac_dir/$ac_name.spec" \$(WINEBUILD) \$(CROSSTARGET:%=-b %)$ac_implibflags -w --implib -o \$@ --export $srcdir/$ac_dir/$ac_name.spec"
fi fi
if test "$ac_name" != "$ac_implib"
then
wine_fn_ignore_file "dlls/lib$ac_implib.$IMPLIBEXT"
if test -n "$CROSSTARGET" -a -z "$ac_implibflags"
then
wine_fn_ignore_file "dlls/lib$ac_implib.cross.a"
fi
fi
fi fi
} }
@ -7827,10 +7811,8 @@ wine_fn_config_symlink ()
ac_links=$@ ac_links=$@
wine_fn_append_rule \ wine_fn_append_rule \
"$ac_links: "$ac_links:
@./config.status \$@ @./config.status \$@"
distclean:: for f in $ac_links; do wine_fn_append_file CONFIGURE_TARGETS $f; done
\$(RM) $ac_links"
for f in $ac_links; do wine_fn_ignore_file $f; done
test -n "$ac_linkdir" || return test -n "$ac_linkdir" || return
wine_fn_append_rule "$ac_linkdir/depend: $ac_links" wine_fn_append_rule "$ac_linkdir/depend: $ac_links"
} }
@ -14949,7 +14931,7 @@ case $host_os in
linux*) linux*)
case $host_cpu in case $host_cpu in
*i[3456789]86*|x86_64*) *i[3456789]86*|x86_64*)
test "$wine_binary" = wine || wine_fn_ignore_file "loader/wine-preloader" test "$wine_binary" = wine || wine_fn_append_file CONFIGURE_TARGETS "loader/wine-preloader"
WINELOADER_PROGRAMS="$WINELOADER_PROGRAMS $wine_binary-preloader" WINELOADER_PROGRAMS="$WINELOADER_PROGRAMS $wine_binary-preloader"
;; ;;
esac esac
@ -17263,10 +17245,6 @@ Makefile: $srcdir/Makefile.in config.status \$(MAKEDEP)
depend: \$(MAKEDEP) dummy depend: \$(MAKEDEP) dummy
\$(MAKEDEP)" \$(MAKEDEP)"
test "$srcdir" = . && wine_fn_append_rule "all: .gitignore
.gitignore: config.status
@./config.status .gitignore"
test -n "$CROSSTARGET" || wine_fn_append_rule "crosstest: test -n "$CROSSTARGET" || wine_fn_append_rule "crosstest:
@echo \"crosstest is not supported (mingw not installed?)\" && false" @echo \"crosstest is not supported (mingw not installed?)\" && false"
@ -18259,22 +18237,18 @@ zh_TW"
wine_fn_ignore_file ".gitignore" wine_fn_append_file CONFIGURE_TARGETS "TAGS"
wine_fn_ignore_file "Makefile" wine_fn_append_file CONFIGURE_TARGETS "tags"
wine_fn_ignore_file "TAGS" wine_fn_append_file CONFIGURE_TARGETS "autom4te.cache"
wine_fn_ignore_file "tags" wine_fn_append_file CONFIGURE_TARGETS "config.log"
wine_fn_ignore_file "autom4te.cache" wine_fn_append_file CONFIGURE_TARGETS "config.status"
wine_fn_ignore_file "config.cache" wine_fn_append_file CONFIGURE_TARGETS "include/config.h"
wine_fn_ignore_file "config.log" wine_fn_append_file CONFIGURE_TARGETS "include/stamp-h"
wine_fn_ignore_file "config.status" test "$wine_binary" = wine || wine_fn_append_file CONFIGURE_TARGETS "loader/wine"
wine_fn_ignore_file "configure.lineno"
wine_fn_ignore_file "include/config.h"
wine_fn_ignore_file "include/stamp-h"
test "$wine_binary" = wine || wine_fn_ignore_file "loader/wine"
if test "x$enable_tools" != xno if test "x$enable_tools" != xno
then then
wine_fn_ignore_file "tools/makedep$ac_exeext" wine_fn_append_file CONFIGURE_TARGETS "tools/makedep$ac_exeext"
ac_config_commands="$ac_config_commands tools/makedep" ac_config_commands="$ac_config_commands tools/makedep"
fi fi
@ -18298,18 +18272,11 @@ fi
test "$MSGFMT" != false || LINGUAS= test "$MSGFMT" != false || LINGUAS=
for i in $LINGUAS
do
wine_fn_ignore_file "po/$i.mo"
done
if test "x$enable_tools" != xno if test "x$enable_tools" != xno
then then
wine_fn_append_rule "tools/makedep$ac_exeext: $srcdir/tools/makedep.c include/config.h config.status wine_fn_append_rule "tools/makedep$ac_exeext: $srcdir/tools/makedep.c include/config.h config.status
@./config.status tools/makedep @./config.status tools/makedep
Makefile: tools/makedep$ac_exeext Makefile: tools/makedep$ac_exeext"
distclean:: clean
\$(RM) tools/makedep$ac_exeext"
else else
wine_fn_append_rule "\$(MAKEDEP): wine_fn_append_rule "\$(MAKEDEP):
@echo \"You need to run make in $TOOLSDIR first\" && false" @echo \"You need to run make in $TOOLSDIR first\" && false"
@ -18342,12 +18309,6 @@ uninstall::
esac esac
fi fi
if test "$srcdir" = .
then
ac_config_commands="$ac_config_commands .gitignore"
fi
$as_echo " done" >&6 $as_echo " done" >&6
cat >confcache <<\_ACEOF cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure # This file is a shell script that caches the results of configure
@ -19054,13 +19015,6 @@ wine_fn_output_makefile ()
_WINE_EOF _WINE_EOF
as_fn_error $? "could not create Makefile" "$LINENO" 5 as_fn_error $? "could not create Makefile" "$LINENO" 5
} }
wine_fn_output_gitignore ()
{
sort <<\_WINE_EOF >\$tmp/gitignore && mv -f \$tmp/gitignore \$1 && return
$GITIGNORE
_WINE_EOF
as_fn_error $? "could not create .gitignore" "$LINENO" 5
}
_ACEOF _ACEOF
@ -19084,7 +19038,6 @@ do
"tools/makedep") CONFIG_COMMANDS="$CONFIG_COMMANDS tools/makedep" ;; "tools/makedep") CONFIG_COMMANDS="$CONFIG_COMMANDS tools/makedep" ;;
"Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;; "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
"Make.tmp") CONFIG_FILES="$CONFIG_FILES Make.tmp:Makefile.in" ;; "Make.tmp") CONFIG_FILES="$CONFIG_FILES Make.tmp:Makefile.in" ;;
".gitignore") CONFIG_COMMANDS="$CONFIG_COMMANDS .gitignore" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac esac
@ -19670,7 +19623,6 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
"include/stamp-h":C) echo timestamp > include/stamp-h ;; "include/stamp-h":C) echo timestamp > include/stamp-h ;;
"tools/makedep":C) wine_fn_output_makedep || as_fn_exit $? ;; "tools/makedep":C) wine_fn_output_makedep || as_fn_exit $? ;;
"Makefile":C) wine_fn_output_makefile Makefile ;; "Makefile":C) wine_fn_output_makefile Makefile ;;
".gitignore":C) wine_fn_output_gitignore .gitignore ;;
esac esac
done # for ac_tag done # for ac_tag

View File

@ -2616,11 +2616,6 @@ Makefile: $srcdir/Makefile.in config.status \$(MAKEDEP)
depend: \$(MAKEDEP) dummy depend: \$(MAKEDEP) dummy
\$(MAKEDEP)]) \$(MAKEDEP)])
test "$srcdir" = . && WINE_APPEND_RULE(
[all: .gitignore
.gitignore: config.status
@./config.status .gitignore])
test -n "$CROSSTARGET" || WINE_APPEND_RULE( test -n "$CROSSTARGET" || WINE_APPEND_RULE(
[crosstest: [crosstest:
@echo \"crosstest is not supported (mingw not installed?)\" && false]) @echo \"crosstest is not supported (mingw not installed?)\" && false])
@ -3602,15 +3597,11 @@ dnl End of auto-generated output commands
dnl Main ignore file dnl Main ignore file
WINE_IGNORE_FILE(".gitignore")
WINE_IGNORE_FILE("Makefile")
WINE_IGNORE_FILE("TAGS") WINE_IGNORE_FILE("TAGS")
WINE_IGNORE_FILE("tags") WINE_IGNORE_FILE("tags")
WINE_IGNORE_FILE("autom4te.cache") WINE_IGNORE_FILE("autom4te.cache")
WINE_IGNORE_FILE("config.cache")
WINE_IGNORE_FILE("config.log") WINE_IGNORE_FILE("config.log")
WINE_IGNORE_FILE("config.status") WINE_IGNORE_FILE("config.status")
WINE_IGNORE_FILE("configure.lineno")
WINE_IGNORE_FILE("include/config.h") WINE_IGNORE_FILE("include/config.h")
WINE_IGNORE_FILE("include/stamp-h") WINE_IGNORE_FILE("include/stamp-h")
test "$wine_binary" = wine || WINE_IGNORE_FILE("loader/wine") test "$wine_binary" = wine || WINE_IGNORE_FILE("loader/wine")
@ -3652,19 +3643,12 @@ fi
test "$MSGFMT" != false || LINGUAS= test "$MSGFMT" != false || LINGUAS=
for i in $LINGUAS
do
WINE_IGNORE_FILE("po/$i.mo")
done
if test "x$enable_tools" != xno if test "x$enable_tools" != xno
then then
WINE_APPEND_RULE( WINE_APPEND_RULE(
[tools/makedep$ac_exeext: $srcdir/tools/makedep.c include/config.h config.status [tools/makedep$ac_exeext: $srcdir/tools/makedep.c include/config.h config.status
@./config.status tools/makedep @./config.status tools/makedep
Makefile: tools/makedep$ac_exeext Makefile: tools/makedep$ac_exeext])
distclean:: clean
\$(RM) tools/makedep$ac_exeext])
else else
WINE_APPEND_RULE( WINE_APPEND_RULE(
[\$(MAKEDEP): [\$(MAKEDEP):
@ -3700,18 +3684,6 @@ uninstall::
esac esac
fi fi
if test "$srcdir" = .
then
AC_CONFIG_COMMANDS([.gitignore], [wine_fn_output_gitignore .gitignore],
[wine_fn_output_gitignore ()
{
sort <<\_WINE_EOF >\$tmp/gitignore && mv -f \$tmp/gitignore \$[]1 && return
$GITIGNORE
_WINE_EOF
AS_ERROR([could not create .gitignore])
}])
fi
AS_ECHO(" done") >&AS_MESSAGE_FD AS_ECHO(" done") >&AS_MESSAGE_FD
AC_OUTPUT AC_OUTPUT

View File

@ -3044,8 +3044,10 @@ static struct strarray output_sources( const struct makefile *make )
{ {
struct strarray build_deps = empty_strarray; struct strarray build_deps = empty_strarray;
struct strarray makefile_deps = empty_strarray; struct strarray makefile_deps = empty_strarray;
struct strarray distclean_files = empty_strarray; struct strarray distclean_files = get_expanded_make_var_array( make, "CONFIGURE_TARGETS" );
strarray_add( &distclean_files, obj_dir_path( make, output_makefile_name ));
if (!make->src_dir) strarray_add( &distclean_files, obj_dir_path( make, ".gitignore" ));
for (i = 0; i < make->subdirs.count; i++) for (i = 0; i < make->subdirs.count; i++)
{ {
const struct makefile *submake = make->submakes[i]; const struct makefile *submake = make->submakes[i];
@ -3103,6 +3105,8 @@ static struct strarray output_sources( const struct makefile *make )
output( "\n" ); output( "\n" );
} }
if (!make->base_dir)
strarray_addall( &clean_files, get_expanded_make_var_array( make, "CONFIGURE_TARGETS" ));
return clean_files; return clean_files;
} }
@ -3317,8 +3321,7 @@ static void output_dependencies( const struct makefile *make )
strarray_add( &ignore_files, "testlist.c" ); strarray_add( &ignore_files, "testlist.c" );
} }
strarray_addall( &ignore_files, targets ); strarray_addall( &ignore_files, targets );
if (!make->src_dir && make->base_dir) if (!make->src_dir) output_gitignore( base_dir_path( make, ".gitignore" ), ignore_files );
output_gitignore( base_dir_path( make, ".gitignore" ), ignore_files );
create_file_directories( make, targets ); create_file_directories( make, targets );