$NetBSD: patch-aa,v 1.4 2004/08/27 06:29:08 jlam Exp $ --- Makefile.orig Fri Mar 16 19:08:18 2001 +++ Makefile Wed Jul 2 13:09:19 2003 @@ -12,10 +12,10 @@ # SO Extension for shared libs. HAVE_JPEG = 1 -PY_INCLUDE = -I/usr/local/include/python2.0 -LIB_DIRS = -L/usr/local/lib -L/usr/lib -GCC = gcc -CFLAGS = -Wall -fpic -O2 +INC_DIRS = -I${GDCHART_INCLUDE} -I$(GD_INCLUDE) -I$(PYTHON_INCLUDE) +LIB_DIRS = -L${LOCALBASE}/lib -L/usr/lib ${COMPILER_RPATH_FLAG}${LOCALBASE}/lib -L${X11PREFIX}/lib ${COMPILER_RPATH_FLAG}${X11PREFIX}/lib +GCC = ${CC} +CFLAGS ?= -Wall -fpic -O2 # Linux LD = $(GCC) -shared @@ -31,21 +31,19 @@ # 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 - DEFS = ifeq ($(HAVE_JPEG),1) DEFS += -DHAVE_JPEG - LIBJPEG = -ljpeg + LIBS = -ljpeg +endif +ifeq ($(HAVE_LIBFREETYPE),1) + DEFS += -DHAVE_LIBFREETYPE + LIBS += -lfreetype endif -CFLAGS += -I$(GDCHART) $(PY_INCLUDE) $(DEFS) -LDFLAGS = -L$(GDCHART) -L$(GD) $(LIB_DIRS) -LDLIBS = -lgdchart -lgd -lpng -lz $(LIBJPEG) +CFLAGS += ${INC_DIRS} $(DEFS) +LDFLAGS = $(LIB_DIRS) +LDLIBS = -lgdchart -lgd -lpng -lz $(LIBS) TARGET = gdchart$(SO) PY_SRC = gdc_py.c @@ -53,19 +51,11 @@ all: $(TARGET) -$(TARGET): $(LIBGD) $(LIBGDCHART) $(PY_OBJ) +$(TARGET): $(PY_OBJ) $(LD) $(PY_OBJ) $(LDFLAGS) $(LDLIBS) -o $@ $(PY_OBJ): $(PY_SRC) $(GCC) -c $(CFLAGS) $< -$(LIBGD): - make -C $(GD) libgd.a HAVE_JPEG=$(HAVE_JPEG) - -$(LIBGDCHART): - make -C $(GDCHART) libgdchart.a HAVE_JPEG=$(HAVE_JPEG) - clean: - -make -C $(GD) clean - -make -C $(GDCHART) clean -rm -f $(TARGET) $(PY_OBJ)