# Generated automatically from Makefile.in by configure.
TOPSRCDIR = ..
TOPOBJDIR = ..
SRCDIR    = .
MODULE    = none
BOOKNAME  = wine-doc
DB2HTML   = db2html

EXTRASUBDIRS = samples status

BOOK_SRCS = \
	architecture.sgml \
	bugs.sgml \
	build.sgml \
	compiling.sgml \
	configuring.sgml \
	consoles.sgml \
	cvs-regression.sgml \
	debugger.sgml \
	debugging.sgml \
	dlls.sgml \
	documentation.sgml \
	fonts.sgml \
	getting.sgml \
	i18n.sgml \
	implementation.sgml \
	installing.sgml \
	introduction.sgml \
	ole.sgml \
	opengl.sgml \
	packaging.sgml \
	patches.sgml \
	porting.sgml \
	printing.sgml \
	registry.sgml \
	running.sgml \
	tools.sgml \
	wine-doc.sgml \
	winelib-bindlls.sgml \
	winelib-intro.sgml \
	winelib-mfc.sgml \
	winelib-pkg.sgml \
	winelib-porting.sgml \
	winelib-toolkit.sgml \
	winelib-user.sgml

BOOK_TARGETS = \
	$(BOOKNAME)/index.html \
	$(BOOKNAME).pdf \
	$(BOOKNAME).ps

all: $(BOOK_TARGETS)


# Global rules shared by all makefiles     -*-Makefile-*-
#
# Each individual makefile must 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
#
# Each individual makefile may define the following additional variables:
# C_SRCS       : C sources for the module
# ASM_SRCS     : assembly sources
# GEN_C_SRCS   : generated C files
# GEN_ASM_SRCS : generated assembly sources
# RC_SRCS      : resource source files
# SPEC_SRCS    : interface definition files
# GLUE         : C sources for which glue code needs to be generated
# EXTRA_SRCS   : extra source files for make depend
# EXTRA_OBJS   : extra object files
# SUBDIRS      : subdirectories that contain a Makefile
# EXTRASUBDIRS : subdirectories that do not contain a Makefile

# First some useful definitions

SHELL     = /bin/sh
CC        = gcc
CPP       = gcc -E
CFLAGS    = -O2 -march=i386 -mcpu=i686 -Wall -mpreferred-stack-boundary=2
OPTIONS   =  -D_REENTRANT
X_CFLAGS  =  -I/usr/X11R6/include
X_LIBS    =  -L/usr/X11R6/lib
XLIB      =  -lSM -lICE -lXpm -lXxf86dga -lXxf86vm -lXv -lGL -lXext -lX11 
DLL_LINK  = -L$(DLLDIR) $(IMPORTS:%=-l%) $(LIBWINE) $(LIBUNICODE)
LIBS      = -lncurses -lm  -lutil -ldl
YACC      = bison -y
LEX       = flex
LEXLIB    = -lfl
LIBEXT    = so
LDSHARED  = $(CC) -shared $(SONAME:%=-Wl,-soname,%) -Wl,-rpath,$(libdir)
DLLWRAP   = false
DLLWRAPFLAGS = --add-stdcall-alias
RANLIB    = ranlib
LN_S      = ln -s
DIVINCL   = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL)
ALLCFLAGS = $(DIVINCL) $(CFLAGS) $(DEFS) $(OPTIONS) $(X_CFLAGS)
LDCOMBINE = ld -r
LDFLAGS   = 
AR        = ar rc
RM        = rm -f
MV        = mv
MKDIR     = mkdir -p
C2MAN     = $(TOPSRCDIR)/tools/c2man.pl
MANSPECS  = -w $(TOPSRCDIR)/dlls/gdi/gdi32.spec \
	    -w $(TOPSRCDIR)/dlls/user/user32.spec \
	    -w $(TOPSRCDIR)/dlls/comctl32/comctl32.spec \
	    -w $(TOPSRCDIR)/dlls/comdlg32/comdlg32.spec \
	    -w $(TOPSRCDIR)/dlls/kernel/kernel32.spec 
