Commit c6b5f4a4 authored by Alexandre Julliard's avatar Alexandre Julliard

makefiles: Generate the top makefile entirely from configure.

parent 37c0f5c6
# This Makefile understands the following targets:
#
# all (default): build wine
# clean: remove all intermediate files
# distclean: also remove all files created by configure
# test: run tests
# testclean: clean test results to force running all tests again
# install-lib: install libraries needed to run applications
# install-dev: install development environment
# install: install everything
# uninstall: uninstall everything
# depend: create the dependencies
# ctags: create a tags file for vim and others.
# etags: create a TAGS file for Emacs.
# manpages: compile manpages for Wine API
# htmlpages: compile html pages for Wine API
# sgmlpages: compile sgml source for the Wine API Guide
# xmlpages: compile xml source for the Wine API Guide
# The following variable definitions are copied into all makefiles
prefix = @prefix@
exec_prefix = @exec_prefix@
@ALL_VARS_RULES@
@SET_MAKE@
all: wine
@echo "Wine build complete."
# Rules for re-running configure
config.status: $(srcdir)/configure
@./config.status --recheck
include/config.h: include/stamp-h
include/stamp-h: $(srcdir)/include/config.h.in config.status
@./config.status include/config.h include/stamp-h
# Rules for cleaning
distclean:: clean
rm -rf autom4te.cache documentation/html documentation/api-guide documentation/api-guide-xml documentation/man$(api_manext)
# Rules for API documentation
install-manpages:: manpages
for i in documentation/man$(api_manext)/*.$(api_manext); do $(srcdir)/tools/install-sh -m 644 $(INSTALL_DATA_FLAGS) $$i $(DESTDIR)$(mandir)/$$i; done
.PHONY: install-manpages
# Rules for generated source files
dlls/ntdll/unix/version.c: dummy
@version=`(GIT_DIR=$(srcdir)/.git git describe HEAD 2>/dev/null || echo "wine-$(PACKAGE_VERSION)") | sed -n -e '$$s/\(.*\)/const char wine_build[] = "\1";/p'` && (echo $$version | cmp -s - $@) || echo $$version >$@ || ($(RM) $@ && exit 1)
programs/winetest/build.rc: dummy
@build="STRINGTABLE { 1 \"`GIT_DIR=$(srcdir)/.git git rev-parse HEAD 2>/dev/null`\" }" && (echo $$build | cmp -s - $@) || echo $$build >$@ || (rm -f $@ && exit 1)
programs/winetest/build.nfo:
@-$(CC) -v 2>$@
dlls/wineandroid.drv/wine-debug.apk: dlls/wineandroid.drv/build.gradle $(srcdir)/dlls/wineandroid.drv/AndroidManifest.xml $(srcdir)/dlls/wineandroid.drv/WineActivity.java $(srcdir)/dlls/wineandroid.drv/wine.svg
cd dlls/wineandroid.drv && gradle -q -Psrcdir=$(srcdir) assembleDebug
mv dlls/wineandroid.drv/build/outputs/apk/wine-debug.apk $@
# Misc rules
TAGSFLAGS = --langmap='c:+.idl.l.rh,make:(Make*.in)'
TAGS etags:
rm -f TAGS
(test -d .git && git ls-files || find -L $(srcdir) -name '*.[ch]' -print) | xargs etags -a $(TAGSFLAGS)
tags ctags:
rm -f tags
(test -d .git && git ls-files || find -L $(srcdir) -name '*.[ch]' -print) | xargs ctags -a $(TAGSFLAGS)
......@@ -257,8 +257,7 @@ dnl
dnl Usage: AC_REQUIRE([WINE_CONFIG_HELPERS])
dnl
AC_DEFUN([WINE_CONFIG_HELPERS],
[wine_rules_file=conf$$rules.make
rm -f $wine_rules_file
[AS_VAR_SET([wine_rules],["all:"])
AC_SUBST(SUBDIRS,"")
AC_SUBST(DISABLED_SUBDIRS,"")
AC_SUBST(CONFIGURE_TARGETS,"")
......@@ -270,7 +269,7 @@ wine_fn_append_file ()
wine_fn_append_rule ()
{
AS_ECHO("$[1]") >>$wine_rules_file
AS_VAR_APPEND(wine_rules,"$as_nl$[1]")
}
wine_fn_config_makefile ()
......
......@@ -257,6 +257,9 @@ else
fi
AC_SUBST(toolsdir,[$wine_cv_toolsdir])
AC_SUBST(MAKEDEP,[$wine_makedep])
AC_SUBST(RUNTESTFLAGS,["-q -P wine"])
AC_SUBST(SED_CMD,["LC_ALL=C sed -e 's,@bindir@,\${bindir},g' -e 's,@dlldir@,\${dlldir},g' -e 's,@PACKAGE_STRING@,$PACKAGE_STRING,g' -e 's,@PACKAGE_VERSION@,$PACKAGE_VERSION,g'"])
AC_SUBST(api_manext,[3w])
if test -n "$host_alias" -a "$host_alias" != "$build_alias"
then
......@@ -2402,20 +2405,8 @@ AS_ECHO_N("creating Makefile rules...") >&AS_MESSAGE_FD
makedep_flags=""
test "x$enable_silent_rules" = xyes && makedep_flags="$makedep_flags -S"
dnl Main makefile
WINE_APPEND_RULE([
# Rules automatically generated by configure
.INIT: Makefile
.MAKEFILEDEPS:
all: Makefile
Makefile: $srcdir/Makefile.in config.status \$(MAKEDEP)
@./config.status Make.tmp Makefile
depend: \$(MAKEDEP)
\$(MAKEDEP)$makedep_flags
dummy:
.PHONY: depend dummy])
wine_srcdir=
test "$srcdir" = . || wine_srcdir="$srcdir/"
WINE_CONFIG_SYMLINK(wine,tools/winewrapper)
WINE_CONFIG_SYMLINK(wine64,tools/winewrapper,["x$enable_win64" != xno -o -n "$with_wine64"])
......@@ -3777,22 +3768,62 @@ then
[wine_fn_output_makedep ()
{
AS_MKDIR_P(tools)
$CC -I$srcdir/tools -Iinclude -I$srcdir/include -D__WINESRC__ $EXTRACFLAGS $CPPFLAGS $CFLAGS -o tools/makedep$ac_exeext $srcdir/tools/makedep.c $LDFLAGS
$CC -I${wine_srcdir}tools -Iinclude -I${wine_srcdir}include -D__WINESRC__ $EXTRACFLAGS $CPPFLAGS $CFLAGS -o tools/makedep$ac_exeext ${wine_srcdir}tools/makedep.c $LDFLAGS
}])
fi
AC_CONFIG_COMMANDS([Makefile], [wine_fn_output_makefile Makefile],
[wine_fn_output_makefile ()
{
cat Make.tmp - <<\_WINE_EOF >\$tmp/makefile && mv -f \$tmp/makefile \$[]1 && rm -f Make.tmp && "$wine_makedep"$makedep_flags && return
`cat $wine_rules_file`
cat <<\_WINE_EOF >\$tmp/makefile && mv -f \$tmp/makefile \$[]1 && "$wine_makedep"$makedep_flags && return
# This Makefile understands the following targets:
#
# all (default): build wine
# clean: remove all intermediate files
# distclean: also remove all files created by configure
# test: run tests
# testclean: clean test results to force running all tests again
# install-lib: install libraries needed to run applications
# install-dev: install development environment
# install: install everything
# uninstall: uninstall everything
# ctags: create a tags file for vim and others.
# etags: create a TAGS file for Emacs.
# manpages: compile manpages for Wine API
# htmlpages: compile html pages for Wine API
# sgmlpages: compile sgml source for the Wine API Guide
# xmlpages: compile xml source for the Wine API Guide
m4_set_foreach([_AC_SUBST_VARS],[var],[var = $var
])$SET_MAKE
$wine_rules
_WINE_EOF
AS_ERROR([could not create Makefile])
}])
AC_CONFIG_FILES([Make.tmp:Makefile.in])
dnl Main makefile
AC_SUBST(SHELL,[/bin/sh])
WINE_APPEND_RULE(
[all: wine
@echo \"Wine build complete.\"
.INIT: Makefile
.MAKEFILEDEPS:
all: Makefile
Makefile: config.status \$(MAKEDEP)
@./config.status Makefile
depend: \$(MAKEDEP)
\$(MAKEDEP)$makedep_flags])
dnl Rules for re-running configure
dnl Some final makefile rules
WINE_APPEND_RULE(
[config.status: ${wine_srcdir}configure
@./config.status --recheck
include/config.h: include/stamp-h
include/stamp-h: ${wine_srcdir}include/config.h.in config.status
@./config.status include/config.h include/stamp-h])
if test "x$enable_maintainer_mode" = xyes
then
......@@ -3808,7 +3839,7 @@ fi
if test "x$enable_tools" != xno
then
WINE_APPEND_RULE(
[tools/makedep$ac_exeext: $srcdir/tools/makedep.c include/config.h config.status
[tools/makedep$ac_exeext: ${wine_srcdir}tools/makedep.c include/config.h config.status
@./config.status tools/makedep
Makefile: tools/makedep$ac_exeext])
else
......@@ -3817,6 +3848,8 @@ else
@echo \"You need to run make in $toolsdir first\" && false])
fi
dnl Rules for wineloader
if test -n "$with_wine64"
then
case "$with_wine64" in
......@@ -3861,16 +3894,43 @@ server/wineserver"
esac
fi
dnl Makefile variables
AC_SUBST(SHELL,[/bin/sh])
AC_SUBST(RUNTESTFLAGS,["-q -P wine"])
AC_SUBST(SED_CMD,["LC_ALL=C sed -e 's,@bindir@,\${bindir},g' -e 's,@dlldir@,\${dlldir},g' -e 's,@PACKAGE_STRING@,$PACKAGE_STRING,g' -e 's,@PACKAGE_VERSION@,$PACKAGE_VERSION,g'"])
AC_SUBST(api_manext,[3w])
AC_SUBST([ALL_VARS_RULES],
"m4_set_foreach([_AC_SUBST_VARS],[var],[m4_if(m4_bregexp(m4_defn([var]),[\(^SET_MAKE$\|prefix$\)]),-1,[var = $var
])])")
dnl Rules for cleaning
WINE_APPEND_RULE(
[distclean:: clean
rm -rf autom4te.cache documentation/html documentation/api-guide documentation/api-guide-xml documentation/man\$(api_manext)])
dnl Rules for API documentation
WINE_APPEND_RULE(
[install-manpages:: manpages
for i in documentation/man\$(api_manext)/*.\$(api_manext); do ${wine_srcdir}tools/install-sh -m 644 \$(INSTALL_DATA_FLAGS) \$\$i \$(DESTDIR)\$(mandir)/\$\$i; done])
dnl Rules for generated source files
WINE_APPEND_RULE(
[dlls/ntdll/unix/version.c: dummy
@version=\`(GIT_DIR=${wine_srcdir}.git git describe HEAD 2>/dev/null || echo \"wine-\$(PACKAGE_VERSION)\") | sed -n -e '\$\$s/\(.*\)/const char wine_build[[]] = \"\\1\";/p'\` && (echo \$\$version | cmp -s - \$[@]) || echo \$\$version >\$[@] || (rm -f \$[@] && exit 1)
programs/winetest/build.rc: dummy
@build=\"STRINGTABLE { 1 \\\"\`GIT_DIR=${wine_srcdir}.git git rev-parse HEAD 2>/dev/null\`\\\" }\" && (echo \$\$build | cmp -s - \$[@]) || echo \$\$build >\$[@] || (rm -f \$[@] && exit 1)
programs/winetest/build.nfo:
@-\$(CC) -v 2>\$[@]
dlls/wineandroid.drv/wine-debug.apk: dlls/wineandroid.drv/build.gradle ${wine_srcdir}dlls/wineandroid.drv/AndroidManifest.xml ${wine_srcdir}dlls/wineandroid.drv/WineActivity.java ${wine_srcdir}dlls/wineandroid.drv/wine.svg
cd dlls/wineandroid.drv && gradle -q -Psrcdir=$srcdir assembleDebug
mv dlls/wineandroid.drv/build/outputs/apk/wine-debug.apk \$[@]])
dnl Misc rules
AC_SUBST(TAGSFLAGS,["--langmap='c:+.idl.l.rh,make:(Make*.in)'"])
WINE_APPEND_RULE(
[TAGS etags:
rm -f TAGS
(test -d .git && git ls-files || find -L $srcdir -name '*.[[ch]]' -print) | xargs etags -a \$(TAGSFLAGS)
tags ctags:
rm -f tags
(test -d .git && git ls-files || find -L $srcdir -name '*.[[ch]]' -print) | xargs ctags -a \$(TAGSFLAGS)
dummy:
.PHONY: depend dummy install-manpages])
AS_ECHO(" done") >&AS_MESSAGE_FD
AC_OUTPUT
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment