mirror of
git://source.winehq.org/git/wine.git
synced 2024-08-31 09:24:07 +00:00
68 lines
1.8 KiB
Makefile
68 lines
1.8 KiB
Makefile
# Global rules for building a Winelib program -*-Makefile-*-
|
|
#
|
|
# Each individual makefile should define the following variables:
|
|
# MODULE : name of the main module being built
|
|
# APPMODE : program mode (-mwindows,-mconsole)
|
|
# EXTRALIBS : extra libraries to link in (optional)
|
|
# EXTRADEFS : extra symbol definitions, like -DWINELIB (optional)
|
|
#
|
|
# plus all variables required by the global Make.rules.in
|
|
#
|
|
|
|
DLLDEFS = @DLLDEFS@
|
|
DLLFLAGS = @DLLFLAGS@
|
|
DEFS = $(DLLDEFS) $(EXTRADEFS)
|
|
ALL_IMPORTS = $(DELAYIMPORTS) $(IMPORTS)
|
|
ALL_LIBS = $(ALL_IMPORTS:%=-l%) $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
|
|
DLL_LDPATH = -L$(DLLDIR) $(ALL_IMPORTS:%=-L$(DLLDIR)/%)
|
|
BASEMODULE = $(MODULE:.exe=)
|
|
RUNTESTFLAGS= -q -P wine -T $(TOPOBJDIR)
|
|
|
|
@MAKE_RULES@
|
|
|
|
all: $(MODULE)$(DLLEXT) $(BASEMODULE)$(EXEEXT)
|
|
|
|
# Rules for .so main module
|
|
|
|
$(MODULE).so: $(OBJS) $(RC_SRCS:.rc=.res) Makefile.in
|
|
$(WINEGCC) -B$(TOOLSDIR)/tools/winebuild $(APPMODE) $(OBJS) $(RC_SRCS:.rc=.res) -o $@ $(DLL_LDPATH) $(ALL_LIBS) $(DELAYIMPORTS:%=-Wb,-d%)
|
|
|
|
$(BASEMODULE): $(WINEWRAPPER)
|
|
$(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
|
|
|
|
# Rules for .exe main module
|
|
|
|
$(MODULE): $(OBJS) $(RCOBJS) Makefile.in
|
|
$(CC) $(APPMODE) $(OBJS) $(RCOBJS) -o $@ $(ALL_LIBS)
|
|
|
|
# Rules for testing
|
|
|
|
check test:: $(SUBDIRS:%=%/__test__)
|
|
|
|
$(TESTRESULTS): $(MODULE)$(DLLEXT)
|
|
|
|
# Rules for installation
|
|
|
|
.PHONY: install_prog install_prog.so uninstall_prog uninstall_prog.so
|
|
|
|
install_prog.so: $(MODULE).so dummy
|
|
$(MKINSTALLDIRS) $(dlldir)
|
|
$(INSTALL_PROGRAM) $(MODULE).so $(dlldir)/$(MODULE).so
|
|
|
|
install_prog: $(MODULE) dummy
|
|
$(MKINSTALLDIRS) $(bindir)
|
|
$(INSTALL_PROGRAM) $(MODULE) $(bindir)/$(MODULE)
|
|
|
|
uninstall_prog.so: dummy
|
|
$(RM) $(dlldir)/$(MODULE).so
|
|
|
|
uninstall_prog: dummy
|
|
$(RM) $(bindir)/$(MODULE)
|
|
|
|
install:: install_prog$(DLLEXT)
|
|
|
|
uninstall:: uninstall_prog$(DLLEXT)
|
|
|
|
clean::
|
|
$(RM) $(BASEMODULE) $(MODULE)
|