Newer
Older
#
# Each individual makefile should define the following variables:
# TOPSRCDIR : top-level source directory
# TOPOBJDIR : top-level object directory
# SRCDIR : source directory for this module
# MODULE : name of the module being built
# ASM_SRCS : assembly sources (optional)
# GEN_ASM_SRCS : generated assembly sources (optional)
# SPEC_SRCS : interface definition files (optional)
# GLUE : C sources for which glue code needs to be generated (optional)
# EXTRA_SRCS : extra source files for make depend (optional)
# WRCEXTRA : extra wrc flags (e.g. '-p _SysRes') (optional)
XLIB = @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@
DLL_LINK = @DLL_LINK@
WINELIB = $(WINESTUB) $(DLL_LINK)
DIVINCL = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include
ALLCFLAGS = $(DIVINCL) $(CFLAGS) $(DEFS) $(OPTIONS) $(X_CFLAGS)
Todd Vierling
committed
LDSHARED = @LDSHARED@
MANSPECS = -w $(TOPSRCDIR)/relay32/gdi32.spec \
-w $(TOPSRCDIR)/relay32/user32.spec \
-w $(TOPSRCDIR)/relay32/comctl32.spec \
-w $(TOPSRCDIR)/relay32/comdlg32.spec \
-w $(TOPSRCDIR)/relay32/kernel32.spec
LINT = @LINT@
LINTFLAGS = @LINTFLAGS@
ALLLINTFLAGS = $(LINTFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL)
WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check
BUILD = $(TOPOBJDIR)/tools/build@PROGEXT@
MAKEDEP = $(TOPOBJDIR)/tools/makedep@PROGEXT@
WRCFLAGS = -c
# Installation infos
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_DATA = @INSTALL_DATA@
prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
libdir = @libdir@
infodir = @infodir@

Alexandre Julliard
committed
mandir = @mandir@
prog_manext = 1
conf_manext = 5
OBJS = $(SPEC_SRCS:.spec=.spec.o) $(C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) \
$(ASM_SRCS:.S=.o) $(RC_SRCS:.rc=.o) $(GLUE:.c=.glue.o) $(EXTRA_OBJS)
# DLL list
DLLS = \
avifil32 \
comctl32 \
comdlg32 \
dciman32 \
dplayx \
dsound \
icmp \
imagehlp \
imm32 \
joystick.drv \
lz32 \
mcianim.drv \
mciavi.drv \
mcicda.drv \
mciseq.drv \
mciwave.drv \
midimap.drv \
msacm \
msacm.drv \
msacm32 \
msnet32 \
msvfw32 \
odbc32 \
ole32 \
oleaut32 \
olecli32 \
oledlg \
olesvr32 \
psapi \
rasapi32 \
setupx \
shell32 \
sound \
stress \
tapi32 \
version \
win32s \
win87em \
windebug \
wineoss.drv \
wing \
winspool \
wnaspi32 \
wsock32
.SUFFIXES:
.SUFFIXES: .rc .res .spec .spec.c .spec.o .glue.c $(SUFFIXES)
.spec.c.spec.o:
$(CC) -c $(ALLCFLAGS) @GCC_NO_BUILTIN@ -o $*.spec.o $<
.rc.s:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) $<
.rc.res:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -r $<
.res.s:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) -b $<
.res.h:
$(WRC) $(WRCFLAGS) $(WRCEXTRA) -bnh $<
.spec.spec.c:
$(BUILD) @BUILDFLAGS@ -o $@ -spec $<
$(BUILD) @BUILDFLAGS@ -o $@ -glue $<
.c.ln:
$(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
.PHONY: all install uninstall clean distclean depend dummy
cd $(TOPOBJDIR)/tools/wrc && $(MAKE) wrc@PROGEXT@
cd $(TOPOBJDIR)/tools && $(MAKE) makedep@PROGEXT@
# Rule to rebuild the 'build' program
$(BUILD) checkbuild:
cd $(TOPOBJDIR)/tools && $(MAKE) build@PROGEXT@
# Rule to rebuild winestub.o
$(WINESTUB) check_winestub:
cd $(TOPOBJDIR)/library && $(MAKE) winestub.o
$(MODULE).o: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
$(LDSHARED) $(OBJS) -o $@
lib$(MODULE).so: lib$(MODULE).so.$(SOVERSION)
$(RM) $@
$(LN_S) lib$(MODULE).so.$(SOVERSION) $@
lib$(MODULE).a: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
$(RM) $@
$(AR) $@ $(OBJS)
$(RANLIB) $@
# Rules for makefile
Makefile: Makefile.in $(TOPSRCDIR)/configure
@echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
@exit 1
all: Makefile
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# Rules for checking that no imports are missing
IMPORTLIBS = $(IMPORTS:%=$(DLLDIR)/lib%.$(LIBEXT))
checklink_so checklink_a: lib$(MODULE).$(LIBEXT) $(IMPORTLIBS)
$(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -l$(MODULE) -L$(DLLDIR) $(IMPORTS:%=-l%) -L$(TOPOBJDIR) -lwine $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS) && $(RM) checklink
checklink:: $(LIBEXT:%=checklink_%)
$(IMPORTLIBS): dummy
@cd $(DLLDIR) && $(MAKE) `basename $@`
# Rules for installation
install_so: lib$(MODULE).so.$(SOVERSION)
[ -d $(libdir) ] || $(MKDIR) $(libdir)
$(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
cd $(libdir) && $(RM) lib$(MODULE).so && $(LN_S) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).so
install_a: lib$(MODULE).a
[ -d $(libdir) ] || $(MKDIR) $(libdir)
$(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
uninstall_so uninstall_a:
cd $(libdir) && $(RM) lib$(MODULE).so lib$(MODULE).so.$(SOVERSION) lib$(MODULE).a
install:: $(LIBEXT:%=install_%)
uninstall:: $(LIBEXT:%=uninstall_%)
for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/man3w -S3w $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
html: $(C_SRCS)
for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/html -Th -iwindows.h $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
$(MODULE).ln : $(LINTS)
if test "$(LINTS)" ; \
then \
$(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
$(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
else \
$(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
fi
lint:: $(MODULE).ln
# Rules for Windows API checking
winapi_check::
$(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
$(SPEC_SRCS:.spec=.spec.c): $(BUILD) $(TOPSRCDIR)/include/builtin16.h $(TOPSRCDIR)/include/builtin32.h
$(GLUE:.c=.glue.c): $(BUILD) $(TOPSRCDIR)/include/builtin16.h $(TOPSRCDIR)/include/builtin32.h
depend:: $(MAKEDEP) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS)
$(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS)
$(RM) *.o *.a *.so *.ln \#*\# *~ *% .\#* *.bak *.orig *.rej *.flc *.spec.c *.glue.c y.tab.c y.tab.h lex.yy.c core $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.s) $(RC_SRCS:.rc=.h) $(PROGRAMS)