Create at most one glue file for a single dll.

Avoid the intermediate .tmp.o file when building programs.
This commit is contained in:
Alexandre Julliard 2002-08-01 18:36:58 +00:00
parent 1862a67d2d
commit 526531eb6c
28 changed files with 43 additions and 112 deletions

View File

@ -13,7 +13,6 @@
# GEN_ASM_SRCS : generated assembly sources # GEN_ASM_SRCS : generated assembly sources
# RC_SRCS : resource source files # RC_SRCS : resource source files
# SPEC_SRCS : interface definition files # SPEC_SRCS : interface definition files
# GLUE : C sources for which glue code needs to be generated
# EXTRA_SRCS : extra source files for make depend # EXTRA_SRCS : extra source files for make depend
# EXTRA_OBJS : extra object files # EXTRA_OBJS : extra object files
# IMPORTS : dlls to import # IMPORTS : dlls to import
@ -112,15 +111,14 @@ conf_manext = 5
CLEAN_FILES = *.o *.a *.so *.ln *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \ CLEAN_FILES = *.o *.a *.so *.ln *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
*.flc *.spec.c *.spec.def *.glue.c *.dbg.c y.tab.c y.tab.h @LEX_OUTPUT_ROOT@.c core *.flc *.spec.c *.spec.def *.glue.c *.dbg.c y.tab.c y.tab.h @LEX_OUTPUT_ROOT@.c core
OBJS = $(C_SRCS:.c=.o) $(GEN_C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) \ OBJS = $(C_SRCS:.c=.o) $(GEN_C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) $(ASM_SRCS:.S=.o) $(EXTRA_OBJS)
$(ASM_SRCS:.S=.o) $(GLUE:.c=.glue.o) $(EXTRA_OBJS)
RCOBJS = $(RC_SRCS:.rc=.res.o) RCOBJS = $(RC_SRCS:.rc=.res.o)
LINTS = $(C_SRCS:.c=.ln) LINTS = $(C_SRCS:.c=.ln)
# Implicit rules # Implicit rules
.SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.c .spec.def .glue.c .pl .ok .SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.c .spec.def .pl .ok
.c.o: .c.o:
$(CC) -c $(ALLCFLAGS) -o $@ $< $(CC) -c $(ALLCFLAGS) -o $@ $<
@ -146,9 +144,6 @@ LINTS = $(C_SRCS:.c=.ln)
.spec.spec.def: .spec.spec.def:
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -def $< $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -def $<
.c.glue.c:
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -glue $<
.c.ln: .c.ln:
$(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 ) $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
@ -167,36 +162,20 @@ filter:
.PHONY: all filter .PHONY: all filter
# Rule for main module intermediate object
$(MODULE).tmp.o: $(SPEC_SRCS:.spec=.spec.o) $(OBJS) Makefile.in
$(LDCOMBINE) $(SPEC_SRCS:.spec=.spec.o) $(OBJS) -o $@
-$(STRIP) --strip-unneeded $@
# Rule for main module debug channels # Rule for main module debug channels
$(MODULE).dbg.c: $(C_SRCS) $(WINEBUILD) $(MODULE).dbg.c: $(C_SRCS) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -debug -C$(SRCDIR) $(C_SRCS) $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -debug -C$(SRCDIR) $(C_SRCS)
# Rule to rebuild the resource compiler # Rule for 16-bit glue
$(WRC): $(MODULE).glue.c: $(C_SRCS) $(WINEBUILD)
cd $(TOOLSDIR)/tools/wrc && $(MAKE) wrc $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -glue -C$(SRCDIR) $(C_SRCS)
# Rule to rebuild the message compiler # Rule to rebuild the tools
$(WMC): $(MAKEDEP) $(WINEBUILD) $(WMC) $(WRC):
cd $(TOOLSDIR)/tools/wmc && $(MAKE) wmc cd $(TOOLSDIR)/tools && $(MAKE) `basename $@`
# Rule to rebuild the 'makedep' program
$(MAKEDEP):
cd $(TOOLSDIR)/tools && $(MAKE) makedep
# Rule to rebuild the 'winebuild' program
$(WINEBUILD):
cd $(TOOLSDIR)/tools/winebuild && $(MAKE) winebuild
# Rules for makefile # Rules for makefile
@ -304,12 +283,8 @@ $(TESTLIST): Makefile.in
$(TESTPROGRAM).so: $(TESTPROGRAM).spec.o $(TESTOBJS) $(TESTPROGRAM).so: $(TESTPROGRAM).spec.o $(TESTOBJS)
$(LDSHARED) @LDDLLFLAGS@ $(TESTPROGRAM).spec.o $(TESTOBJS) -o $@ $(LIBWINE) $(LIBS) $(LDSHARED) @LDDLLFLAGS@ $(TESTPROGRAM).spec.o $(TESTOBJS) -o $@ $(LIBWINE) $(LIBS)
$(TESTPROGRAM).tmp.o: $(TESTOBJS) $(TESTPROGRAM).spec.c: $(TESTOBJS) $(WINEBUILD)
$(LDCOMBINE) $(TESTOBJS) -o $@ $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -exe $(TESTPROGRAM) -mcui $(TESTOBJS) -L$(DLLDIR) $(TESTIMPORTS:%=-l%)
-$(STRIP) --strip-unneeded $@
$(TESTPROGRAM).spec.c: $(TESTPROGRAM).tmp.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -sym $(TESTPROGRAM).tmp.o -o $@ -exe $(TESTPROGRAM) -mcui -L$(DLLDIR) $(TESTIMPORTS:%=-l%)
$(TESTPROGRAM): $(TESTOBJS) $(TESTPROGRAM): $(TESTOBJS)
$(CC) $(TESTOBJS) -o $@ $(TESTIMPORTS:%=-l%) $(LIBWINE) $(LIBS) $(CC) $(TESTOBJS) -o $@ $(TESTIMPORTS:%=-l%) $(LIBWINE) $(LIBS)
@ -318,8 +293,6 @@ $(TESTPROGRAM): $(TESTOBJS)
$(SPEC_SRCS:.spec=.spec.c): $(WINEBUILD) $(SPEC_SRCS:.spec=.spec.c): $(WINEBUILD)
$(GLUE:.c=.glue.c): $(WINEBUILD)
$(RC_SRCS:.rc=.res): $(WRC) $(RC_SRCS:.rc=.res): $(WRC)
$(RC_SRCS16:.rc=.res): $(WRC) $(RC_SRCS16:.rc=.res): $(WRC)