LINT      = 
LINTFLAGS = 
ALLLINTFLAGS = $(LINTFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL)
WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check
WINEBUILD = $(TOPOBJDIR)/tools/winebuild/winebuild
MAKEDEP   = $(TOPOBJDIR)/tools/makedep
WRC       = $(TOPOBJDIR)/tools/wrc/wrc
WMC       = $(TOPOBJDIR)/tools/wmc/wmc
LDPATH    = LD_LIBRARY_PATH="$(TOPOBJDIR)/unicode:$$LD_LIBRARY_PATH"
DLLDIR    = $(TOPOBJDIR)/dlls
LIBWINE   = -L$(TOPOBJDIR)/library -lwine
LIBTSX11  = -L$(TOPOBJDIR)/tsx11 -lwine_tsx11
LIBUNICODE= -L$(TOPOBJDIR)/unicode -lwine_unicode
LIBUUID   = -L$(TOPOBJDIR)/ole -lwine_uuid



# Installation infos

INSTALL         = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA    = ${INSTALL} -m 644
prefix          = /usr
exec_prefix     = /usr
bindir          = /usr/bin
libdir          = /usr/lib/wine
infodir         = /usr/share/info
mandir          = /usr/share/man
prog_manext     = 1
conf_manext     = 5
includedir      = /usr/include/wine/wine
CLEAN_FILES     = *.o *.a *.so *.ln \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
                  *.flc *.spec.c *.glue.c y.tab.c y.tab.h lex.yy.c core

OBJS = $(SPEC_SRCS:.spec=.spec.o) $(C_SRCS:.c=.o) $(GEN_C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) \
       $(ASM_SRCS:.S=.o) $(GLUE:.c=.glue.o) $(EXTRA_OBJS)

LINTS = $(C_SRCS:.c=.ln)

# DLL list

X_DLLS = \
	ddraw \
	opengl32 \
	x11drv

DLLS = \
	$(X_DLLS) \
	advapi32 \
	avifil32 \
	comctl32 \
	comdlg32 \
	crtdll \
	dciman32 \
	dinput \
	dplay \
	dplayx \
	dsound \
	gdi32 \
	icmp \
	imagehlp \
	imm32 \
	joystick.drv \
	kernel32 \
	lz32 \
	mcianim.drv \
	mciavi.drv \
	mcicda.drv \
	mciseq.drv \
	mciwave.drv \
	midimap.drv \
	mpr \
	msacm.drv \
	msacm32 \
	msnet32 \
	msvcrt \
	msvfw32 \
	odbc32 \
	ole32 \
	oleaut32 \
	olecli32 \
	oledlg \
	olepro32 \
	olesvr32 \
	psapi \
	rasapi32 \
	riched32 \
	rpcrt4 \
	serialui \
	setupapi \
	shdocvw \
	shell32 \
	shfolder \
	shlwapi \
	tapi32 \
	ttydrv \
	urlmon \
	user32 \
	version \
	w32skrnl \
	winedos \
	wineoss.drv \
	wineps \
	wininet \
	winmm \
	winnls32 \
	winspool.drv \
	wnaspi32 \
	wow32 \
	ws2_32 \
	wsock32

# Implicit rules

.SUFFIXES: .mc .rc .mc.rc .res .spec .spec.c .glue.c

.c.o:
	$(CC) -c $(ALLCFLAGS) -o $*.o $<

.s.o:
	$(AS) -o $*.o $<  

.S.o:
	$(CC) -c -o $*.o $<  

.mc.mc.rc:
	$(LDPATH) $(WMC) -i -H /dev/null -o $@ $<

.rc.res:
	$(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -r $<

.spec.spec.c:
	$(LDPATH) $(WINEBUILD) -fPIC -L$(DLLDIR) -o $@ -spec $<

.c.glue.c:
	$(LDPATH) $(WINEBUILD) -fPIC -o $@ -glue $<

.c.ln:
	$(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )

.PHONY: all install uninstall clean distclean depend dummy

# 'all' target first in case the enclosing Makefile didn't define any target

all: Makefile

# Rule for main module intermediate object

$(MODULE).tmp.o: $(OBJS) Makefile.in
	$(LDCOMBINE) $(OBJS) -o $@
	-strip --strip-unneeded $@

# Rule for main module spec file

$(MODULE).spec.c: $(MODULE).spec $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
	$(LDPATH) $(WINEBUILD) -fPIC -L$(DLLDIR) $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MODULE).spec

