mirror of
git://source.winehq.org/git/wine.git
synced 2024-08-31 14:16:05 +00:00
72 lines
2.2 KiB
Makefile
72 lines
2.2 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 (cui,gui,cuiw,guiw)
|
|
# EXTRALIBS : extra libraries to link in (optional)
|
|
# EXTRADEFS : extra symbol definitions, like -DWINELIB (optional)
|
|
#
|
|
# plus all variables required by the global Make.rules.in
|
|
#
|
|
|
|
DEFS = @DLLFLAGS@ -DSTRICT -DNONAMELESSUNION -DNONAMELESSSTRUCT $(EXTRADEFS)
|
|
LDDLLFLAGS = @LDDLLFLAGS@
|
|
ALL_OBJS = $(OBJS) $(MODULE).dbg.o
|
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
|
|
SYMBOLFILE = $(MODULE).tmp.o
|
|
BASEMODULE = $(MODULE:.exe=)
|
|
TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
|
|
RCOBJS = $(RC_SRCS:.rc=.res.o)
|
|
|
|
@MAKE_RULES@
|
|
|
|
all: $(MODULE)$(DLLEXT) $(BASEMODULE)$(EXEEXT)
|
|
|
|
# Rule for main module spec file
|
|
|
|
$(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
|
|
$(LDPATH) $(WINEBUILD) $(DEFS) $(SYMBOLFILE:%=-sym %) -o $@ -exe $(MODULE) $(APPMODE:%=-m%) $(RC_SRCS:%.rc=-res %.res) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
|
|
|
|
# Rules for .so main module
|
|
|
|
$(MODULE).so: $(MODULE).spec.o $(ALL_OBJS) Makefile.in
|
|
$(LDSHARED) $(LDDLLFLAGS) $(MODULE).spec.o $(ALL_OBJS) -o $@ $(ALL_LIBS)
|
|
|
|
$(BASEMODULE): $(MODULE).so
|
|
$(RM) $(BASEMODULE) && $(LN_S) $(TOPOBJDIR)/wine $(BASEMODULE)
|
|
|
|
# Rules for .exe main module
|
|
|
|
$(MODULE): $(ALL_OBJS) $(RCOBJS) Makefile.in
|
|
$(CC) $(ALL_OBJS) $(RCOBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
|
|
|
|
# Rules for checking that no imports are missing
|
|
|
|
checklink:: $(MODULE).so
|
|
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(MODULE).so && $(RM) checklink
|
|
|
|
# Rules for testing
|
|
|
|
$(TESTRESULTS): $(MODULE)$(DLLEXT)
|
|
|
|
# Rules for installation
|
|
|
|
.PHONY: install_prog install_prog.so
|
|
|
|
install_prog.so:: $(MODULE).so
|
|
$(MKINSTALLDIRS) $(bindir)
|
|
$(INSTALL_PROGRAM) $(MODULE).so $(bindir)/$(MODULE).so
|
|
cd $(bindir) && $(RM) $(BASEMODULE) && $(LN_S) wine $(BASEMODULE)
|
|
|
|
install_prog.exe:: $(MODULE)
|
|
$(MKINSTALLDIRS) $(bindir)
|
|
$(INSTALL_PROGRAM) $(MODULE) $(bindir)/$(MODULE)
|
|
|
|
install:: install_prog$(DLLEXT)
|
|
|
|
uninstall::
|
|
$(RM) $(bindir)/$(BASEMODULE) $(bindir)/$(MODULE) $(bindir)/$(MODULE).so
|
|
|
|
clean::
|
|
$(RM) $(BASEMODULE) $(MODULE)
|