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
|
2002-05-11 23:06:32 +00:00
|
|
|
# APPMODE : program mode (cui,gui,cuiw,guiw)
|
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-01-07 23:11:12 +00:00
|
|
|
DEFS = @DLLFLAGS@ $(EXTRADEFS)
|
2002-05-09 00:05:48 +00:00
|
|
|
LDDLLFLAGS = @LDDLLFLAGS@
|
2002-05-14 20:54:58 +00:00
|
|
|
ALL_OBJS = $(OBJS) $(MODULE).dbg.o
|
2003-06-13 23:26:01 +00:00
|
|
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
|
2002-05-21 19:42:29 +00:00
|
|
|
BASEMODULE = $(MODULE:.exe=)
|
2002-05-09 00:05:48 +00:00
|
|
|
TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
|
2002-08-09 01:22:40 +00:00
|
|
|
RUNTESTFLAGS= -q -P wine -T $(TOPOBJDIR) $(PLTESTPROGRAM:%=-p %)
|
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
|
|
|
|
2002-05-11 23:06:32 +00:00
|
|
|
# Rule for main module spec file
|
|
|
|
|
2002-08-01 18:36:58 +00:00
|
|
|
$(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(ALL_OBJS) $(WINEBUILD)
|
2003-04-21 23:54:05 +00:00
|
|
|
$(WINEBUILD) $(DEFS) -o $@ --exe $(MODULE) $(APPMODE:%=--exe-mode %) $(RC_SRCS:.rc=.res) $(ALL_OBJS) -L$(DLLDIR) $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
|
2002-05-11 23:06:32 +00:00
|
|
|
|
2002-05-12 03:16:39 +00:00
|
|
|
# Rules for .so main module
|
2000-11-10 23:35:20 +00:00
|
|
|
|
2002-05-14 20:54:58 +00:00
|
|
|
$(MODULE).so: $(MODULE).spec.o $(ALL_OBJS) Makefile.in
|
2002-11-21 03:47:45 +00:00
|
|
|
$(LDSHARED) $(LDDLLFLAGS) $(MODULE).spec.o $(ALL_OBJS) -o $@ $(ALL_LIBS) -lc
|
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
|
|
|
|
|
2002-05-21 19:42:29 +00:00
|
|
|
$(MODULE): $(ALL_OBJS) $(RCOBJS) Makefile.in
|
2002-05-14 20:54:58 +00:00
|
|
|
$(CC) $(ALL_OBJS) $(RCOBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(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
|
|
|
|
2002-06-14 23:48:27 +00:00
|
|
|
install_prog.so: $(MODULE).so dummy
|
2002-05-22 21:32:49 +00:00
|
|
|
$(MKINSTALLDIRS) $(dlldir)
|
|
|
|
$(INSTALL_PROGRAM) $(MODULE).so $(dlldir)/$(MODULE).so
|
2000-11-10 23:35:20 +00:00
|
|
|
|
2002-06-14 23:48:27 +00:00
|
|
|
install_prog: $(MODULE) dummy
|
2002-05-12 03:16:39 +00:00
|
|
|
$(MKINSTALLDIRS) $(bindir)
|
2002-05-21 19:42:29 +00:00
|
|
|
$(INSTALL_PROGRAM) $(MODULE) $(bindir)/$(MODULE)
|
2002-05-12 03:16:39 +00:00
|
|
|
|
2002-05-22 21:32:49 +00:00
|
|
|
uninstall_prog.so: dummy
|
|
|
|
$(RM) $(dlldir)/$(MODULE).so
|
|
|
|
|
|
|
|
uninstall_prog: dummy
|
|
|
|
$(RM) $(bindir)/$(MODULE)
|
|
|
|
|
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)
|