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
|
|
|
|
#
|
|
|
|
|
2002-05-09 00:05:48 +00:00
|
|
|
DEFS = @DLLFLAGS@ -DSTRICT -DNONAMELESSUNION -DNONAMELESSSTRUCT $(EXTRADEFS)
|
|
|
|
LDDLLFLAGS = @LDDLLFLAGS@
|
|
|
|
ALL_OBJS = $(MODULE).spec.o $(OBJS)
|
|
|
|
ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBS)
|
|
|
|
SYMBOLFILE = $(MODULE).tmp.o
|
|
|
|
TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
|
2000-11-10 23:35:20 +00:00
|
|
|
|
|
|
|
all: $(MODULE)
|
|
|
|
|
|
|
|
@MAKE_RULES@
|
|
|
|
|
2002-05-11 23:06:32 +00:00
|
|
|
# Rule for main module spec file
|
|
|
|
|
|
|
|
$(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
|
|
|
|
$(LDPATH) $(WINEBUILD) @DLLFLAGS@ $(SYMBOLFILE:%=-sym %) -o $@ -exe $(MODULE) $(APPMODE:%=-m%) $(RC_SRCS:%.rc=-res %.res) -L$(DLLDIR) $(DELAYIMPORTS:%=-dl%) $(IMPORTS:%=-l%)
|
|
|
|
|
2000-11-10 23:35:20 +00:00
|
|
|
# Rules for main module
|
|
|
|
|
2002-05-11 23:06:32 +00:00
|
|
|
$(MODULE).so: $(MODULE).spec.o $(OBJS) Makefile.in
|
|
|
|
$(LDSHARED) $(LDDLLFLAGS) $(MODULE).spec.o $(OBJS) -o $@ $(ALL_LIBS)
|
2000-11-10 23:35:20 +00:00
|
|
|
|
|
|
|
$(MODULE): $(MODULE).so
|
|
|
|
$(RM) $(MODULE) && $(LN_S) $(TOPOBJDIR)/wine $(MODULE)
|
|
|
|
|
|
|
|
# Rules for checking that no imports are missing
|
|
|
|
|
|
|
|
checklink:: $(MODULE).so
|
2002-05-09 00:05:48 +00:00
|
|
|
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c $(MODULE).so && $(RM) checklink
|
2000-11-10 23:35:20 +00:00
|
|
|
|
2002-01-10 03:30:21 +00:00
|
|
|
# Rules for testing
|
|
|
|
|
|
|
|
$(TESTRESULTS): $(MODULE).so
|
|
|
|
|
2000-11-10 23:35:20 +00:00
|
|
|
# Rules for debug channels
|
|
|
|
|
|
|
|
debug_channels: dummy
|
|
|
|
$(TOPSRCDIR)/tools/make_debug $(MODULE).spec $(C_SRCS)
|
|
|
|
|
|
|
|
# Rules for installation
|
|
|
|
|
|
|
|
install:: $(MODULE).so
|
2002-05-09 04:31:39 +00:00
|
|
|
$(MKINSTALLDIRS) $(bindir)
|
2000-11-10 23:35:20 +00:00
|
|
|
$(INSTALL_PROGRAM) $(MODULE).so $(bindir)/$(MODULE).so
|
2000-12-10 23:11:41 +00:00
|
|
|
cd $(bindir) && $(RM) $(MODULE) && $(LN_S) wine $(MODULE)
|
2000-11-10 23:35:20 +00:00
|
|
|
|
|
|
|
uninstall::
|
2002-05-09 04:31:39 +00:00
|
|
|
$(RM) $(bindir)/$(MODULE) $(bindir)/$(MODULE).so
|
2000-11-10 23:35:20 +00:00
|
|
|
|
|
|
|
clean::
|
|
|
|
$(RM) $(MODULE)
|