# nmake -f makefile.msvc
# Arguments:
# CFG=dbg|rel (default: dbg)
# BASEDIR=.
# EXTDIR=<directory where zlib/freetype/jpeg lib live> (default: ext)
#  e.g. ..\sumatrapdf\ext
# EXTCFLAGS=$CFLAGS
# MUPDF_DIR=mupdf
# PLATFORM=X86
#   the PLATFORM var is usually set in the x64 and x64 cross tools Visual Studio command prompt
#   note: building on X64 isn't officially supported and might unintentionally be broken
# WITH_ANALYZE=yes
#   use /analyze for all code

# Set default configuration
!if "$(CFG)"==""
CFG=dbg
!endif

!if "$(BASEDIR)"==""
BASEDIR=.
!endif

!if "$(PLATFORM)"=="x64" || "$(TARGET_CPU)"=="x64"
PLATFORM = X64
!endif

# O is directory where object and binary files go
O = $(BASEDIR)\obj-$(CFG)

# for x86 : obj-dbg and obj-rel ; for x64 : obj-dbg64 and obj-rel64
!if "$(PLATFORM)"=="X64"
O = $(O)64
!endif

!if "$(MUPDF_DIR)"==""
MUPDF_DIR=$(BASEDIR)\mupdf
!endif

!if "$(EXTDIR)"==""
EXTDIR=$(BASEDIR)\ext
!endif

# default target
all_sumatrapdf: SumatraPDF Uninstaller PDFFilter PdfPreview BrowserPlugin EngineDump

##### add configuration changes that should also affect MuPDF before this line #####

!INCLUDE $(MUPDF_DIR)\makefile.msvc

##### add configuration changes that should NOT affect MuPDF after this line #####

SRCDIR = $(BASEDIR)\src

# some libraries require stdint.h
CFLAGS = $(CFLAGS) /I$(SRCDIR)/utils/msvc
CFLAGSOPT = $(CFLAGSOPT) /I$(SRCDIR)/utils/msvc

# include build data for the remaining third-party libraries
!INCLUDE $(EXTDIR)\makefile.msvc

# Modify the following defines if you have to target a platform prior to the ones specified below.
# Their meaning: http://msdn.microsoft.com/en-us/library/aa383745(VS.85).aspx
# and http://blogs.msdn.com/oldnewthing/archive/2007/04/11/2079137.aspx
# We set the features uniformly to Windows 2000 or later.
CFLAGS = $(CFLAGS) /D "WINVER=0x0500" /D "_WIN32_WINNT=0x0500"
# Suppress warning C4800: forcing value to bool 'true' or 'false'
CFLAGS = $(CFLAGS) /wd4800

!if "$(WITH_ANALYZE)"=="yes"
CFLAGS = /analyze:WX- $(CFLAGS)
# suppress warning C6211: Leaking memory 'foo' due to an exception
# TODO: verify that new doesn't throw
CFLAGS = $(CFLAGS) /wd6211
!endif

!if "$(CFG)"=="dbg"
CFLAGS = $(CFLAGS) /D "DEBUG" /D "_DEBUG"
!endif

UTILS_CFLAGS = $(CFLAGS) $(EXTCFLAGS) \
	/I$(SRCDIR)/utils /I$(SRCDIR)/mui /I$(ZLIB_DIR) /I$(ZLIB_DIR)/minizip \
	/I$(EXTDIR)/lzma/C /I$(EXTDIR)/libwebp /I$(MUPDF_DIR)\include

SUMATRA_CFLAGS = $(UTILS_CFLAGS) $(EXTCFLAGS) \
	/I$(SRCDIR) /I$(MUPDF_DIR)\include \
	/I$(EXTDIR)/synctex /I$(EXTDIR)/libdjvu /I$(EXTDIR)/CHMLib/src

INSTALLER_CFLAGS = $(CFLAGS) $(EXTCFLAGS) \
	/I$(SRCDIR)/utils /I$(SRCDIR)/installer /I$(SRCDIR) /I$(ZLIB_DIR) /I$(EXTDIR)/lzma/C

UNINSTALLER_CFLAGS = $(CFLAGS) $(EXTCFLAGS) \
	/I$(SRCDIR)/utils /I$(SRCDIR)/installer /I$(SRCDIR) /D "BUILD_UNINSTALLER"

