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 DEFS = -DWINE_STRICT_PROTOTYPES -DWINE_NO_UNICODE_MACROS $(EXTRADEFS)
14 ALL_LIBS = $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(EXTRALIBS) -lwine $(LIBPORT) $(LDFLAGS) $(LIBS)
15 INSTALLDIRS = $(DESTDIR)$(bindir) $(DESTDIR)$(dlldir) $(DESTDIR)$(fakedlldir) $(DESTDIR)$(mandir)/man$(prog_manext)
19 all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT)
21 $(MODULE) $(MODULE).so $(MODULE).fake: $(OBJS) Makefile.in
22 $(WINEGCC) $(APPMODE) $(OBJS) -o $@ $(ALL_LIBS) $(DELAYIMPORTS:%=-Wb,-d%)
24 # Rules for installation
26 .PHONY: install_prog install_prog.so install_prog.fake
28 install_prog.so: $(MODULE).so $(DESTDIR)$(dlldir) dummy
29 $(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(MODULE).so
31 install_prog.fake: $(MODULE).fake $(DESTDIR)$(fakedlldir) dummy
32 $(INSTALL_DATA) $(MODULE).fake $(DESTDIR)$(fakedlldir)/$(MODULE)
34 install_prog: $(MODULE) $(DESTDIR)$(bindir) dummy
35 $(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(bindir)/$(MODULE)
37 install install-lib:: install_prog$(DLLEXT) install_prog$(FAKEEXT)
40 $(RM) $(DESTDIR)$(bindir)/$(MODULE) $(DESTDIR)$(dlldir)/$(MODULE)$(DLLEXT) $(DESTDIR)$(fakedlldir)/$(MODULE)