# Makefile for the Sherlock PDF Parser (c) 2002 Milan Vancura <milan@ucw.cz>

DIRS+=gather/format/pdf

LIBGATH_MODS+=$(addprefix format/pdf/,pdf glyphs adobeencs crypt lex stream fonts)
LIBGATH_LIBS+=-lm

ifdef CONFIG_DEBUG
PROGS+=obj/gather/format/pdf/pdfdump
endif

gather/format/pdf/glyphs.c: gather/format/pdf/glyphs.k obj/build/genhash
	obj/build/genhash $< $@ is_glyph

# Shut up incomplete initializer warnings from newer versions of gcc
obj/gather/format/pdf/glyphs.o obj/gather/format/pdf/glyphs.oo: CWARNS=

obj/gather/format/pdf/pdfdump: obj/gather/format/pdf/pdf.o $(LIBGATH) $(LIBCHARSET) $(LIBFILTER) $(LIBSH)
obj/gather/format/pdf/pdfdump: LIBS+=$(LIBGATH_LIBS)
obj/gather/format/pdf/pdfdump.o: gather/format/pdf/pdfdump.c gather/format/pdf/pdf.c

clean::
	rm -f gather/format/pdf/glyphs.c