RC_FLAGS = $(EXTCFLAGS)
!if "$(CFG)"=="dbg"
RC_FLAGS = $(RC_FLAGS) /D "DEBUG" /D "_DEBUG"
!endif

LIB_FLAGS = /nologo
!if "$(CFG)"!="dbg"
# match LDFLAGS in mupdf\makefile.msvc
LIB_FLAGS = $(LIB_FLAGS) /LTCG
!endif

LIBS = $(LIBS) \
	comctl32.lib Msimg32.lib Winspool.lib wininet.lib urlmon.lib \
	ole32.lib OleAut32.lib shlwapi.lib version.lib WindowsCodecs.lib

OS   = $(O)\sumatrapdf
OU   = $(O)\utils
ODLL = $(O)\applibs
OMUI = $(O)\mui
OM   = $(O)\memtrace
OUIA = $(O)\uia

SUMATRA_APP = $(O)\SumatraPDF.exe
SUMATRA_APP_NO_MUPDF = $(O)\SumatraPDF-no-MuPDF.exe
SUMATRA_RES = $(OS)\sumatrapdf.res

INSTALLER_APP   = $(O)\Installer.exe
INSTALLER_RES   = $(OS)\Installer.res
UNINSTALLER_APP = $(O)\uninstall.exe
UNINSTALLER_RES = $(OS)\Uninstaller.res

PDFFILTER_DLL = $(O)\PdfFilter.dll
PDFFILTER_RES = $(ODLL)\PdfFilter.res
PDFFILTER_CFLAGS = $(SUMATRA_CFLAGS)

LIBMUPDF_LIB = $(O)\libmupdf.lib
LIBMUPDF_DEF = $(SRCDIR)\libmupdf.def
LIBMUPDF_DLL = $(O)\libmupdf.dll
LIBMUPDF_RES = $(O)\libmupdf.res

PDFPREVIEW_DLL = $(O)\PdfPreview.dll
PDFPREVIEW_RES = $(ODLL)\PdfPreview.res
PDFPREVIEW_CFLAGS = $(SUMATRA_CFLAGS)

MEMTRACE_DLL = $(O)\memtrace.dll
MEMTRACE_RES = $(ODLL)\memtrace.res
MEMTRACE_CFLAGS = $(SUMATRA_CFLAGS)

BROWSER_PLUGIN = $(O)\npPdfViewer.dll
BROWSER_PLUGIN_RES = $(ODLL)\npPdfViewer.res
BROWSER_PLUGIN_CFLAGS = $(CFLAGS) /I$(SRCDIR)/utils

ENGINEDUMP_APP = $(O)\EngineDump.exe

MUPDF_LIB   = $(O)\libmupdfs.lib
UTILS_LIB   = $(O)\utils.lib
MUI_LIB     = $(O)\mui.lib
ENGINES_LIB = $(O)\engines.lib
MAIN_UI_LIB = $(O)\sumatra.lib

UTILS_OBJS = \
	$(OU)\BencUtil.obj $(OU)\FileUtil.obj $(OU)\HttpUtil.obj \
	$(OU)\StrUtil.obj $(OU)\WinUtil.obj $(OU)\GdiPlusUtil.obj \
	$(OU)\DialogSizer.obj $(OU)\FileTransactions.obj $(OU)\Touch.obj \
	$(OU)\TrivialHtmlParser.obj $(OU)\HtmlWindow.obj \
	$(OU)\DirIter.obj $(OU)\BitReader.obj $(OU)\HtmlPullParser.obj \
	$(OU)\HtmlPrettyPrint.obj $(OU)\ThreadUtil.obj $(OU)\DebugLog.obj \
	$(OU)\DbgHelpDyn.obj $(OU)\JsonParser.obj $(OU)\TgaReader.obj \
	$(OU)\HtmlParserLookup.obj $(OU)\ByteOrderDecoder.obj $(OU)\CmdLineParser.obj \
	$(OU)\UITask.obj $(OU)\StrFormat.obj $(OU)\Dict.obj $(OU)\BaseUtil.obj \
	$(OU)\CssParser.obj $(OU)\FileWatcher.obj \
	$(OU)\StrSlice.obj $(OU)\TxtParser.obj $(OU)\SerializeTxt.obj \
	$(OU)\SquareTreeParser.obj $(OU)\SettingsUtil.obj \
	$(OU)\WebpReader.obj $(WEBP_OBJS) $(OU)\FzImgReader.obj