View File

@ -1 +0,0 @@
edit.glue.c

View File

@ -14,7 +14,7 @@ ALTSPECS = $(ALTNAMES:%.dll=%)
SPEC_SRCS = $(ALTSPECS:%=%.spec) SPEC_SRCS = $(ALTSPECS:%=%.spec)
MAINSPEC = $(MODULE:%.dll=%).spec MAINSPEC = $(MODULE:%.dll=%).spec
SPEC_DEF = $(MAINSPEC).def SPEC_DEF = $(MAINSPEC).def
ALL_OBJS = $(MAINSPEC).o $(SPEC_SRCS:.spec=.spec.o) $(OBJS) $(MODULE).dbg.o ALL_OBJS = $(SPEC_SRCS:.spec=.spec.o) $(OBJS) $(MODULE).dbg.o
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS) ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
TESTIMPORTS = $(MODULE:%.dll=%) $(DELAYIMPORTS) $(IMPORTS) TESTIMPORTS = $(MODULE:%.dll=%) $(DELAYIMPORTS) $(IMPORTS)
@ -22,15 +22,17 @@ all: $(MODULE)$(DLLEXT)
@MAKE_RULES@ @MAKE_RULES@
# Rule for main module spec file
$(MAINSPEC).c: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MAINSPEC) $(RC_SRCS:%.rc=-res %.res) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
# Rules for .so files # Rules for .so files
$(MODULE).so: $(ALL_OBJS) Makefile.in $(MAINSPEC).c: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
$(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS) $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -spec $(SRCDIR)/$(MAINSPEC) $(RC_SRCS:%.rc=-res %.res) $(SYMBOLFILE) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
$(MODULE).so: $(MAINSPEC).o $(ALL_OBJS) Makefile.in
$(LDSHARED) $(LDDLLFLAGS) $(MAINSPEC).o $(ALL_OBJS) -o $@ -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS)
$(MODULE).tmp.o: $(ALL_OBJS) Makefile.in
$(LDCOMBINE) $(ALL_OBJS) -o $@
-$(STRIP) --strip-unneeded $@
# Rules for .dll files # Rules for .dll files

