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)$(mandir)/man$(prog_manext)
20 all: $(MODULE)$(DLLEXT)
22 $(MODULE) $(MODULE).so: $(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 uninstall_prog uninstall_prog.so
35 install_prog.so: $(MODULE).so $(DESTDIR)$(dlldir) dummy
36 $(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(MODULE).so
38 install_prog: $(MODULE) $(DESTDIR)$(bindir) dummy
39 $(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(bindir)/$(MODULE)
41 uninstall_prog.so: dummy
42 $(RM) $(DESTDIR)$(dlldir)/$(MODULE).so
45 $(RM) $(DESTDIR)$(bindir)/$(MODULE)
47 install install-lib:: install_prog$(DLLEXT)
49 uninstall:: uninstall_prog$(DLLEXT)