!if "$(CFG)"=="dbg"
UTILS_OBJS = $(UTILS_OBJS) $(OU)\Experiments.obj
!endif

# requires either MuPDF/libmupdf or $(ZLIB_OBJS)
ZIP_OBJS = $(OU)\ZipUtil.obj $(MINIZIP_OBJS) $(BZIP2_OBJS)
LZSA_OBJS = $(OU)\LzmaSimpleArchive.obj $(LZMA_OBJS)

MUI_OBJS = \
	$(OMUI)\MuiBase.obj $(OMUI)\Mui.obj $(OMUI)\MuiCss.obj $(OMUI)\MuiLayout.obj \
	$(OMUI)\MuiPainter.obj $(OMUI)\MuiControl.obj $(OMUI)\MuiButton.obj \
	$(OMUI)\MuiScrollBar.obj $(OMUI)\MuiEventMgr.obj $(OMUI)\MuiHwndWrapper.obj \
	$(OMUI)\MuiGrid.obj $(OMUI)\SvgPath.obj $(OMUI)\MuiDefs.obj \
	$(OMUI)\MuiFromText.obj $(OMUI)\TextRender.obj

EBOOK_OBJS = \
	$(OS)\Doc.obj $(OS)\EbookDoc.obj $(OS)\MobiDoc.obj $(OU)\PalmDbReader.obj \
	$(OS)\HtmlFormatter.obj $(OS)\EbookFormatter.obj

ENGINE_OBJS = \
	$(OS)\PdfEngine.obj $(OS)\PsEngine.obj \
	$(OS)\ImagesEngine.obj $(ZIP_OBJS) $(UNRAR_OBJS) \
	$(OS)\DjVuEngine.obj $(DJVU_OBJS) \
	$(OS)\ChmEngine.obj $(OS)\ChmDoc.obj $(CHMLIB_OBJS) \
	$(OS)\EbookEngine.obj $(EBOOK_OBJS) \
	$(OS)\EngineManager.obj $(OS)\FileModifications.obj

UIA_OBJS = \
	$(OUIA)\Provider.obj $(OUIA)\StartPageProvider.obj $(OUIA)\DocumentProvider.obj \
	$(OUIA)\PageProvider.obj $(OUIA)\TextRange.obj

MAIN_UI_OBJS = \
	$(OS)\AppPrefs.obj $(OS)\DisplayModel.obj $(OS)\CrashHandler.obj \
	$(OS)\Favorites.obj $(OS)\TextSearch.obj $(OS)\SumatraAbout.obj $(OS)\SumatraAbout2.obj \
	$(OS)\SumatraDialogs.obj $(OS)\SumatraProperties.obj \
	$(OS)\PdfSync.obj $(OS)\RenderCache.obj $(OS)\TextSelection.obj \
	$(OS)\WindowInfo.obj $(OS)\ParseCommandLine.obj $(OS)\StressTesting.obj \
	$(OS)\AppTools.obj $(OS)\AppUtil.obj $(OS)\TableOfContents.obj \
	$(OS)\Toolbar.obj $(OS)\Print.obj $(OS)\Notifications.obj $(OS)\Selection.obj \
	$(OS)\Search.obj $(OS)\Menu.obj $(OS)\ExternalPdfViewer.obj \
	$(OS)\EbookControls.obj $(OS)\EbookController.obj $(OS)\EbookWindow.obj \
	$(OS)\MuiEbookPageDef.obj $(OS)\PagesLayoutDef.obj \
	$(OS)\Tester.obj $(OS)\Regress.obj \
	$(OS)\Translations.obj $(OS)\Trans_sumatra_txt.obj \
	$(UIA_OBJS)

SUMATRA_OBJS = \
	$(OS)\SumatraPDF.obj $(SUMATRA_RES) $(MAIN_UI_LIB) \
	$(UTILS_LIB) $(MUI_LIB) $(ENGINES_LIB) $(SYNCTEX_OBJS) $(LZSA_OBJS)

INSTALLER_OBJS = \
	$(OS)\Installer.obj $(INSTALLER_RES) $(OS)\CrashHandler.obj \
	$(UTILS_LIB) $(LZSA_OBJS) $(ZLIB_OBJS) \
	$(OS)\Translations.obj $(OS)\Trans_installer_txt.obj

