# Win32 Makefile for Python interface to GDChart. # # This makefile assumes that you have the mingw32 tools installed. Also see # the README. # # Change the following as appropriate: # # HAVE_JPEG Set to 0 to disable JPEG support. # PY_INC Include path for Python headers. # PY_LIBPATH Lib path for Python import library for mingw32. # PY_LIB Python import library. # PNG Path to libpng src/lib. # ZLIB Path to zlib src/lib. # JPEG Path to jpeg-6b src/lib. # GCC The C compiler. Must be some flavor of gcc. # CFLAGS Compiler options. # SO Extension for shared lib. HAVE_JPEG = 1 PY_INC = -Ic:/Python20/include PY_LIBPATH = c:/gcc/lib PY_LIB = -lpython20 PNG = libpng-1.0.9 ZLIB = zlib-1.1.3 JPEG = jpeg-6b GCC = gcc CFLAGS = -Wall -O2 SO = .pyd # Shouldn't need to touch anything below this point. GD = gd-1.8.4 LIBGD = $(GD)/libgd.a GDCHART = gdchart0.10.1dev LIBGDCHART = $(GDCHART)/libgdchart.a LIBPNG = $(PNG)/libpng.a LIBZ = $(ZLIB)/libz.a DEFS = ifeq ($(HAVE_JPEG),1) DEFS += -DHAVE_JPEG LIBJPEG = $(JPEG)/libjpeg.a LSJPEG = -L$(JPEG) LJPEG = -ljpeg endif CFLAGS += -I$(GDCHART) $(PY_INC) $(DEFS) LDFLAGS = -L$(PNG) -L$(ZLIB) $(LSJPEG) -L$(GDCHART) -L$(GD) -L$(PY_LIBPATH) LDLIBS = -lgdchart -lgd -lpng -lz $(LJPEG) $(PY_LIB) TARGET = gdchart$(SO) PY_SRC = gdc_py.c PY_OBJ = $(PY_SRC:.c=.o) all: $(TARGET) $(TARGET): $(LIBPNG) $(LIBZ) $(LIBJPEG) $(LIBGD) $(LIBGDCHART) $(PY_OBJ) dllwrap --dllname $@ --driver-name=gcc --def gdchart.def -o $@ \ -s --entry _DllMain@12 --target=i386-mingw32 \ $(PY_OBJ) $(LDFLAGS) $(LDLIBS) $(PY_OBJ): $(PY_SRC) $(GCC) -c $(CFLAGS) $< $(LIBPNG): make -C $(PNG) -f scripts/makefile.gcc libpng.a $(LIBZ): make -C $(ZLIB) -f nt/Makefile.gcc libz.a ifeq ($(HAVE_JPEG),1) $(LIBJPEG): make -C $(JPEG) -f makefile.ming libjpeg.a endif $(LIBGD): make -C $(GD) libgd.a HAVE_JPEG=$(HAVE_JPEG) $(LIBGDCHART): make -C $(GDCHART) libgdchart.a HAVE_JPEG=$(HAVE_JPEG) clean: -make -C $(PNG) -f scripts/makefile.gcc clean -make -C $(ZLIB) -f nt/Makefile.gcc clean -make -C $(JPEG) -f makefile.ming clean -make -C $(GD) clean -make -C $(GDCHART) clean -rm -f $(TARGET) $(PY_OBJ)