View File

@ -2,8 +2,8 @@ Makefile
dispdib.spec.c dispdib.spec.c
gdi.exe.spec.c gdi.exe.spec.c
gdi32.dll.dbg.c gdi32.dll.dbg.c
gdi32.dll.glue.c
gdi32.spec.c gdi32.spec.c
printdrv.glue.c
version.res version.res
version16.res version16.res
wing.spec.c wing.spec.c

View File

@ -62,14 +62,7 @@ C_SRCS = \
RC_SRCS = version.rc RC_SRCS = version.rc
RC_SRCS16 = version16.rc RC_SRCS16 = version16.rc
GLUE = \ EXTRA_OBJS = $(MODULE).glue.o
$(TOPOBJDIR)/objects/dc.c \
$(TOPOBJDIR)/objects/font.c \
$(TOPOBJDIR)/objects/gdiobj.c \
$(TOPOBJDIR)/objects/linedda.c \
$(TOPOBJDIR)/objects/metafile.c \
printdrv.c \
win16drv/prtdrv.c
EXTRASUBDIRS = \ EXTRASUBDIRS = \
$(TOPOBJDIR)/graphics \ $(TOPOBJDIR)/graphics \

View File

@ -1 +0,0 @@
prtdrv.glue.c

View File

@ -2,12 +2,12 @@ Makefile
comm.spec.c comm.spec.c
kernel.res kernel.res
kernel32.dll.dbg.c kernel32.dll.dbg.c
kernel32.dll.glue.c
kernel32.spec.c kernel32.spec.c
krnl386.exe.spec.c krnl386.exe.spec.c
stress.spec.c stress.spec.c
system.spec.c system.spec.c
toolhelp.spec.c toolhelp.spec.c
utthunk.glue.c
version16.res version16.res
win87em.spec.c win87em.spec.c
windebug.spec.c windebug.spec.c

View File

@ -33,7 +33,7 @@ RC_SRCS16 = \
MC_SRCS = \ MC_SRCS = \
messages/winerr_enu.mc messages/winerr_enu.mc
GLUE = utthunk.c EXTRA_OBJS = $(MODULE).glue.o
EXTRASUBDIRS = \ EXTRASUBDIRS = \
messages \ messages \

View File

@ -1,5 +1,5 @@
Makefile Makefile
msvfw32.dll.dbg.c msvfw32.dll.dbg.c
msvfw32.dll.glue.c
msvfw32.spec.c msvfw32.spec.c
msvideo.spec.c msvideo.spec.c
msvideo_main.glue.c

View File

@ -14,9 +14,8 @@ C_SRCS = \
msvideo_main.c \ msvideo_main.c \
drawdib.c drawdib.c
GLUE = msvideo_main.c EXTRA_OBJS = $(MODULE).glue.o
@MAKE_DLL_RULES@ @MAKE_DLL_RULES@
### Dependencies: ### Dependencies:

View File