UNINSTALLER_OBJS = \
	$(OS)\Uninstaller.obj $(UNINSTALLER_RES) $(UTILS_LIB) \
	$(OS)\Translations.obj $(OS)\Trans_installer_txt.obj

PDFFILTER_OBJS = \
	$(ODLL)\PdfFilterDll.obj $(ODLL)\CPdfFilter.obj $(PDFFILTER_RES) \
	$(UTILS_LIB) $(LIBMUPDF_LIB) $(OS)\MuPDF_Exports.obj $(OS)\PdfEngine.obj $(ZIP_OBJS)

PDFPREVIEW_OBJS = \
	$(ODLL)\PdfPreviewDll.obj $(ODLL)\PdfPreview.obj $(PDFPREVIEW_RES) \
	$(UTILS_LIB) $(LIBMUPDF_LIB) $(OS)\MuPDF_Exports.obj $(OS)\PdfEngine.obj $(ZIP_OBJS)

BROWSER_PLUGIN_OBJS = \
	$(ODLL)\npPdfViewer.obj $(BROWSER_PLUGIN_RES) $(UTILS_LIB)

ENGINEDUMP_OBJS = \
	$(OS)\EngineDump.obj $(ENGINES_LIB) $(MUPDF_LIB) $(UTILS_LIB) $(OMUI)\MiniMui.obj $(OMUI)\TextRender.obj

MEMTRACE_OBJS = \
	$(OM)\MemTraceDll.obj $(UTILS_LIB)

!if "$(CFG)"=="dbg"
# build all optional IFilters for debug builds
BUILD_TEX_IFILTER = 1
BUILD_EPUB_IFILTER = 1
# build all optional previews for debug builds
BUILD_XPS_PREVIEW = 1
BUILD_EPUB_PREVIEW = 1
BUILD_CBZ_PREVIEW = 1
BUILD_TGA_PREVIEW = 1
!endif

!if "$(BUILD_TEX_IFILTER)"!=""
PDFFILTER_OBJS = $(PDFFILTER_OBJS) $(ODLL)\CTeXFilter.obj
PDFFILTER_CFLAGS = $(PDFFILTER_CFLAGS) /D "BUILD_TEX_IFILTER"
!endif

!if "$(BUILD_EPUB_IFILTER)"!=""
PDFFILTER_OBJS = $(PDFFILTER_OBJS) $(ODLL)\CEpubFilter.obj \
	$(OS)\EbookDoc.obj $(OS)\MobiDoc.obj $(OU)\PalmDbReader.obj
PDFFILTER_CFLAGS = $(PDFFILTER_CFLAGS) /D "BUILD_EPUB_IFILTER"
!endif

!if "$(BUILD_XPS_PREVIEW)"!=""
PDFPREVIEW_CFLAGS = $(PDFPREVIEW_CFLAGS) /D "BUILD_XPS_PREVIEW"
!endif

!if "$(BUILD_EPUB_PREVIEW)$(BUILD_CBZ_PREVIEW)$(BUILD_TGA_PREVIEW)"!=""
PDFPREVIEW_OBJS = $(PDFPREVIEW_OBJS) $(UTILS_LIB)
!endif

!if "$(BUILD_EPUB_PREVIEW)"!=""
PDFPREVIEW_OBJS = $(PDFPREVIEW_OBJS) $(OS)\EbookEngine.obj \
	$(EBOOK_OBJS) $(OS)\ChmDoc.obj $(CHMLIB_OBJS) \
	$(OMUI)\MiniMui.obj $(OMUI)\TextRender.obj
PDFPREVIEW_CFLAGS = $(PDFPREVIEW_CFLAGS) /D "BUILD_EPUB_PREVIEW"
!endif

!if "$(BUILD_CBZ_PREVIEW)$(BUILD_TGA_PREVIEW)"!=""
PDFPREVIEW_OBJS = $(PDFPREVIEW_OBJS) $(OS)\ImagesEngine.obj $(OU)\JsonParser.obj
!if "$(BUILD_CBZ_PREVIEW)"!=""
PDFPREVIEW_CFLAGS = $(PDFPREVIEW_CFLAGS) /D "BUILD_CBZ_PREVIEW"
!endif
!if "$(BUILD_TGA_PREVIEW)"!=""
PDFPREVIEW_CFLAGS = $(PDFPREVIEW_CFLAGS) /D "BUILD_TGA_PREVIEW"
!endif
!endif

