#

FITZLIBS = libmupdf libfitz libfitzdraw libfonts libcmaps ;

SubDir TOP apps ;

Main pdfshow : pdfshow.c ;
LinkLibraries pdfshow : libpdftool $(FITZLIBS) ;

Main pdfclean : pdfclean.c ;
LinkLibraries pdfclean : libpdftool $(FITZLIBS) ;

Main pdfdraw : pdfdraw.c ;
LinkLibraries pdfdraw : libpdftool $(FITZLIBS) ;

Main pdfinfo : pdfinfo.c ;
LinkLibraries pdfinfo : libpdftool $(FITZLIBS) ;

Main pdfextract : pdfextract.c ;
LinkLibraries pdfextract : libpdftool $(FITZLIBS) ;

SubDir TOP apps common ;
Library libpdfapp : pdfapp.c ;

SubDir TOP apps common ;
Library libpdftool : pdftool.c ;

if $(BUILD_WINAPP)
{
    SubDir TOP apps windows ;
    Main mupdf : winmain.c winres.rc ;
    LinkLibraries mupdf : libpdfapp $(FITZLIBS) ;
    LINKLIBS on mupdf$(SUFEXE) = $(LINKLIBS) $(APPLINKLIBS) ;
}

if $(BUILD_X11APP)
{
    SubDir TOP apps unix ;
    Main mupdf : x11pdf.c ximage.c ;
    LinkLibraries mupdf : libpdfapp $(FITZLIBS) ;
    LINKLIBS on mupdf$(SUFEXE) = $(LINKLIBS) $(APPLINKLIBS) ;
}

if $(BUILD_PLUGIN)
{
    SubDir TOP apps mozilla ;
    SUFEXE on npmupdf.dll = ;
    LINKFLAGS on npmupdf.dll = $(LINKFLAGS) -shared -Wl,--kill-at ;
    LINKLIBS on npmupdf.dll = $(LINKLIBS) $(APPLINKLIBS) ;
    Main npmupdf.dll : npwin.c moz_winres.rc moz_main.c ;
    LinkLibraries npmupdf.dll : $(FITZLIBS) ;
}

