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 (-mwindows,-mconsole)
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_IMPORTS = $(DELAYIMPORTS) $(IMPORTS)
15 ALL_LIBS = $(ALL_IMPORTS:%=-l%) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
16 BASEMODULE = $(MODULE:.exe=)
17 RUNTESTFLAGS= -q -P wine -T $(TOPOBJDIR)
18 INSTALLDIRS = $(DESTDIR)$(bindir) $(DESTDIR)$(dlldir) $(DESTDIR)$(mandir)/man$(prog_manext)
22 all: $(MODULE)$(DLLEXT) $(BASEMODULE)$(EXEEXT)
24 # Rules for .so main module
26 $(MODULE).so: $(OBJS) $(RC_SRCS:.rc=.res) Makefile.in
27 $(WINEGCC) -B$(TOOLSDIR)/tools/winebuild $(APPMODE) $(OBJS) $(RC_SRCS:.rc=.res) -o $@ $(ALL_LIBS) $(DELAYIMPORTS:%=-Wb,-d%)
29 $(BASEMODULE): $(WINEWRAPPER)
30 $(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
32 # Rules for .exe main module
34 $(MODULE): $(OBJS) $(RCOBJS) Makefile.in
35 $(CC) $(APPMODE) $(OBJS) $(RCOBJS) -o $@ $(LIBWINE) $(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 $(DESTDIR)$(dlldir) dummy
48 $(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(MODULE).so
50 install_prog: $(MODULE) $(DESTDIR)$(bindir) dummy
51 $(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(bindir)/$(MODULE)
53 uninstall_prog.so: dummy
54 $(RM) $(DESTDIR)$(dlldir)/$(MODULE).so
57 $(RM) $(DESTDIR)$(bindir)/$(MODULE)
59 install:: install_prog$(DLLEXT)
61 uninstall:: uninstall_prog$(DLLEXT)
64 $(RM) $(BASEMODULE) $(MODULE)