1 # Global rules for building a Winelib program -*-Makefile-*-
3 # Each individual makefile should define the following variables:
4 # MODULE : name of the main module being built
5 # EXTRALIBS : extra libraries to link in (optional)
6 # EXTRADEFS : extra symbol definitions, like -DWINELIB (optional)
8 # plus all variables required by the global Make.rules.in
11 DEFS = @DLLFLAGS@ -DSTRICT -DNONAMELESSUNION -DNONAMELESSSTRUCT $(EXTRADEFS)
12 LDDLLFLAGS = @LDDLLFLAGS@
13 ALL_OBJS = $(MODULE).spec.o $(OBJS)
14 ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
15 SYMBOLFILE = $(MODULE).tmp.o
16 TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
22 # Rules for main module
24 $(MODULE).so: $(ALL_OBJS) Makefile.in
25 $(LDSHARED) $(LDDLLFLAGS) $(ALL_OBJS) -o $@ $(ALL_LIBS)
27 $(MODULE): $(MODULE).so
28 $(RM) $(MODULE) && $(LN_S) $(TOPOBJDIR)/wine $(MODULE)
30 # Rules for checking that no imports are missing
32 checklink:: $(MODULE).so
33 $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(MODULE).so && $(RM) checklink
37 $(TESTRESULTS): $(MODULE).so
39 # Rules for debug channels
42 $(TOPSRCDIR)/tools/make_debug $(MODULE).spec $(C_SRCS)
44 # Rules for installation
46 install:: $(MODULE).so
47 $(MKINSTALLDIRS) $(bindir)
48 $(INSTALL_PROGRAM) $(MODULE).so $(bindir)/$(MODULE).so
49 cd $(bindir) && $(RM) $(MODULE) && $(LN_S) wine $(MODULE)
52 $(RM) $(bindir)/$(MODULE) $(bindir)/$(MODULE).so