Pass the main exe name in the CREATE_PROCESS debug event.
[wine.git] / dlls / Makedll.rules.in
bloba9331c8d8997c04c7fc147efb8c3e57908bd7ee2
1 # Global rules for building dlls     -*-Makefile-*-
3 # Each individual makefile should define the following variables:
4 # MODULE       : name of the main module being built
5 # SOVERSION    : version of the .so file
6 # ALTNAMES     : alternate names for this dll (optional)
7 # IMPORTS      : dlls to import (optional)
8 # EXTRALIBS    : extra libraries to link in (optional)
10 # plus all variables required by the global Make.rules.in
13 DEFS       = @DLLFLAGS@ -D__WINE__
14 LIBEXT     = @LIBEXT@
15 LDSHARED   = @LDSHARED@
16 SONAME     = lib$(MODULE).so
17 IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
18 ALLNAMES   = lib$(MODULE).so $(ALTNAMES:%=lib%.so)
20 all: lib$(MODULE).$(LIBEXT) $(ALTNAMES:%=lib%.$(LIBEXT))
22 @MAKE_RULES@
24 # Rules for .so files
26 lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
27         $(LDSHARED) $(OBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-l%) $(EXTRALIBS)
29 $(ALLNAMES): lib$(MODULE).so.$(SOVERSION)
30         $(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
32 # Rules for .a files
34 lib$(MODULE).a: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
35         $(RM) $@
36         $(AR) $@ $(OBJS)
37         $(RANLIB) $@
39 $(ALTNAMES:%=lib%.a): lib$(MODULE).a
40         $(RM) $@ && $(LN_S) lib$(MODULE).a $@
42 # Rules for checking that no imports are missing
44 IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
46 checklink:: lib$(MODULE).$(LIBEXT) $(IMPORTLIBS)
47         $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) -L$(TOPOBJDIR) -lwine $(EXTRALIBS) $(LIBS) && $(RM) checklink
49 $(IMPORTLIBS): dummy
50         @cd $(DLLDIR) && $(MAKE) `basename $@`
52 # Rules for installation
54 .PHONY: install_so install_a
56 install_so: lib$(MODULE).so.$(SOVERSION)
57         [ -d $(libdir) ] || $(MKDIR) $(libdir)
58         $(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
59         cd $(libdir) && for i in $(ALLNAMES); do $(RM) $$i && $(LN_S) lib$(MODULE).so.$(SOVERSION) $$i; done
61 install_a: lib$(MODULE).a
62         [ -d $(libdir) ] || $(MKDIR) $(libdir)
63         $(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
65 install:: $(LIBEXT:%=install_%)
67 uninstall::
68         cd $(libdir) && $(RM) $(ALLNAMES) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).a
70 clean::
71         $(RM) lib$(MODULE).so.$(SOVERSION)