makefiles: Move the main module rules to the global Make.rules file.

This commit is contained in:
Alexandre Julliard 2013-10-05 11:22:18 +02:00
parent f94c8669c5
commit fabd3120c5
5 changed files with 17 additions and 24 deletions

View File

@ -25,7 +25,7 @@ IDL_GEN_HEADERS = $(IDL_H_SRCS:.idl=.h) $(IDL_C_SRCS:.idl=.h) $(IDL_I_SRCS:.idl=
$(IDL_P_SRCS:.idl=.h) $(IDL_S_SRCS:.idl=.h) $(IDL_P_SRCS:.idl=.h) $(IDL_S_SRCS:.idl=.h)
CLEAN_FILES = *.o *.a *.so *.mo *.res *.fake *.ok *.tab.[ch] *.yy.c CLEAN_FILES = *.o *.a *.so *.mo *.res *.fake *.ok *.tab.[ch] *.yy.c
CLEAN_TARGETS = $(IMPORTLIB:%=lib%.@IMPLIBEXT@) $(IDL_GEN_C_SRCS) $(IDL_GEN_HEADERS) \ CLEAN_TARGETS = $(MODULE) $(IMPORTLIB:%=lib%.@IMPLIBEXT@) $(IDL_GEN_C_SRCS) $(IDL_GEN_HEADERS) \
$(IDL_TLB_SRCS:.idl=.tlb) $(IDL_P_SRCS:.idl=_p.c dlldata.c) \ $(IDL_TLB_SRCS:.idl=.tlb) $(IDL_P_SRCS:.idl=_p.c dlldata.c) \
$(PO_SRCS:.rc=.res rsrc.pot) $(MC_SRCS:.mc=.res msg.pot) $(XTEMPLATE_SRCS:.x=.h) $(PO_SRCS:.rc=.res rsrc.pot) $(MC_SRCS:.mc=.res msg.pot) $(XTEMPLATE_SRCS:.x=.h)
@ -109,6 +109,11 @@ CROSSOBJS = $(OBJS:.o=.cross.o)
dlldata.c: $(WIDL) Makefile.in dlldata.c: $(WIDL) Makefile.in
$(WIDL) $(IDLFLAGS) --dlldata-only -o $@ $(IDL_P_SRCS) $(WIDL) $(IDLFLAGS) --dlldata-only -o $@ $(IDL_P_SRCS)
# Rules for main module
$(MODULE) $(MODULE:%=%.so) $(MODULE:%=%.fake): $(MAINSPEC) $(OBJS) Makefile.in
$(WINEGCC) $(APPMODE) $(MODULEFLAGS) $(OBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(DELAYIMPORTS:%=-Wb,-d%) -lwine $(LIBPORT) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
# Rules for static libraries # Rules for static libraries
all: $(STATICLIB) all: $(STATICLIB)

View File

@ -9,9 +9,9 @@
# #
DLLFLAGS = @DLLFLAGS@ DLLFLAGS = @DLLFLAGS@
MODULE = $(TESTDLL:%.dll=%)_test.exe TESTMODULE = $(TESTDLL:%.dll=%)_test.exe
TESTRESULTS = $(C_SRCS:.c=.ok) TESTRESULTS = $(C_SRCS:.c=.ok)
TESTPROGRAM = $(MODULE)$(DLLEXT) TESTPROGRAM = $(TESTMODULE)$(DLLEXT)
WINETEST_EXE = $(TESTDLL:%.dll=%)_test-stripped.exe$(DLLEXT) WINETEST_EXE = $(TESTDLL:%.dll=%)_test-stripped.exe$(DLLEXT)
WINETEST_RES = $(top_builddir)/programs/winetest/$(TESTDLL:%.dll=%)_test.res WINETEST_RES = $(top_builddir)/programs/winetest/$(TESTDLL:%.dll=%)_test.res
RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(top_builddir) -p $(TESTPROGRAM) RUNTESTFLAGS = -q -P wine -M $(TESTDLL) -T $(top_builddir) -p $(TESTPROGRAM)
@ -26,14 +26,14 @@ MAKEDEPFLAGS = -xo -xcross.o
all: $(TESTPROGRAM) $(WINETEST_RES) all: $(TESTPROGRAM) $(WINETEST_RES)
$(MODULE) $(MODULE).so: $(OBJS) Makefile.in $(TESTMODULE) $(TESTMODULE).so: $(OBJS) Makefile.in
$(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(ALL_LIBS) $(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(ALL_LIBS)
$(WINETEST_EXE): $(OBJS) Makefile.in $(WINETEST_EXE): $(OBJS) Makefile.in
$(WINEGCC) -s -Wb,-F,$(MODULE) $(APPMODE) $(OBJS) -o $@ $(ALL_LIBS) $(WINEGCC) -s -Wb,-F,$(TESTMODULE) $(APPMODE) $(OBJS) -o $@ $(ALL_LIBS)
$(WINETEST_RES): $(WINETEST_EXE) $(WINETEST_RES): $(WINETEST_EXE)
echo "$(MODULE) TESTRES \"$(WINETEST_EXE)\"" | $(WRC) $(RCFLAGS) -o $@ echo "$(TESTMODULE) TESTRES \"$(WINETEST_EXE)\"" | $(WRC) $(RCFLAGS) -o $@
.PHONY: check test testclean crosstest .PHONY: check test testclean crosstest
@ -48,7 +48,7 @@ testlist.o testlist.cross.o: testlist.c $(top_srcdir)/include/wine/test.h
check test: $(TESTRESULTS) check test: $(TESTRESULTS)
$(TESTRESULTS): $(MODULE)$(DLLEXT) ../$(TESTDLL)$(DLLEXT) $(TESTRESULTS): $(TESTMODULE)$(DLLEXT) ../$(TESTDLL)$(DLLEXT)
# Rules for cross-compiling tests # Rules for cross-compiling tests
@ -63,4 +63,4 @@ testclean::
$(RM) $(TESTRESULTS) $(RM) $(TESTRESULTS)
clean:: clean::
$(RM) testlist.c $(MODULE) $(TESTRESULTS) $(CROSSTEST) $(RM) testlist.c $(TESTMODULE) $(TESTRESULTS) $(CROSSTEST)

View File

@ -8,14 +8,10 @@
# #
DLLFLAGS = @DLLFLAGS@ DLLFLAGS = @DLLFLAGS@
BASEMODULE = $(MODULE:%.dll=%) MAINSPEC = $(MODULE:%.dll=%).spec
MAINSPEC = $(BASEMODULE).spec
ALL_LIBS = $(LIBPORT) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
IDL_TLB_RES = $(IDL_TLB_SRCS:.idl=_t.res) IDL_TLB_RES = $(IDL_TLB_SRCS:.idl=_t.res)
MODULEFLAGS = -shared $(srcdir)/$(MAINSPEC) $(EXTRADLLFLAGS)
@MAKE_RULES@
all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT) all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT)
$(MODULE) $(MODULE).so $(MODULE).fake: $(MAINSPEC) $(OBJS) Makefile.in @MAKE_RULES@
$(WINEGCC) -shared $(srcdir)/$(MAINSPEC) $(OBJS) $(EXTRADLLFLAGS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(DELAYIMPORTS:%=-Wb,-d%) $(ALL_LIBS)

View File

@ -10,14 +10,7 @@
# #
DLLFLAGS = @DLLFLAGS@ DLLFLAGS = @DLLFLAGS@
ALL_LIBS = $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(EXTRALIBS) -lwine $(LIBPORT) $(LDFLAGS) $(LIBS)
@MAKE_RULES@
all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT) all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT)
$(MODULE) $(MODULE).so $(MODULE).fake: $(OBJS) Makefile.in @MAKE_RULES@
$(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(ALL_LIBS) $(DELAYIMPORTS:%=-Wb,-d%)
clean::
$(RM) $(MODULE)

View File

@ -930,7 +930,6 @@ static void build(struct options* opts)
add_library(opts, lib_dirs, files, "kernel32"); add_library(opts, lib_dirs, files, "kernel32");
add_library(opts, lib_dirs, files, "ntdll"); add_library(opts, lib_dirs, files, "ntdll");
} }
if (opts->shared && !opts->nostdlib) add_library(opts, lib_dirs, files, "wine");
if (!opts->shared && opts->use_msvcrt && opts->target_platform == PLATFORM_CYGWIN) if (!opts->shared && opts->use_msvcrt && opts->target_platform == PLATFORM_CYGWIN)
add_library(opts, lib_dirs, files, "msvcrt"); add_library(opts, lib_dirs, files, "msvcrt");