Commit d62356aa authored by Alexandre Julliard's avatar Alexandre Julliard

Added rules to build import libraries in the individual dll makefiles.

Generate import libraries with the right name right away instead of using an intermediate .spec.def file.
parent 16a37e1e
......@@ -105,7 +105,7 @@ prog_manext = 1
api_manext = 3w
conf_manext = 5
CLEAN_FILES = *.o *.a *.so *.ln *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
*.flc *.spec.c *.spec.def *.dbg.c *.tab.c *.tab.h @LEX_OUTPUT_ROOT@.c core
*.flc *.spec.c *.dbg.c *.tab.c *.tab.h @LEX_OUTPUT_ROOT@.c core
OBJS = $(C_SRCS:.c=.o) $(EXTRA_OBJS)
......@@ -114,7 +114,7 @@ LINTS = $(C_SRCS:.c=.ln)
# Implicit rules
.SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.c .spec.def .idl .tlb .h .ok .sfd .ttf
.SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.c .idl .tlb .h .ok .sfd .ttf
.c.o:
$(CC) -c $(ALLCFLAGS) -o $@ $<
......@@ -134,9 +134,6 @@ LINTS = $(C_SRCS:.c=.ln)
.spec.spec.c:
$(WINEBUILD) $(DEFS) --dll -o $@ --main-module $(MODULE) --export $<
.spec.spec.def:
$(WINEBUILD) -w $(DEFS) --def -o $@ --export $<
.idl.h:
$(WIDL) $(IDLFLAGS) -h -H $@ $<
......
......@@ -12,14 +12,15 @@
DLLDEFS = @DLLDEFS@
DLLFLAGS = @DLLFLAGS@
DLLEXT = @DLLEXT@
IMPLIBEXT = @IMPLIBEXT@
DEFS = -D__WINESRC__ $(DLLDEFS) $(EXTRADEFS)
MAINSPEC = $(MODULE:%.dll=%).spec
SPEC_DEF = $(MAINSPEC).def
BASEMODULE = $(MODULE:%.dll=%)
MAINSPEC = $(BASEMODULE).spec
SPEC_DEF = lib$(BASEMODULE).def
WIN16_FILES = $(SPEC_SRCS16:.spec=.spec.o) $(C_SRCS16:.c=.o) $(EXTRA_OBJS16)
ALL_OBJS = @WIN16_FILES@ $(OBJS) $(MODULE).dbg.o $(RC_SRCS:.rc=.res)
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
ALL_IMPORTS = $(DELAYIMPORTS) $(IMPORTS)
IMPORTLIBS = $(ALL_IMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT))
all: $(MODULE)$(DLLEXT) $(SUBDIRS)
......@@ -27,15 +28,19 @@ all: $(MODULE)$(DLLEXT) $(SUBDIRS)
# Rules for .so files
$(MODULE).so: $(MAINSPEC) $(ALL_OBJS) $(IMPORTLIBS) Makefile.in
$(MODULE).so: $(MAINSPEC) $(ALL_OBJS) Makefile.in
$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild -shared $(SRCDIR)/$(MAINSPEC) $(ALL_OBJS) $(SUBSYSTEM:%=-Wb,--subsystem,%) -o $@ -L$(DLLDIR) $(ALL_IMPORTS:%=-l%) $(DELAYIMPORTS:%=-Wb,-d%) $(ALL_LIBS)
$(SPEC_DEF): $(MAINSPEC)
$(WINEBUILD) -w --def -o $@ --export $(SRCDIR)/$(MAINSPEC)
# Rules for .dll files
$(MODULE): $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(SPEC_DEF) $(IMPORTLIBS) Makefile.in
$(MODULE): $(RCOBJS) $(OBJS) $(MODULE).dbg.o $(SPEC_DEF) Makefile.in
$(DLLWRAP) -k --def $(SPEC_DEF) -o $@ $(RCOBJS) $(OBJS) $(MODULE).dbg.o -L$(DLLDIR) $(ALL_IMPORTS:%=-l%) $(ALL_LIBS)
$(SPEC_DEF): $(WINEBUILD)
lib$(BASEMODULE).a: $(SPEC_DEF)
$(DLLTOOL) -k -l $@ -d $(SPEC_DEF)
# Rules for checking that no imports are missing
......@@ -56,7 +61,7 @@ crosstest:: $(SUBDIRS:%=%/__crosstest__)
# Rule to explicitly generate the .spec.c for debugging
$(MAINSPEC).c: $(MAINSPEC) $(ALL_OBJS) $(IMPORTLIBS) $(WINEBUILD)
$(MAINSPEC).c: $(MAINSPEC) $(ALL_OBJS)
$(WINEBUILD) $(DEFS) $(DLLFLAGS) --dll -o $@ --export $(SRCDIR)/$(MAINSPEC) $(SUBSYSTEM:%=--subsystem %) $(ALL_OBJS) -L$(DLLDIR) $(ALL_IMPORTS:%=-l%) $(DELAYIMPORTS:%=-d%)
# Rules for auto documentation
......@@ -99,6 +104,9 @@ uninstall:: $(ALL_SPECS16:%=_uninstall_/%)
# Misc. rules
$(SPEC_SRCS16:.spec=.spec.c): $(WINEBUILD)
clean::
$(RM) $(SPEC_DEF)
$(SPEC_DEF) $(SPEC_SRCS16:.spec=.spec.c): $(WINEBUILD)
# End of global dll rules
......@@ -23,7 +23,6 @@ C_SRCS = $(CTESTS)
EXTRA_SRCS = $(TESTLIST)
EXTRA_OBJS = $(TESTLIST:.c=.o)
ALL_LIBS = $(IMPORTS:%=-l%) $(EXTRALIBS) $(LDFLAGS) $(LIBS)
IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(IMPLIBEXT))
CROSSTEST = $(TESTDLL:%.dll=%)_crosstest.exe
CROSSOBJS = $(C_SRCS:.c=.cross.o) $(RC_SRCS:.rc=.res.cross.o) $(TESTLIST:.c=.cross.o)
......@@ -36,7 +35,7 @@ all: $(TESTPROGRAM)
# Rules for .so main module
$(MODULE).so: $(OBJS) $(RC_SRCS:.rc=.res) $(IMPORTLIBS) Makefile.in
$(MODULE).so: $(OBJS) $(RC_SRCS:.rc=.res) Makefile.in
$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild -mconsole $(OBJS) $(RC_SRCS:.rc=.res) -o $@ $(LIBPORT) -L$(DLLDIR) -L$(LIBDIR) $(ALL_LIBS)
# Rules for .exe main module
......
Makefile
advapi32.dll.dbg.c
advapi32.spec.def
libadvapi32.def
Makefile
advpack.dll.dbg.c
advpack.spec.def
libadvpack.def
Makefile
amstream.dll.dbg.c
amstream.spec.def
libamstream.def
version.res
Makefile
atl.dll.dbg.c
atl.spec.def
atliface.h
libatl.def
rsrc.res
Makefile
avicap32.dll.dbg.c
avicap32.spec.def
libavicap32.def
Makefile
avifil32.dll.dbg.c
avifil32.spec.def
avifile.spec.c
libavifil32.def
rsrc.res
Makefile
cabinet.dll.dbg.c
cabinet.res
cabinet.spec.def
libcabinet.def
Makefile
capi2032.dll.dbg.c
capi2032.spec.def
libcapi2032.def
......@@ -13,7 +13,6 @@ c8.bmp
c9.bmp
cards.dll.dbg.c
cards.res
cards.spec.def
cj.bmp
ck.bmp
cq.bmp
......@@ -44,6 +43,7 @@ h9.bmp
hj.bmp
hk.bmp
hq.bmp
libcards.def
s1.bmp
s10.bmp
s2.bmp
......
Makefile
cfgmgr32.dll.dbg.c
cfgmgr32.spec.def
libcfgmgr32.def
Makefile
comcat.dll.dbg.c
comcat.spec.def
libcomcat.def
version.res
Makefile
comctl32.dll
comctl32.dll.dbg.c
comctl32.spec.def
idb_hist_large.bmp
idb_hist_small.bmp
idb_std_large.bmp
......@@ -17,4 +16,5 @@ idi_tt_error_sm.ico
idi_tt_info_sm.ico
idi_tt_warn_sm.ico
idt_check.bmp
libcomctl32.def
rsrc.res
......@@ -2,13 +2,13 @@
Makefile
cdrom.ico
comdlg32.dll.dbg.c
comdlg32.spec.def
commdlg.spec.c
floppy.ico
folder.ico
folder2.ico
fontpics.bmp
hdisk.ico
libcomdlg32.def
network.ico
pd32_collate.ico
pd32_landscape.ico
......
Makefile
crtdll.dll.dbg.c
crtdll.spec.def
libcrtdll.def
Makefile
crypt32.dll.dbg.c
crypt32.spec.def
libcrypt32.def
Makefile
cryptdll.dll.dbg.c
cryptdll.spec.def
libcryptdll.def
Makefile
ctl3d.spec.c
ctl3d32.dll.dbg.c
ctl3d32.spec.def
ctl3dv2.spec.c
libctl3d32.def
Makefile
d3d8.dll.dbg.c
d3d8.spec.def
libd3d8.def
version.res
Makefile
d3d9.dll.dbg.c
d3d9.spec.def
libd3d9.def
version.res
Makefile
d3dim.dll.dbg.c
d3dim.spec.def
libd3dim.def
version.res
Makefile
d3drm.dll.dbg.c
d3drm.spec.def
libd3drm.def
version.res
Makefile
d3dx8.dll.dbg.c
d3dx8.spec.def
libd3dx8.def
Makefile
d3dxof.dll.dbg.c
d3dxof.spec.def
libd3dxof.def
version.res
Makefile
dbghelp.dll.dbg.c
dbghelp.spec.def
libdbghelp.def
Makefile
dciman32.dll.dbg.c
dciman32.spec.def
libdciman32.def
Makefile
ddraw.dll.dbg.c
ddraw.spec.def
libddraw.def
version.res
Makefile
devenum.dll.dbg.c
devenum.res
devenum.spec.def
libdevenum.def
Makefile
dinput.dll.dbg.c
dinput.spec.def
libdinput.def
version.res
Makefile
dinput8.dll.dbg.c
dinput8.spec.def
libdinput8.def
version.res
Makefile
dmband.dll.dbg.c
dmband.spec.def
libdmband.def
version.res
Makefile
dmcompos.dll.dbg.c
dmcompos.spec.def
libdmcompos.def
version.res
Makefile
dmime.dll.dbg.c
dmime.spec.def
libdmime.def
version.res
Makefile
dmloader.dll.dbg.c
dmloader.spec.def
libdmloader.def
version.res
Makefile
dmscript.dll.dbg.c
dmscript.spec.def
libdmscript.def
version.res
Makefile
dmstyle.dll.dbg.c
dmstyle.spec.def
libdmstyle.def
version.res
Makefile
dmsynth.dll.dbg.c
dmsynth.spec.def
libdmsynth.def
version.res
Makefile
dmusic.dll.dbg.c
dmusic.spec.def
libdmusic.def
version.res
Makefile
dmusic32.dll.dbg.c
dmusic32.spec.def
libdmusic32.def
version.res
Makefile
dplay.dll.dbg.c
dplay.spec.def
libdplay.def
version.res
Makefile
dplayx.dll.dbg.c
dplayx.spec.def
libdplayx.def
version.res
Makefile
dpnet.dll.dbg.c
dpnet.spec.def
libdpnet.def
version.res
Makefile
dpnhpast.dll.dbg.c
dpnhpast.spec.def
libdpnhpast.def
version.res
Makefile
dsound.dll.dbg.c
dsound.spec.def
libdsound.def
version.res
Makefile
dswave.dll.dbg.c
dswave.spec.def
libdswave.def
version.res
Makefile
dxdiagn.dll.dbg.c
dxdiagn.spec.def
libdxdiagn.def
version.res
......@@ -2,7 +2,7 @@ Makefile
dispdib.spec.c
gdi.exe.spec.c
gdi32.dll.dbg.c
gdi32.spec.def
libgdi32.def
version.res
version16.res
wing.spec.c
Makefile
glu32.dll.dbg.c
glu32.spec.def
libglu32.def
Makefile
glut32.dll.dbg.c
glut32.spec.def
libglut32.def
Makefile
iccvid.dll.dbg.c
iccvid.spec.def
libiccvid.def
Makefile
icmp.dll.dbg.c
icmp.spec.def
libicmp.def
Makefile
imagehlp.dll.dbg.c
imagehlp.spec.def
libimagehlp.def
Makefile
imm.spec.c
imm32.dll.dbg.c
imm32.spec.def
libimm32.def
Makefile
iphlpapi.dll.dbg.c
iphlpapi.spec.def
libiphlpapi.def
Makefile
itss.dll.dbg.c
itss.h
itss.spec.def
libitss.def
......@@ -2,8 +2,8 @@ Makefile
comm.drv.spec.c
kernel.res
kernel32.dll.dbg.c
kernel32.spec.def
krnl386.exe.spec.c
libkernel32.def
relay16asm.s
stress.spec.c
system.drv.spec.c
......
Makefile
liblz32.def
lz32.dll.dbg.c
lz32.spec.def
lzexpand.spec.c
......@@ -251,19 +251,15 @@ foreach my $mod (sort @implibs)
my $spec = $mod;
$spec =~ s/\.dll$//;
$def =~ s/\.(dll|drv)$//;
printf NEWMAKE "lib%s.def: %s/%s.spec.def\n", $def, $dir, $spec;
printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s/%s.spec.def \$@\n", $dir, $spec;
printf NEWMAKE "lib%s.a: %s/%s.spec.def\n", $def, $dir, $spec;
printf NEWMAKE "\t\$(DLLTOOL) -k -l \$@ -d %s/%s.spec.def\n\n", $dir, $spec;
printf NEWMAKE "lib%s.def: %s/lib%s.def\n", $def, $dir, $spec;
printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s/lib%s.def \$@\n", $dir, $spec;
printf NEWMAKE "lib%s.a: %s/lib%s.a\n", $def, $dir, $spec;
printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s/lib%s.a \$@\n", $dir, $spec;
printf NEWMAKE "%s/lib%s.def: %s/%s.spec \$(WINEBUILD)\n", $dir, $spec, $dir, $spec;
printf NEWMAKE "\t\$(WINEBUILD) -w --def -o \$@ --export \$(SRCDIR)/%s/%s.spec\n", $dir, $spec;
printf NEWMAKE "%s/lib%s.a: %s/lib%s.def\n", $dir, $spec, $dir, $spec;
printf NEWMAKE "\t\$(DLLTOOL) -k -l \$@ -d %s/lib%s.def\n\n", $dir, $spec;
}
foreach my $mod (sort @implibs)
{
my $dir = $directories{$mod};
my $spec = $mod;
$spec =~ s/\.dll$//;
printf NEWMAKE "%s/%s.spec.def: \$(WINEBUILD)\n", $dir, $spec;
}
print NEWMAKE <<EOF;
......
Makefile
libmapi32.def
mapi32.dll
mapi32.dll.dbg.c
mapi32.spec.def
Makefile
libmlang.def
mlang.dll.dbg.c
mlang.spec.def
Makefile
libmpr.def
mpr.dll.dbg.c
mpr.res
mpr.spec.def
Makefile
libmsacm32.def
msacm.res
msacm.spec.c
msacm32.dll.dbg.c
msacm32.spec.def
Makefile
libmscms.def
mscms.dll.dbg.c
mscms.spec.def
version.res
Makefile
libmsdmo.def
msdmo.dll.dbg.c
msdmo.spec.def
rsrc.res
Makefile
libmshtml.def
mshtml.dll.dbg.c
mshtml.spec.def
Makefile
cond.tab.c
cond.tab.h
libmsi.def
msi.dll.dbg.c
msi.res
msi.spec.def
sql.tab.c
sql.tab.h
Makefile
libmsimg32.def
msimg32.dll.dbg.c
msimg32.spec.def
Makefile
libmsnet32.def
msnet32.dll.dbg.c
msnet32.spec.def
Makefile
libmsrle32.def
msrle32.dll.dbg.c
msrle32.spec.def
rsrc.res
Makefile
libmsvcrt.def
msvcrt.dll.dbg.c
msvcrt.spec.def
Makefile
libmsvcrt20.def
msvcrt20.dll.dbg.c
msvcrt20.spec.def
Makefile
libmsvcrt40.def
msvcrt40.dll.dbg.c
msvcrt40.spec.def
Makefile
libmsvcrtd.def
msvcrtd.dll.dbg.c
msvcrtd.spec.def
Makefile
libmsvidc32.def
msvidc32.dll.dbg.c
msvidc32.spec.def
Makefile
libmsvfw32.def
msvfw32.dll.dbg.c
msvfw32.spec.def
msvideo.spec.c
Makefile
libmswsock.def
mswsock.dll.dbg.c
mswsock.spec.def
version.res
Makefile
libnetapi32.def
netapi32.dll.dbg.c
netapi32.spec.def
Makefile
libnewdev.def
newdev.dll.dbg.c
newdev.spec.def
Makefile
libntdll.def
ntdll.dll.dbg.c
ntdll.spec.def
relay32.s
Makefile
libodbc32.def
odbc32.dll.dbg.c
odbc32.spec.def
......@@ -4,6 +4,7 @@ dcom.h
drag_copy.cur
drag_link.cur
drag_move.cur
libole32.def
nodrop.cur
ole2.spec.c
ole2conv.spec.c
......@@ -11,6 +12,5 @@ ole2nls.spec.c
ole2prox.spec.c
ole2thk.spec.c
ole32.dll.dbg.c
ole32.spec.def
ole32res.res
storage.spec.c
Makefile
liboleacc.def
oleacc.dll.dbg.c
oleacc.spec.def
Makefile
liboleaut32.def
ole2disp.spec.c
oleaut32.dll.dbg.c
oleaut32.res
oleaut32.spec.def
typelib.spec.c
Makefile
libolecli32.def
olecli.spec.c
olecli32.dll.dbg.c
olecli32.spec.def
Makefile
liboledlg.def
oledlg.dll.dbg.c
oledlg.spec.def
rsrc.res
Makefile
libolepro32.def
olepro32.dll.dbg.c
olepro32.spec.def
Makefile
libolesvr32.def
olesvr.spec.c
olesvr32.dll.dbg.c
olesvr32.spec.def
Makefile
libopengl32.def
opengl32.dll.dbg.c
opengl32.spec.def
version.res
Makefile
libpowrprof.def
powrprof.dll.dbg.c
powrprof.spec.def
Makefile
libpsapi.def
psapi.dll.dbg.c
psapi.spec.def
Makefile
libqcap.def
qcap.dll.dbg.c
qcap.spec.def
version.res
Makefile
libquartz.def
quartz.dll.dbg.c
quartz.spec.def
version.res
Makefile
librasapi32.def
rasapi16.spec.c
rasapi32.dll.dbg.c
rasapi32.spec.def
Makefile
libriched20.def
riched20.dll.dbg.c
riched20.spec.def
Makefile
libriched32.def
riched32.dll.dbg.c
riched32.spec.def
Makefile
librpcrt4.def
rpcrt4.dll.dbg.c
rpcrt4.spec.def
Makefile
librsabase.def
rsabase.dll.dbg.c
rsabase.spec.def
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