##### SumatraPDF-specific build rules #####

rebuild: clean SumatraPDF

cleanmupdf: force
	-del $(FITZ_DRAW_OBJS) $(FITZ_OBJS) $(MUPDF_OBJS) $(MUXPS_OBJS) $(MUCBZ_OBJS)

cleanall: force
	-rmdir /S /Q obj-dbg obj-rel

SumatraPDF:    $(OS) $(SUMATRA_APP) $(SUMATRA_APP_NO_MUPDF)
Installer:     $(OS) $(INSTALLER_APP)
Uninstaller:   $(OS) $(UNINSTALLER_APP)
PDFFilter:     $(OS) $(PDFFILTER_DLL)
PdfPreview:    $(OS) $(PDFPREVIEW_DLL)
BrowserPlugin: $(OS) $(BROWSER_PLUGIN)
EngineDump:    $(OS) $(ENGINEDUMP_APP)
memtrace:      $(OS) $(MEMTRACE_DLL)
mudraw:        $(O)  $(MUDRAW_APP)
mutool:        $(O)  $(MUTOOL_APP)

$(OS): $(O) $(OE)
	@if not exist $(OS) mkdir $(OS)
	@if not exist $(OU) mkdir $(OU)
	@if not exist $(ODLL) mkdir $(ODLL)
	@if not exist $(OMUI) mkdir $(OMUI)
	@if not exist $(OM) mkdir $(OM)
	@if not exist $(OUIA) mkdir $(OUIA)

$(SUMATRA_RES): $(SRCDIR)\SumatraPDF.rc $(SRCDIR)\Resource.h $(SRCDIR)\Version.h $(SRCDIR)\EbookWinDesc.txt
	rc /r /fo$@ $(RC_FLAGS) $(SRCDIR)\SumatraPDF.rc

$(SUMATRA_APP): $(SUMATRA_OBJS) $(MUPDF_LIB)
	$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@

$(SUMATRA_APP_NO_MUPDF): $(SUMATRA_OBJS) $(LIBMUPDF_LIB) $(OS)\MuPDF_Exports.obj
	$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@

$(LIBMUPDF_RES): $(SRCDIR)\libmupdf.rc $(SRCDIR)\Version.h
	rc /r /fo$@ $(RC_FLAGS) $(SRCDIR)\libmupdf.rc

$(LIBMUPDF_DLL): $(MUPDF_LIB) $(LIBMUPDF_RES) $(LIBMUPDF_DEF)
	$(LD) /DLL $(LDFLAGS) $(MUPDF_LIB) $(LIBMUPDF_RES) $(LIBS) /DEF:$(LIBMUPDF_DEF) /IMPLIB:$(LIBMUPDF_LIB) /PDB:$*.pdb /OUT:$@

$(LIBMUPDF_LIB): $(LIBMUPDF_DLL)

$(O)\InstallerData.dat:
	echo Use scripts\build.py for creating the file $@
	echo. > $@

$(INSTALLER_RES): $(SRCDIR)\installer\Installer.rc $(SRCDIR)\installer\Resource.h $(SRCDIR)\Version.h $(O)\InstallerData.dat
	rc /r /fo$@ $(RC_FLAGS) /D "INSTALL_PAYLOAD_ZIP=..\..\$(O)\InstallerData.dat" $(SRCDIR)\installer\Installer.rc

$(UNINSTALLER_RES): $(SRCDIR)\installer\Installer.rc $(SRCDIR)\installer\Resource.h $(SRCDIR)\Version.h
	rc /r /fo$@ $(RC_FLAGS) /D "BUILD_UNINSTALLER" $(SRCDIR)\installer\Installer.rc

$(INSTALLER_APP): $(INSTALLER_OBJS)
	$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@

$(UNINSTALLER_APP): $(UNINSTALLER_OBJS)
	$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@

$(PDFFILTER_RES): $(SRCDIR)\ifilter\PdfFilter.rc $(SRCDIR)\Version.h
	rc /r /fo$@ $(RC_FLAGS) $(SRCDIR)\ifilter\PdfFilter.rc

$(PDFFILTER_DLL): $(PDFFILTER_OBJS)
	$(LD) /DLL $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@

$(PDFPREVIEW_RES): $(SRCDIR)\previewer\PdfPreview.rc $(SRCDIR)\Version.h
	rc /r /fo$@ $(RC_FLAGS) $(SRCDIR)\previewer\PdfPreview.rc

