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
# RC_SRCS : resource source 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_OBJS : extra object files
# IMPORTS : dlls to import
@ -112,15 +111,14 @@ conf_manext = 5
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
OBJS = $(C_SRCS:.c=.o) $(GEN_C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) \
$(ASM_SRCS:.S=.o) $(GLUE:.c=.glue.o) $(EXTRA_OBJS)
OBJS = $(C_SRCS:.c=.o) $(GEN_C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) $(ASM_SRCS:.S=.o) $(EXTRA_OBJS)
RCOBJS = $(RC_SRCS:.rc=.res.o)
LINTS = $(C_SRCS:.c=.ln)
# 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:
$(CC) -c $(ALLCFLAGS) -o $@ $<
@ -146,9 +144,6 @@ LINTS = $(C_SRCS:.c=.ln)
.spec.spec.def:
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -def $<
.c.glue.c:
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -glue $<
.c.ln:
$(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
@ -167,36 +162,20 @@ 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
$(MODULE).dbg.c: $(C_SRCS) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -debug -C$(SRCDIR) $(C_SRCS)
# Rule to rebuild the resource compiler
# Rule for 16-bit glue
$(WRC):
cd $(TOOLSDIR)/tools/wrc && $(MAKE) wrc
$(MODULE).glue.c: $(C_SRCS) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -glue -C$(SRCDIR) $(C_SRCS)
# Rule to rebuild the message compiler
# Rule to rebuild the tools
$(WMC):
cd $(TOOLSDIR)/tools/wmc && $(MAKE) wmc
# 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
$(MAKEDEP) $(WINEBUILD) $(WMC) $(WRC):
cd $(TOOLSDIR)/tools && $(MAKE) `basename $@`
# Rules for makefile
@ -304,12 +283,8 @@ $(TESTLIST): Makefile.in
$(TESTPROGRAM).so: $(TESTPROGRAM).spec.o $(TESTOBJS)
$(LDSHARED) @LDDLLFLAGS@ $(TESTPROGRAM).spec.o $(TESTOBJS) -o $@ $(LIBWINE) $(LIBS)
$(TESTPROGRAM).tmp.o: $(TESTOBJS)
$(LDCOMBINE) $(TESTOBJS) -o $@
-$(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).spec.c: $(TESTOBJS) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) -o $@ -exe $(TESTPROGRAM) -mcui $(TESTOBJS) -L$(DLLDIR) $(TESTIMPORTS:%=-l%)
$(TESTPROGRAM): $(TESTOBJS)
$(CC) $(TESTOBJS) -o $@ $(TESTIMPORTS:%=-l%) $(LIBWINE) $(LIBS)
@ -318,8 +293,6 @@ $(TESTPROGRAM): $(TESTOBJS)
$(SPEC_SRCS:.spec=.spec.c): $(WINEBUILD)
$(GLUE:.c=.glue.c): $(WINEBUILD)
$(RC_SRCS:.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)
MAINSPEC = $(MODULE:%.dll=%).spec
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)
TESTIMPORTS = $(MODULE:%.dll=%) $(DELAYIMPORTS) $(IMPORTS)
@ -22,15 +22,17 @@ all: $(MODULE)$(DLLEXT)
@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
$(MODULE).so: $(ALL_OBJS) Makefile.in
$(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ -L$(DLLDIR) $(LDIMPORTS:%=-l%) $(ALL_LIBS)
$(MAINSPEC).c: $(MAINSPEC) $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
$(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

View file

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

View file

@ -62,14 +62,7 @@ C_SRCS = \
RC_SRCS = version.rc
RC_SRCS16 = version16.rc
GLUE = \
$(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
EXTRA_OBJS = $(MODULE).glue.o
EXTRASUBDIRS = \
$(TOPOBJDIR)/graphics \

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -82,15 +82,7 @@ RC_SRCS16 = \
resources/mouse.rc \
resources/version16.rc
GLUE = \
$(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
EXTRA_OBJS = $(MODULE).glue.o
EXTRASUBDIRS = \
$(TOPOBJDIR)/controls \

View file

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

View file

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

View file

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

View file

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

View file

@ -20,13 +20,10 @@ C_SRCS = \
sound16.c \
time.c
GLUE = \
lolvldrv.c \
mmsystem.c \
time.c
RC_SRCS = winmm_res.rc
EXTRA_OBJS = $(MODULE).glue.o
@MAKE_DLL_RULES@
### 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@
ALL_OBJS = $(OBJS) $(MODULE).dbg.o
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
SYMBOLFILE = $(MODULE).tmp.o
BASEMODULE = $(MODULE:.exe=)
TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
@ -23,8 +22,8 @@ all: $(MODULE)$(DLLEXT) $(BASEMODULE)$(EXEEXT)
# Rule for main module spec file
$(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
$(LDPATH) $(WINEBUILD) $(DEFS) $(SYMBOLFILE:%=-sym %) -o $@ -exe $(MODULE) $(APPMODE:%=-m%) $(RC_SRCS:%.rc=-res %.res) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
$(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(ALL_OBJS) $(WINEBUILD)
$(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

View file

@ -18,13 +18,13 @@ C_SRCS = \
all: $(PROGRAMS:%=%$(DLLEXT)) $(PROGRAMS:.exe=$(EXEEXT))
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)
$(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)
$(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
$(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