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
|
2002-05-12 01:06:32 +02:00
|
|
|
# APPMODE : program mode (cui,gui,cuiw,guiw)
|
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
|
|
|
|
#
|
|
|
|
|
2002-05-09 02:05:48 +02:00
|
|
|
DEFS = @DLLFLAGS@ -DSTRICT -DNONAMELESSUNION -DNONAMELESSSTRUCT $(EXTRADEFS)
|
|
|
|
LDDLLFLAGS = @LDDLLFLAGS@
|
2002-05-14 22:54:58 +02:00
|
|
|
ALL_OBJS = $(OBJS) $(MODULE).dbg.o
|
2002-05-09 02:05:48 +02:00
|
|
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
|
|
|
|
SYMBOLFILE = $(MODULE).tmp.o
|
2002-05-21 21:42:29 +02:00
|
|
|
BASEMODULE = $(MODULE:.exe=)
|
2002-05-09 02:05:48 +02:00
|
|
|
TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
|
2002-05-12 05:16:39 +02:00
|
|
|
RCOBJS = $(RC_SRCS:.rc=.res.o)
|
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
|
|
|
|
2002-05-12 01:06:32 +02:00
|
|
|
# Rule for main module spec file
|
|
|
|
|
|
|
|
$(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
|
2002-05-14 22:54:58 +02:00
|
|
|
$(LDPATH) $(WINEBUILD) $(DEFS) $(SYMBOLFILE:%=-sym %) -o $@ -exe $(MODULE) $(APPMODE:%=-m%) $(RC_SRCS:%.rc=-res %.res) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
|
2002-05-12 01:06:32 +02:00
|
|
|
|
2002-05-12 05:16:39 +02:00
|
|
|
# Rules for .so main module
|
2000-11-11 00:35:20 +01:00
|
|
|
|
2002-05-14 22:54:58 +02:00
|
|
|
$(MODULE).so: $(MODULE).spec.o $(ALL_OBJS) Makefile.in
|
|
|
|
$(LDSHARED) $(LDDLLFLAGS) $(MODULE).spec.o $(ALL_OBJS) -o $@ $(ALL_LIBS)
|
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
|
|
|
|
|
2002-05-21 21:42:29 +02:00
|
|
|
$(MODULE): $(ALL_OBJS) $(RCOBJS) Makefile.in
|
2002-05-14 22:54:58 +02:00
|
|
|
$(CC) $(ALL_OBJS) $(RCOBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
|
2002-05-12 05:16:39 +02:00
|
|
|
|
2000-11-11 00:35:20 +01:00
|
|
|
# Rules for checking that no imports are missing
|
|
|
|
|
2002-05-22 23:32:49 +02:00
|
|
|
CHECKLINK_RPATH = library tsx11 unicode
|
|
|
|
|
2000-11-11 00:35:20 +01:00
|
|
|
checklink:: $(MODULE).so
|
2002-05-22 23:32:49 +02:00
|
|
|
$(CC) -o checklink $(CHECKLINK_RPATH:%=-Wl,-rpath,$(TOPOBJDIR)/%) $(TOPSRCDIR)/library/checklink.c $(MODULE).so && $(RM) checklink
|
2000-11-11 00:35:20 +01:00
|
|
|
|
2002-01-10 04:30:21 +01:00
|
|
|
# Rules for testing
|
|
|
|
|
2002-05-21 21:42:29 +02:00
|
|
|
$(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-05-22 23:32:49 +02:00
|
|
|
install_prog.so: $(MODULE).so
|
|
|
|
$(MKINSTALLDIRS) $(dlldir)
|
|
|
|
$(INSTALL_PROGRAM) $(MODULE).so $(dlldir)/$(MODULE).so
|
2000-11-11 00:35:20 +01:00
|
|
|
|
2002-05-22 23:32:49 +02:00
|
|
|
install_prog: $(MODULE)
|
2002-05-12 05:16:39 +02:00
|
|
|
$(MKINSTALLDIRS) $(bindir)
|
2002-05-21 21:42:29 +02:00
|
|
|
$(INSTALL_PROGRAM) $(MODULE) $(bindir)/$(MODULE)
|
2002-05-12 05:16:39 +02:00
|
|
|
|
2002-05-22 23:32:49 +02:00
|
|
|
uninstall_prog.so: dummy
|
|
|
|
$(RM) $(dlldir)/$(MODULE).so
|
|
|
|
|
|
|
|
uninstall_prog: dummy
|
|
|
|
$(RM) $(bindir)/$(MODULE)
|
|
|
|
|
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)
|