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
13 LDRPATH = @LDDLLRPATH@
15 ALL_IMPORTS = $(DELAYIMPORTS) $(IMPORTS)
16 ALL_LIBS = $(ALL_IMPORTS:%=-l%) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
17 BASEMODULE = $(MODULE:.exe=)
18 RUNTESTFLAGS= -q -P wine -T $(TOPOBJDIR)
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 $@ $(LDRPATH) $(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 dummy
48 $(MKINSTALLDIRS) $(DESTDIR)$(dlldir)
49 $(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(MODULE).so
51 install_prog: $(MODULE) dummy
52 $(MKINSTALLDIRS) $(DESTDIR)$(bindir)
53 $(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(bindir)/$(MODULE)
55 uninstall_prog.so: dummy
56 $(RM) $(DESTDIR)$(dlldir)/$(MODULE).so
59 $(RM) $(DESTDIR)$(bindir)/$(MODULE)
61 install:: install_prog$(DLLEXT)
63 uninstall:: uninstall_prog$(DLLEXT)
66 $(RM) $(BASEMODULE) $(MODULE)