@ -1,5 +1,6 @@
Makefile Makefile
ntdll.dll.dbg.c ntdll.dll.dbg.c
ntdll.dll.glue.c
ntdll.spec.c ntdll.spec.c
relay16.s relay16.s
relay32.s relay32.s

View File

@ -118,11 +118,7 @@ GEN_ASM_SRCS = \
relay16.s \ relay16.s \
relay32.s relay32.s
GLUE = \ EXTRA_OBJS = $(MODULE).glue.o
$(TOPOBJDIR)/loader/task.c \
$(TOPOBJDIR)/loader/ne/module.c \
$(TOPOBJDIR)/loader/ne/segment.c \
$(TOPOBJDIR)/memory/local.c
EXTRASUBDIRS = \ EXTRASUBDIRS = \
$(TOPOBJDIR)/files \ $(TOPOBJDIR)/files \

View File

@ -1,6 +1,6 @@
Makefile Makefile
setupapi.dll.dbg.c setupapi.dll.dbg.c
setupapi.dll.glue.c
setupapi.res setupapi.res
setupapi.spec.c setupapi.spec.c
setupx.spec.c setupx.spec.c
virtcopy.glue.c

View File

@ -22,11 +22,10 @@ C_SRCS = \
stubs.c \ stubs.c \
virtcopy.c virtcopy.c
GLUE = \
virtcopy.c
RC_SRCS= setupapi.rc RC_SRCS= setupapi.rc
EXTRA_OBJS = $(MODULE).glue.o
@MAKE_DLL_RULES@ @MAKE_DLL_RULES@
### Dependencies: ### Dependencies:

View File

@ -3,9 +3,7 @@ ddeml.spec.c
display.spec.c display.spec.c
keyboard.spec.c keyboard.spec.c
mouse.spec.c mouse.spec.c
property.glue.c
text.glue.c
user.exe.spec.c user.exe.spec.c
user32.dll.dbg.c user32.dll.dbg.c
user32.dll.glue.c
user32.spec.c user32.spec.c
wnd16.glue.c

View File

@ -82,15 +82,7 @@ RC_SRCS16 = \
resources/mouse.rc \ resources/mouse.rc \
resources/version16.rc resources/version16.rc
GLUE = \ EXTRA_OBJS = $(MODULE).glue.o
$(TOPOBJDIR)/controls/edit.c \
$(TOPOBJDIR)/windows/driver.c \
$(TOPOBJDIR)/windows/hook.c \
$(TOPOBJDIR)/windows/painting.c \
dde/ddeml16.c \
property.c \
text.c \
wnd16.c
EXTRASUBDIRS = \ EXTRASUBDIRS = \
$(TOPOBJDIR)/controls \ $(TOPOBJDIR)/controls \

View File

@ -1 +0,0 @@
ddeml16.glue.c

View File

@ -1,5 +1,5 @@
Makefile Makefile
winaspi.spec.c winaspi.spec.c
winaspi16.glue.c
wnaspi32.dll.dbg.c wnaspi32.dll.dbg.c
wnaspi32.dll.glue.c
wnaspi32.spec.c wnaspi32.spec.c

View File

@ -14,7 +14,7 @@ C_SRCS = \
winaspi16.c \ winaspi16.c \
winaspi32.c winaspi32.c
GLUE = winaspi16.c EXTRA_OBJS = $(MODULE).glue.o
@MAKE_DLL_RULES@ @MAKE_DLL_RULES@

View File

@ -1,9 +1,7 @@
Makefile Makefile
lolvldrv.glue.c
mmsystem.glue.c
mmsystem.spec.c mmsystem.spec.c
sound.spec.c sound.spec.c
time.glue.c
winmm.dll.dbg.c winmm.dll.dbg.c
winmm.dll.glue.c
winmm.spec.c winmm.spec.c
winmm_res.res winmm_res.res

View File