# Rule to rebuild the resource compiler

$(WRC):
	cd $(TOPOBJDIR)/tools/wrc && $(MAKE) wrc

# Rule to rebuild the message compiler

$(WMC):
	cd $(TOPOBJDIR)/tools/wmc && $(MAKE) wmc

# Rule to rebuild the 'makedep' program

$(MAKEDEP):
	cd $(TOPOBJDIR)/tools && $(MAKE) makedep

# Rule to rebuild the 'winebuild' program

$(WINEBUILD):
	cd $(TOPOBJDIR)/tools/winebuild && $(MAKE) winebuild

# Rules for makefile

Makefile: Makefile.in $(TOPSRCDIR)/configure
	@echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
	@exit 1

# Rules for auto documentation

man: $(C_SRCS)
	for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/man3w -S3w $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done

doc-html: $(C_SRCS)
	for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/html -Th -iwindows.h  $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done

# Rule for linting

$(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) .

# Rules for dependencies

$(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
	cd `dirname $@` && $(MAKE) depend

depend: $(MAKEDEP) $(GEN_C_SRCS) $(SUBDIRS:%=%/__depend__)
	$(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(MC_SRCS) $(EXTRA_SRCS) -C. $(GEN_C_SRCS)

# Rules for cleaning

$(SUBDIRS:%=%/__clean__): dummy
	cd `dirname $@` && $(MAKE) clean

$(EXTRASUBDIRS:%=%/__clean__): dummy
	-cd `dirname $@` && $(RM) $(CLEAN_FILES)

clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
	$(RM) $(CLEAN_FILES) $(GEN_C_SRCS) $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.res) $(MC_SRCS:.mc=.mc.rc) $(PROGRAMS)

# Rules for installing

$(SUBDIRS:%=%/__install__): dummy
	cd `dirname $@` && $(MAKE) install

$(SUBDIRS:%=%/__uninstall__): dummy
	cd `dirname $@` && $(MAKE) uninstall

# Misc. rules

$(SPEC_SRCS:.spec=.spec.c): $(WINEBUILD) $(TOPSRCDIR)/include/builtin16.h

$(GLUE:.c=.glue.c): $(WINEBUILD) $(TOPSRCDIR)/include/builtin16.h

$(RC_SRCS:.rc=.res): $(WRC)

$(MC_SRCS:.mc=.mc.rc): $(WMC)

$(SUBDIRS): dummy
	@cd $@ && $(MAKE)

dummy:

# End of global rules

$(BOOKNAME)/index.html: $(BOOK_SRCS)
	$(DB2HTML) $(BOOKNAME).sgml

$(BOOKNAME).pdf: $(BOOK_SRCS)
	db2pdf $(BOOKNAME).sgml > /dev/null

$(BOOKNAME).ps: $(BOOK_SRCS)
	db2ps $(BOOKNAME).sgml > /dev/null

install:: 
	$(INSTALL) -d $(mandir)/man$(prog_manext)
	$(INSTALL) -d $(mandir)/man$(conf_manext)
	sed -e 's|$${prefix}|$(prefix)|g' < wine.man > wine.man.tmp && mv wine.man.tmp wine.man
	$(INSTALL_DATA) wine.man $(mandir)/man$(prog_manext)/wine.$(prog_manext)
	$(INSTALL_DATA) $(SRCDIR)/winemaker.man $(mandir)/man$(prog_manext)/winemaker.$(prog_manext)
	sed -e 's|$${prefix}|$(prefix)|g' < wine.conf.man > wine.conf.man.tmp && mv wine.conf.man.tmp wine.conf.man
	$(INSTALL_DATA) wine.conf.man $(mandir)/man$(conf_manext)/wine.conf.$(conf_manext)

uninstall::
	$(RM) $(mandir)/man$(prog_manext)/wine.$(prog_manext)
	$(RM) $(mandir)/man$(prog_manext)/winemaker.$(prog_manext)
	$(RM) $(mandir)/man$(conf_manext)/wine.conf.$(conf_manext)

clean::
	$(RM) *.aux *.dvi *.tex *.log $(BOOKNAME).pdf $(BOOKNAME).ps
	$(RM) -r $(BOOKNAME) html man3w *.junk DBTOHTML_OUTPUT_DIR*

### Dependencies:
