2000-11-11 00:35:20 +01: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 11:47:42 +01:00
|
|
|
# APPMODE : program mode (-mwindows,-mconsole)
|
2000-11-11 00:35:20 +01: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 21:01:44 +02:00
|
|
|
DLLFLAGS = @DLLFLAGS@
|
2006-03-20 22:08:26 +01:00
|
|
|
LDRPATH = @LDDLLRPATH@
|
2006-04-17 11:17:18 +02:00
|
|
|
DEFS = $(EXTRADEFS)
|
2005-05-06 17:54:41 +02:00
|
|
|
ALL_IMPORTS = $(DELAYIMPORTS) $(IMPORTS)
|
2006-07-11 21:32:36 +02:00
|
|
|
ALL_LIBS = $(ALL_IMPORTS:%=-l%) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
|
2002-05-21 21:42:29 +02:00
|
|
|
BASEMODULE = $(MODULE:.exe=)
|
2004-03-02 22:00:00 +01:00
|
|
|
RUNTESTFLAGS= -q -P wine -T $(TOPOBJDIR)
|
2000-11-11 00:35:20 +01:00
|
|
|
|
|
|
|
@MAKE_RULES@
|
|
|
|
|
2002-05-21 21:42:29 +02:00
|
|
|
all: $(MODULE)$(DLLEXT) $(BASEMODULE)$(EXEEXT)
|
2002-05-12 05:16:39 +02:00
|
|
|
|
|
|
|
# Rules for .so main module
|
2000-11-11 00:35:20 +01:00
|
|
|
|
2005-09-28 20:34:00 +02:00
|
|
|
$(MODULE).so: $(OBJS) $(RC_SRCS:.rc=.res) Makefile.in
|
2006-07-11 21:32:36 +02:00
|
|
|
$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild $(APPMODE) $(OBJS) $(RC_SRCS:.rc=.res) -o $@ $(LDRPATH) $(ALL_LIBS) $(DELAYIMPORTS:%=-Wb,-d%)
|
2000-11-11 00:35:20 +01:00
|
|
|
|
2002-05-22 23:32:49 +02:00
|
|
|
$(BASEMODULE): $(WINEWRAPPER)
|
|
|
|
$(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
|
2000-11-11 00:35:20 +01:00
|
|
|
|
2002-05-12 05:16:39 +02:00
|
|
|
# Rules for .exe main module
|
|
|
|
|
2005-09-28 20:34:00 +02:00
|
|
|
$(MODULE): $(OBJS) $(RCOBJS) Makefile.in
|
2006-07-11 21:32:36 +02:00
|
|
|
$(CC) $(APPMODE) $(OBJS) $(RCOBJS) -o $@ $(LIBWINE) $(ALL_LIBS)
|
2002-05-12 05:16:39 +02:00
|
|
|
|
2002-01-10 04:30:21 +01:00
|
|
|
# Rules for testing
|
|
|
|
|
2002-08-09 03:22:40 +02:00
|
|
|
check test:: $(SUBDIRS:%=%/__test__)
|
|
|
|
|
|
|
|
$(TESTRESULTS): $(MODULE)$(DLLEXT)
|
2002-01-10 04:30:21 +01:00
|
|
|
|
2000-11-11 00:35:20 +01:00
|
|
|
# Rules for installation
|
|
|
|
|
2002-05-22 23:32:49 +02:00
|
|
|
.PHONY: install_prog install_prog.so uninstall_prog uninstall_prog.so
|
2002-05-12 05:16:39 +02:00
|
|
|
|
2002-06-15 01:48:27 +02:00
|
|
|
install_prog.so: $(MODULE).so dummy
|
2006-02-14 13:51:38 +01:00
|
|
|
$(MKINSTALLDIRS) $(DESTDIR)$(dlldir)
|
|
|
|
$(INSTALL_PROGRAM) $(MODULE).so $(DESTDIR)$(dlldir)/$(MODULE).so
|
2000-11-11 00:35:20 +01:00
|
|
|
|
2002-06-15 01:48:27 +02:00
|
|
|
install_prog: $(MODULE) dummy
|
2006-02-14 13:51:38 +01:00
|
|
|
$(MKINSTALLDIRS) $(DESTDIR)$(bindir)
|
|
|
|
$(INSTALL_PROGRAM) $(MODULE) $(DESTDIR)$(bindir)/$(MODULE)
|
2002-05-12 05:16:39 +02:00
|
|
|
|
2002-05-22 23:32:49 +02:00
|
|
|
uninstall_prog.so: dummy
|
2006-02-14 13:51:38 +01:00
|
|
|
$(RM) $(DESTDIR)$(dlldir)/$(MODULE).so
|
2002-05-22 23:32:49 +02:00
|
|
|
|
|
|
|
uninstall_prog: dummy
|
2006-02-14 13:51:38 +01:00
|
|
|
$(RM) $(DESTDIR)$(bindir)/$(MODULE)
|
2002-05-22 23:32:49 +02:00
|
|
|
|
2002-05-21 21:42:29 +02:00
|
|
|
install:: install_prog$(DLLEXT)
|
2002-05-12 05:16:39 +02:00
|
|
|
|
2002-05-22 23:32:49 +02:00
|
|
|
uninstall:: uninstall_prog$(DLLEXT)
|
2000-11-11 00:35:20 +01:00
|
|
|
|
|
|
|
clean::
|
2002-05-21 21:42:29 +02:00
|
|
|
$(RM) $(BASEMODULE) $(MODULE)
|