@ -20,13 +20,10 @@ C_SRCS = \
sound16.c \ sound16.c \
time.c time.c
GLUE = \
lolvldrv.c \
mmsystem.c \
time.c
RC_SRCS = winmm_res.rc RC_SRCS = winmm_res.rc
EXTRA_OBJS = $(MODULE).glue.o
@MAKE_DLL_RULES@ @MAKE_DLL_RULES@
### Dependencies: ### Dependencies:

View File

@ -1 +0,0 @@
task.glue.c

View File

@ -1,2 +0,0 @@
module.glue.c
segment.glue.c

View File

@ -1 +0,0 @@
local.glue.c

View File

@ -1,6 +0,0 @@
Makefile
dc.glue.c
font.glue.c
gdiobj.glue.c
linedda.glue.c
metafile.glue.c

View File

@ -13,7 +13,6 @@ DEFS = @DLLFLAGS@ -DSTRICT -DNONAMELESSUNION -DNONAMELESSSTRUCT $(EXTRADE
LDDLLFLAGS = @LDDLLFLAGS@ LDDLLFLAGS = @LDDLLFLAGS@
ALL_OBJS = $(OBJS) $(MODULE).dbg.o ALL_OBJS = $(OBJS) $(MODULE).dbg.o
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS) ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
SYMBOLFILE = $(MODULE).tmp.o
BASEMODULE = $(MODULE:.exe=) BASEMODULE = $(MODULE:.exe=)
TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS) TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
@ -23,8 +22,8 @@ all: $(MODULE)$(DLLEXT) $(BASEMODULE)$(EXEEXT)
# Rule for main module spec file # Rule for main module spec file
$(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD) $(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(ALL_OBJS) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) $(SYMBOLFILE:%=-sym %) -o $@ -exe $(MODULE) $(APPMODE:%=-m%) $(RC_SRCS:%.rc=-res %.res) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%) $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -exe $(MODULE) $(APPMODE:%=-m%) $(RC_SRCS:%.rc=-res %.res) $(ALL_OBJS) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
# Rules for .so main module # Rules for .so main module

View File

@ -18,13 +18,13 @@ C_SRCS = \
all: $(PROGRAMS:%=%$(DLLEXT)) $(PROGRAMS:.exe=$(EXEEXT)) all: $(PROGRAMS:%=%$(DLLEXT)) $(PROGRAMS:.exe=$(EXEEXT))
aviinfo.exe.spec.c: aviinfo.o $(WINEBUILD) aviinfo.exe.spec.c: aviinfo.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -sym aviinfo.o -o $@ -exe aviinfo.exe -mgui -L$(DLLDIR) -lkernel32 $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -exe aviinfo.exe -mgui aviinfo.o -L$(DLLDIR) -lkernel32
aviplay.exe.spec.c: aviplay.o $(WINEBUILD) aviplay.exe.spec.c: aviplay.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -sym aviplay.o -o $@ -exe aviplay.exe -mgui -L$(DLLDIR) -lddraw -lkernel32 $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -exe aviplay.exe -mgui aviplay.o -L$(DLLDIR) -lddraw -lkernel32
icinfo.exe.spec.c: icinfo.o $(WINEBUILD) icinfo.exe.spec.c: icinfo.o $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -sym icinfo.o -o $@ -exe icinfo.exe -mgui -L$(DLLDIR) -lmsvfw32 -lkernel32 $(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -exe icinfo.exe -mgui icinfo.o -L$(DLLDIR) -lmsvfw32 -lkernel32
aviinfo.exe.so: aviinfo.o aviinfo.exe.spec.o aviinfo.exe.so: aviinfo.o aviinfo.exe.spec.o
$(LDSHARED) $(LDDLLFLAGS) -o $@ aviinfo.o aviinfo.exe.spec.o $(ALL_LIBS) $(LDSHARED) $(LDDLLFLAGS) -o $@ aviinfo.o aviinfo.exe.spec.o $(ALL_LIBS)

View File

@ -1,3 +0,0 @@
driver.glue.c
hook.glue.c
painting.glue.c