2000-11-10 23:35:20 +00:00
|
|
|
# Global rules for building a Winelib program -*-Makefile-*-
|
|
|
|
#
|
|
|
|
# Each individual makefile should define the following variables:
|
|
|
|
# MODULE : name of the main module being built
|
2005-03-05 10:47:42 +00:00
|
|
|
# APPMODE : program mode (-mwindows,-mconsole)
|
2000-11-10 23:35:20 +00:00
|
|
|
# EXTRALIBS : extra libraries to link in (optional)
|
|
|
|
# EXTRADEFS : extra symbol definitions, like -DWINELIB (optional)
|
|
|
|
#
|
|
|
|
# plus all variables required by the global Make.rules.in
|
|
|
|
#
|
|
|
|
|
2003-09-24 19:01:44 +00:00
|
|
|
DLLFLAGS = @DLLFLAGS@
|
2006-04-17 09:17:18 +00:00
|
|
|
DEFS = $(EXTRADEFS)
|
2006-09-09 20:28:53 +00:00
|
|
|
ALL_LIBS = $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
|
2002-05-21 19:42:29 +00:00
|
|
|
BASEMODULE = $(MODULE:.exe=)
|
2004-03-02 21:00:00 +00:00
|
|
|
RUNTESTFLAGS= -q -P wine -T $(TOPOBJDIR)
|
2006-08-07 15:48:18 +00:00
|
|
|
INSTALLDIRS = $(DESTDIR)$(bindir) $(DESTDIR)$(dlldir) $(DESTDIR)$(mandir)/man$(prog_manext)
|
2000-11-10 23:35:20 +00:00
|
|
|
|
|
|
|
@MAKE_RULES@
|
|
|
|
|
2002-05-21 19:42:29 +00:00
|
|
|
all: $(MODULE)$(DLLEXT) $(BASEMODULE)$(EXEEXT)
|
2002-05-12 03:16:39 +00:00
|
|
|
|
|
|
|
# Rules for .so main module
|
2000-11-10 23:35:20 +00:00
|
|
|
|
2005-09-28 18:34:00 +00:00
|
|
|
$(MODULE).so: $(OBJS) $(RC_SRCS:.rc=.res) Makefile.in
|
2006-08-16 11:25:08 +00:00
|
|
|
$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild $(APPMODE) $(OBJS) $(RC_SRCS:.rc=.res) -o $@ $(ALL_LIBS) $(DELAYIMPORTS:%=-Wb,-d%)
|
2000-11-10 23:35:20 +00:00
|
|
|
|
2002-05-22 21:32:49 +00:00
|
|
|
$(BASEMODULE): $(WINEWRAPPER)
|
|
|
|
$(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
|
2000-11-10 23:35:20 +00:00
|
|
|
|
2002-05-12 03:16:39 +00:00
|
|
|
# Rules for .exe main module
|
|
|
|
|
2005-09-28 18:34:00 +00:00
|
|
|
$(MODULE): $(OBJS) $(RCOBJS) Makefile.in
|
2008-05-26 17:26:06 +00:00
|
|
|
$(CC) $(APPMODE) $(OBJS) $(RCOBJS) -o $@ -L$(DLLDIR) $(IMPORTS:%=-L$(DLLDIR)/%) $(DELAYIMPORTS:%=-L$(DLLDIR)/%) $(LIBWINE) $(ALL_LIBS)
|
2002-05-12 03:16:39 +00:00
|
|
|
|
2002-01-10 03:30:21 +00:00
|
|
|
# Rules for testing
|
|
|
|
|
2002-08-09 01:22:40 +00:00
|
|
|
check test:: $(SUBDIRS:%=%/__test__)
|
|
|
|
|
|
|
|
$(TESTRESULTS): $(MODULE)$(DLLEXT)
|
2002-01-10 03:30:21 +00:00
|
|
|
|
2000-11-10 23:35:20 +00:00
|
|
|
# Rules for installation
|
|
|
|
|
2002-05-22 21:32:49 +00:00
|
|
|
.PHONY: install_prog install_prog.so uninstall_prog uninstall_prog.so
|
2002-05-12 03:16:39 +00:00
|
|
|
|
2006-08-07 15:48:18 +00:00
|
|
|
install_prog.so: $(MODULE).so $(DESTDIR)$(dlldir) dummy
|
2006-02-14 12:51:38 +00:00
|
|
|
$(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(MODULE).so
|
2000-11-10 23:35:20 +00:00
|
|
|
|
2006-08-07 15:48:18 +00:00
|
|
|
install_prog: $(MODULE) $(DESTDIR)$(bindir) dummy
|
2006-02-14 12:51:38 +00:00
|
|
|
$(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(bindir)/$(MODULE)
|
2002-05-12 03:16:39 +00:00
|
|
|
|
2002-05-22 21:32:49 +00:00
|
|
|
uninstall_prog.so: dummy
|
2006-02-14 12:51:38 +00:00
|
|
|
$(RM) $(DESTDIR)$(dlldir)/$(MODULE).so
|
2002-05-22 21:32:49 +00:00
|
|
|
|
|
|
|
uninstall_prog: dummy
|
2006-02-14 12:51:38 +00:00
|
|
|
$(RM) $(DESTDIR)$(bindir)/$(MODULE)
|
2002-05-22 21:32:49 +00:00
|
|
|
|
2002-05-21 19:42:29 +00:00
|
|
|
install:: install_prog$(DLLEXT)
|
2002-05-12 03:16:39 +00:00
|
|
|
|
2002-05-22 21:32:49 +00:00
|
|
|
uninstall:: uninstall_prog$(DLLEXT)
|
2000-11-10 23:35:20 +00:00
|
|
|
|
|
|
|
clean::
|
2002-05-21 19:42:29 +00:00
|
|
|
$(RM) $(BASEMODULE) $(MODULE)
|