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 ALL_OBJS = $(OBJS) $(MODULE).dbg.o
15 ALL_LIBS = $(IMPORTS:%=-l%) $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
16 BASEMODULE = $(MODULE:.exe=)
17 TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
18 RUNTESTFLAGS= -q -P wine -T $(TOPOBJDIR)
22 all: $(MODULE)$(DLLEXT) $(BASEMODULE)$(EXEEXT)
24 # Rules for .so main module
26 $(MODULE).so: $(ALL_OBJS) $(RC_SRCS:.rc=.res) Makefile.in
27 $(WINEGCC) -B$(TOOLSDIR)/tools/winebuild $(APPMODE) $(ALL_OBJS) $(RC_SRCS:.rc=.res) -o $@ -L$(DLLDIR) $(DELAYIMPORTS:%=-Wb,-d%) $(ALL_LIBS)
29 $(BASEMODULE): $(WINEWRAPPER)
30 $(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
32 # Rules for .exe main module
34 $(MODULE): $(ALL_OBJS) $(RCOBJS) Makefile.in
35 $(CC) $(APPMODE) $(ALL_OBJS) $(RCOBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(ALL_LIBS)
39 check test:: $(SUBDIRS:%=%/__test__)
41 $(TESTRESULTS): $(MODULE)$(DLLEXT)
43 # Rules for installation
45 .PHONY: install_prog install_prog.so uninstall_prog uninstall_prog.so
47 install_prog.so: $(MODULE).so dummy
48 $(MKINSTALLDIRS) $(dlldir)
49 $(INSTALL_PROGRAM) $(MODULE).so $(dlldir)/$(MODULE).so
51 install_prog: $(MODULE) dummy
52 $(MKINSTALLDIRS) $(bindir)
53 $(INSTALL_PROGRAM) $(MODULE) $(bindir)/$(MODULE)
55 uninstall_prog.so: dummy
56 $(RM) $(dlldir)/$(MODULE).so
59 $(RM) $(bindir)/$(MODULE)
61 install:: install_prog$(DLLEXT)
63 uninstall:: uninstall_prog$(DLLEXT)
66 $(RM) $(BASEMODULE) $(MODULE)