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_LIBS = $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(EXTRALIBS) -lwine $(LIBPORT) $(LDFLAGS) $(LIBS)
15 RUNTESTFLAGS= -q -P wine -T $(TOPOBJDIR)
16 INSTALLDIRS = $(DESTDIR)$(bindir) $(DESTDIR)$(dlldir) $(DESTDIR)$(fakedlldir) $(DESTDIR)$(mandir)/man$(prog_manext)
20 all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT)
22 $(MODULE) $(MODULE).so $(MODULE).fake: $(OBJS) Makefile.in
23 $(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(ALL_LIBS) $(DELAYIMPORTS:%=-Wb,-d%)
27 check test:: $(SUBDIRS:%=%/__test__) dummy
29 $(TESTRESULTS): $(MODULE)$(DLLEXT)
31 # Rules for installation
33 .PHONY: install_prog install_prog.so install_prog.fake
35 install_prog.so: $(MODULE).so $(DESTDIR)$(dlldir) dummy
36 $(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(MODULE).so
38 install_prog.fake: $(MODULE).fake $(DESTDIR)$(fakedlldir) dummy
39 $(INSTALL_DATA) $(MODULE).fake $(DESTDIR)$(fakedlldir)/$(MODULE)
41 install_prog: $(MODULE) $(DESTDIR)$(bindir) dummy
42 $(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(bindir)/$(MODULE)
44 install install-lib:: install_prog$(DLLEXT) install_prog$(FAKEEXT)
47 $(RM) $(DESTDIR)$(bindir)/$(MODULE) $(DESTDIR)$(dlldir)/$(MODULE)$(DLLEXT) $(DESTDIR)$(fakedlldir)/$(MODULE)