# Generated automatically from Makefile.in by configure.
# Makefile for libpdf - te@informatik.uni-hannover.de

# common.mk -- used by all Makefiles.
SHELL = sh
MAKE=make
top_srcdir = ..
srcdir = .

CC = cl
CFLAGS = -nologo -W1 -favor:blend -MD -O2 -DWIN32=1 $(XCFLAGS)
#CFLAGS = -nologo -MD -Od -Zi -DWIN32=1 $(XCFLAGS)
CPPFLAGS =  $(XCPPFLAGS)

YDEFS = -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE \
-D_CRT_OBSOLETE_NO_DEPRECATE -D_SECURE_SCL=0 \
-D_CRT_SECURE_NO_WARNINGS -wd4267

DEFS = -DHAVE_CONFIG_H $(XDEFS) $(YDEFS)

# Kpathsea needs this for compiling, programs need it for linking.
LIBTOOL = $(kpathsea_srcdir_parent)/klibtool

# You can change [X]CPPFLAGS, [X]CFLAGS, or [X]DEFS, but
# please don't change ALL_CPPFLAGS or ALL_CFLAGS.
# prog_cflags is set by subdirectories of web2c.
ALL_CPPFLAGS = $(DEFS) -I. -I.. -Iregex \
  -I../../../libs -I../../../libs/xpdf \
  -I$(kpathsea_parent) -I$(kpathsea_srcdir_parent) \
  $(prog_cflags) $(CPPFLAGS)
ALL_CFLAGS = $(ALL_CPPFLAGS) $(CFLAGS) -c
compile = $(CC) $(ALL_CFLAGS)

.SUFFIXES:
.SUFFIXES: .c .obj # in case the suffix list has been cleared, e.g., by web2c

# Installation.
INSTALL = cp
INSTALL_PROGRAM = ${INSTALL}
INSTALL_SCRIPT = $(INSTALL_PROGRAM)
INSTALL_DATA = ${INSTALL}
INSTALL_LIBTOOL_LIBS = INSTALL_DATA='$(INSTALL_DATA)' $(LIBTOOL) install-lib
INSTALL_LIBTOOL_PROG = INSTALL_PROGRAM='$(INSTALL_PROGRAM)' $(LIBTOOL) install-prog

# Creating (symbolic) links.
LN = cp

# We use these for many things.
kpathsea_parent = ..
kpathsea_dir = $(kpathsea_parent)/kpathsea
kpathsea_srcdir_parent = $(top_srcdir)/..
kpathsea_srcdir = $(kpathsea_srcdir_parent)/kpathsea
kpathsea = $(kpathsea_dir)/kpathsea600.lib

#M#ifeq ($(CC), gcc)
#M#XDEFS = -Wpointer-arith $(warn_more)
#M#CFLAGS = -pipe -g $(XCFLAGS)
#M#endif
# End of common.mk.
# programs.mk -- used by Makefiles for executables only.

# Don't include $(CFLAGS), since ld -g under Linux forces
# static libraries, e.g., libc.a and libX*.a.
LDFLAGS =  $(XLDFLAGS)

# proglib is for web2c; 
# XLOADLIBES is for the installer.
LIBS = 
LOADLIBES = $(proglib) $(kpathsea) $(LIBS) $(XLOADLIBES)

# May as well separate linking from compiling, just in case.
CCLD = $(CC)
link_command = $(CCLD) -Fe$@ $(LDFLAGS) 

# When we link with Kpathsea, have to take account that it might be a
# shared library, etc.
kpathsea_link = $(link_command)
# End of programs.mk.
# library.mk -- stuff only useful for libraries.
AR = lib
ARFLAGS = -out:
RANLIB = ranlib
# End of library.mk.

kpathsea_srcdir_parent = $(srcdir)/../..
kpathsea_dir_parent = ../..
.SUFFIXES: .cc .obj
.cc.obj:
	$(CXX) $(CXXFLAGS) -c -Tp$<

CXXFLAGS = -nologo -MD -O2 -DHAVE_CONFIG_H -DWIN32=1 -DLINKDLL=1 \
 $(XXCFLAGS) -I. -I.. -I$(kpathsea_dir_parent) \
 -I$(kpathsea_srcdir_parent) -I$(LIBXPDFDIR) \
 -I$(LIBXPDFDIR)/xpdf -I$(LIBXPDFDIR)/goo -I$(LIBXPDFSRCDIR)/xpdf \
 -I$(LIBXPDFSRCDIR)/goo -I$(ZLIBDIR)
CXX = cl

# XCFLAGS=-Wstrict-prototypes -Wmissing-prototypes 

LIBPNGDIR=../../../libs/libpng
LIBPNGSRCDIR=$(srcdir)/$(LIBPNGDIR)

ZLIBDIR=../../../libs/zlib
ZLIBSRCDIR=$(srcdir)/$(ZLIBDIR)

LIBXPDFDIR=../../../libs/xpdf
LIBXPDFSRCDIR=$(srcdir)/$(LIBXPDFDIR)

LIBMD5DIR=../libmd5
LIBMD5SRCDIR=$(srcdir)/$(LIBMD5DIR)

XCPPFLAGS=-I.. -I$(srcdir)/.. -I../.. -I$(srcdir)/../.. \
-I$(LIBPNGDIR) -I$(LIBMD5DIR) -I$(LIBMD5SRCDIR) \
-I$(LIBPNGSRCDIR) -I$(ZLIBDIR) -I$(ZLIBSRCDIR) -DpdfTeX

OBJS = epdf.obj mapfile.obj utils.obj vfpacket.obj pkin.obj \
 writefont.obj writet1.obj writet3.obj writezip.obj writeenc.obj \
 writettf.obj writejpg.obj writepng.obj writeimg.obj pdftoepdf.obj \
 writejbig2.obj avl.obj avlstuff.obj subfont.obj md5.obj regex.obj tounicode.obj

all: libpdf.lib

libpdf.lib: $(OBJS)
	$(AR) $(ARFLAGS)$@  $(OBJS)

pdftosrc.obj: $(srcdir)/pdftosrc.cc
md5.obj: md5.c
md5.c: $(LIBMD5DIR)/md5.c
	cp $(LIBMD5DIR)/md5.c $@

regex.obj: regex/regex.c
	$(compile) $<

utils.obj: utils.c
	$(compile) $<

writeimg.obj: writeimg.c
	$(compile) $<

writejpg.obj: writejpg.c
	$(compile) $<

writepng.obj: writepng.c
	$(compile) $<

writejbig2.obj: writejbig2.c
	$(compile) $<

.c.obj:
	$(compile) $<

clean:
	rm -f *~ kk kkk kkkk *.obj libpdf.lib *.exe

distclean maintainer-clean extraclean: clean
	rm -f Makefile config.log config.status

depend: mkdep.sh
	mkdep.sh

include depend.mk