$(PDFPREVIEW_DLL): $(PDFPREVIEW_OBJS)
	$(LD) /DLL $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@

$(MEMTRACE_RES): $(SRCDIR)\memtrace\MemTrace.rc
	rc /r /fo$@ $(RC_FLAGS) $(SRCDIR)\memtrace\MemTrace.rc

$(MEMTRACE_DLL): $(MEMTRACE_OBJS)
	$(LD) /DLL $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@

$(BROWSER_PLUGIN_RES): $(SRCDIR)\browserplugin\npPdfViewer.rc $(SRCDIR)\Version.h
	rc /r /fo$@ $(RC_FLAGS) $(SRCDIR)\browserplugin\npPdfViewer.rc

$(BROWSER_PLUGIN): $(BROWSER_PLUGIN_OBJS)
	$(LD) /DLL $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@

$(ENGINEDUMP_APP): $(ENGINEDUMP_OBJS)
	$(LD) $(LDFLAGS) $** $(LIBS) /PDB:$*.pdb /OUT:$@ /SUBSYSTEM:CONSOLE

{$(SRCDIR)\utils}.cpp{$(OU)}.obj::
	$(CC) $(UTILS_CFLAGS) /Fo$(OU)\ /Fd$(O)\vc80.pdb $<

{$(SRCDIR)\mui}.cpp{$(OMUI)}.obj::
	$(CC) $(UTILS_CFLAGS) /Fo$(OMUI)\ /Fd$(O)\vc80.pdb $<

{$(SRCDIR)\uia}.cpp{$(OUIA)}.obj::
	$(CC) $(SUMATRA_CFLAGS) /Fo$(OUIA)\ /Fd$(O)\vc80.pdb $<

{$(SRCDIR)}.cpp{$(OS)}.obj::
	$(CC) $(SUMATRA_CFLAGS) /Fo$(OS)\ /Fd$(O)\vc80.pdb $<

{$(SRCDIR)\browserplugin}.cpp{$(ODLL)}.obj::
	$(CC) $(BROWSER_PLUGIN_CFLAGS) /Fo$(ODLL)\ /Fd$(O)\vc80.pdb $<

{$(SRCDIR)\ifilter}.cpp{$(ODLL)}.obj::
	$(CC) $(PDFFILTER_CFLAGS) /Fo$(ODLL)\ /Fd$(O)\vc80.pdb $<

{$(SRCDIR)\previewer}.cpp{$(ODLL)}.obj::
	$(CC) $(PDFPREVIEW_CFLAGS) /Fo$(ODLL)\ /Fd$(O)\vc80.pdb $<

{$(SRCDIR)\regress}.cpp{$(OS)}.obj::
	$(CC) $(SUMATRA_CFLAGS) /Fo$(OS)\ /Fd$(O)\vc80.pdb $<

{$(SRCDIR)\installer}.cpp{$(OS)}.obj::
	$(CC) $(INSTALLER_CFLAGS) /Fo$(OS)\ /Fd$(O)\vc80.pdb $<
$(OS)\Uninstaller.obj: $(OS)\Installer.obj
	$(CC) $(UNINSTALLER_CFLAGS) /Fo$(OS)\Uninstaller.obj /Fd$(O)\vc80.pdb $(SRCDIR)\installer\Installer.cpp

{$(SRCDIR)\memtrace}.cpp{$(OM)}.obj::
	$(CC) $(MEMTRACE_CFLAGS) /Fo$(OM)\ /Fd$(O)\vc80.pdb $<

$(MUPDF_LIB): $(LIBS_OBJS)
	lib $(LIB_FLAGS) /OUT:$@ $**

$(UTILS_LIB): $(UTILS_OBJS)
	lib $(LIB_FLAGS) /OUT:$@ $**

$(MUI_LIB): $(MUI_OBJS)
	lib $(LIB_FLAGS) /OUT:$@ $**

$(ENGINES_LIB): $(ENGINE_OBJS)
	lib $(LIB_FLAGS) /OUT:$@ $**

$(MAIN_UI_LIB): $(MAIN_UI_OBJS)
	lib $(LIB_FLAGS) /OUT:$@ $**

## Header-dependencies for $(SRCDIR)\* and $(SRCDIR)\*\*
!INCLUDE makefile.deps
