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 # APPMODE : program mode (cui,gui,cuiw,guiw)
6 # EXTRALIBS : extra libraries to link in (optional)
7 # EXTRADEFS : extra symbol definitions, like -DWINELIB (optional)
9 # plus all variables required by the global Make.rules.in
14 DEFS = $(DLLDEFS) $(EXTRADEFS)
15 ALL_OBJS = $(OBJS) $(MODULE).dbg.o
16 ALL_LIBS = $(IMPORTS:%=-l%) $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
17 BASEMODULE = $(MODULE:.exe=)
18 TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
19 RUNTESTFLAGS= -q -P wine -T $(TOPOBJDIR)
23 all: $(MODULE)$(DLLEXT) $(BASEMODULE)$(EXEEXT)
25 # Rules for .so main module
27 $(MODULE).so: $(ALL_OBJS) $(RC_SRCS:.rc=.res) Makefile.in
28 $(WINEGCC) -B$(TOOLSDIR)/tools/winebuild $(APPMODE) $(ALL_OBJS) $(RC_SRCS:.rc=.res) -o $@ -L$(DLLDIR) $(DELAYIMPORTS:%=-Wb,-d%) $(ALL_LIBS)
30 $(BASEMODULE): $(WINEWRAPPER)
31 $(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
33 # Rules for .exe main module
35 $(MODULE): $(ALL_OBJS) $(RCOBJS) Makefile.in
36 $(CC) $(APPMODE) $(ALL_OBJS) $(RCOBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(ALL_LIBS)
40 check test:: $(SUBDIRS:%=%/__test__)
42 $(TESTRESULTS): $(MODULE)$(DLLEXT)
44 # Rules for installation
46 .PHONY: install_prog install_prog.so uninstall_prog uninstall_prog.so
48 install_prog.so: $(MODULE).so dummy
49 $(MKINSTALLDIRS) $(dlldir)
50 $(INSTALL_PROGRAM) $(MODULE).so $(dlldir)/$(MODULE).so
52 install_prog: $(MODULE) dummy
53 $(MKINSTALLDIRS) $(bindir)
54 $(INSTALL_PROGRAM) $(MODULE) $(bindir)/$(MODULE)
56 uninstall_prog.so: dummy
57 $(RM) $(dlldir)/$(MODULE).so
60 $(RM) $(bindir)/$(MODULE)
62 install:: install_prog$(DLLEXT)
64 uninstall:: uninstall_prog$(DLLEXT)
67 $(RM) $(BASEMODULE) $(MODULE)