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) $(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 # Rules for .so main module
24 $(MODULE).so: $(OBJS) $(RC_SRCS:.rc=.res) Makefile.in
25 $(WINEGCC) $(APPMODE) $(OBJS) $(RC_SRCS:.rc=.res) -o $@ $(ALL_LIBS) $(DELAYIMPORTS:%=-Wb,-d%)
27 # Rules for .exe main module
29 $(MODULE): $(OBJS) $(RCOBJS) Makefile.in
30 $(CC) $(APPMODE) $(OBJS) $(RCOBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-L$(DLLDIR)/%) $(DELAYIMPORTS:%=-L$(DLLDIR)/%) $(LIBWINE) $(ALL_LIBS)
34 check test:: $(SUBDIRS:%=%/__test__)
36 $(TESTRESULTS): $(MODULE)$(DLLEXT)
38 # Rules for installation
40 .PHONY: install_prog install_prog.so uninstall_prog uninstall_prog.so
42 install_prog.so: $(MODULE).so $(DESTDIR)$(dlldir) dummy
43 $(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(MODULE).so
45 install_prog: $(MODULE) $(DESTDIR)$(bindir) dummy
46 $(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(bindir)/$(MODULE)
48 uninstall_prog.so: dummy
49 $(RM) $(DESTDIR)$(dlldir)/$(MODULE).so
52 $(RM) $(DESTDIR)$(bindir)/$(MODULE)
54 install install-lib:: install_prog$(DLLEXT)
56 uninstall:: uninstall_prog$(DLLEXT)