1 $NetBSD: patch-ac,v 1.7 2005/01/19 09:05:44 adam Exp $
3 --- Makefile.orig 2004-12-17 17:53:47.000000000 +0000
7 +LIB_OBJS=price_conv.o gdc.o gdc_pie.o gdchart.o array_alloc.o
8 # gcc 2.7.1 or better is required
10 # CFLAGS=-g -ansi -pedantic
11 @@ -6,11 +6,11 @@ CC=gcc
12 # ----- build path -----
18 # ----- install locations -----
19 -PREFIX_INC = /usr/local/include
20 -PREFIX_LIB = /usr/local/lib
21 +PREFIX_INC = ${PREFIX}/include
22 +PREFIX_LIB = ${PREFIX}/lib
24 # INCLUDEDIRS=-I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include
26 @@ -18,8 +18,8 @@ PREFIX_LIB = /usr/local/lib
27 # GDChart requires the gd library - www.boutell.com/gd/
28 # gd 2.0.28 or better is required (GIF support has returned to libgd)
29 # if it's not installed in a standard location edit these lines for your installation
30 -GD_INCL=/usr/local/include/
31 -GD_LD=/usr/local/lib/
32 +GD_INCL=${PREFIX}/include/
35 # a static libgd is also available
37 @@ -63,70 +63,70 @@ LIB_PATHS = -L$(GD_LD) -L$(GDC_LD)
38 # LIB_PATHS = $(LIB_PATHS) -Xlinker -rpath -Xlinker $(PNG_LD) -Xlinker -rpath -Xlinker $(ZLIB_LD)
41 -all: libgdc.a gdc_samp1 gdc_samp2 gdc_pie_samp ft_samp
44 # --- compile the samples ---
45 gdc_pie_samp.o: $(GDC_INCL)gdc.h $(GDC_INCL)gdcpie.h gdc_pie_samp.c
46 - $(CC) $(CFLAGS) -I$(GDC_INCL) $(DEFS) -c gdc_pie_samp.c
47 + ${LIBTOOL} $(CC) $(CFLAGS) -I$(GDC_INCL) $(DEFS) -c gdc_pie_samp.c
49 gdc_samp1.o: $(GDC_INCL)gdc.h $(GDC_INCL)gdchart.h gdc_samp1.c
50 - $(CC) $(CFLAGS) -I$(GDC_INCL) $(DEFS) -c gdc_samp1.c
51 + ${LIBTOOL} $(CC) $(CFLAGS) -I$(GDC_INCL) $(DEFS) -c gdc_samp1.c
53 gdc_samp2.o: $(GDC_INCL)gdc.h $(GDC_INCL)gdchart.h gdc_samp2.c
54 - $(CC) $(CFLAGS) -I$(GDC_INCL) $(DEFS) -c gdc_samp2.c
55 + ${LIBTOOL} $(CC) $(CFLAGS) -I$(GDC_INCL) $(DEFS) -c gdc_samp2.c
57 ft_samp.o: $(GDC_INCL)gdc.h $(GDC_INCL)gdchart.h ft_samp.c
58 - $(CC) $(CFLAGS) -I$(GDC_INCL) $(DEFS) -c ft_samp.c
59 + ${LIBTOOL} $(CC) $(CFLAGS) -I$(GDC_INCL) $(DEFS) -c ft_samp.c
61 # --- link the samples ---
62 -gdc_samp1: $(GDC_LD)libgdc.a gdc_samp1.o $(GD_LD)/$(GD_LIB) $(GDC_LD)/$(GDC_LIB)
63 - $(CC) -o gdc_samp1 \
64 +gdc_samp1: $(GDC_LD)libgdchart.a gdc_samp1.o $(GD_LD)/$(GD_LIB) $(GDC_LD)/$(GDC_LIB)
65 + ${LIBTOOL} --mode=link $(CC) -o gdc_samp1 \
68 - -lgdc -lgd -lz -lpng $(LIBS) -lm
69 + -lgdchart -lgd -lz -lpng $(LIBS) -lm
71 -gdc_samp2: $(GDC_LD)libgdc.a gdc_samp2.o $(GD_LD)/$(GD_LIB) $(GDC_LD)/$(GDC_LIB)
72 - $(CC) -o gdc_samp2 \
73 +gdc_samp2: $(GDC_LD)libgdchart.a gdc_samp2.o $(GD_LD)/$(GD_LIB) $(GDC_LD)/$(GDC_LIB)
74 + ${LIBTOOL} --mode=link $(CC) -o gdc_samp2 \
75 gdc.o gdchart.o price_conv.o \
78 - -lgdc -lgd -lz -lpng $(LIBS) -lm
79 + -lgdchart -lgd -lz -lpng $(LIBS) -lm
81 -gdc_pie_samp: $(GDC_LD)libgdc.a gdc_pie_samp.o $(GD_LD)/$(GD_LIB) $(GDC_LD)/$(GDC_LIB)
82 - $(CC) -o gdc_pie_samp \
83 +gdc_pie_samp: $(GDC_LD)libgdchart.a gdc_pie_samp.o $(GD_LD)/$(GD_LIB) $(GDC_LD)/$(GDC_LIB)
84 + ${LIBTOOL} --mode=link $(CC) -o gdc_pie_samp \
85 gdc.o gdc_pie.o price_conv.o \
88 - -lgdc -lgd -lz -lpng $(LIBS) -lm
89 + -lgdchart -lgd -lz -lpng $(LIBS) -lm
91 -ft_samp: $(GDC_LD)libgdc.a ft_samp.o $(GD_LD)/$(GD_LIB) $(GDC_LD)/$(GDC_LIB)
93 +ft_samp: $(GDC_LD)libgdchart.a ft_samp.o $(GD_LD)/$(GD_LIB) $(GDC_LD)/$(GDC_LIB)
94 + ${LIBTOOL} --mode=link $(CC) -o ft_samp \
95 gdc.o gdchart.o price_conv.o \
98 - -lgdc -lgd -lz -lpng $(LIBS) -lm
99 + -lgdchart -lgd -lz -lpng $(LIBS) -lm
101 # --- compile the lib ---
102 gdc.h: $(GD_INCL)gd.h $(GD_INCL)gdfonts.h $(GD_INCL)gdfontt.h $(GD_INCL)gdfontmb.h $(GD_INCL)gdfontg.h $(GD_INCL)gdfontl.h $(GDC_INCL)array_alloc.h
104 price_conv.o: price_conv.c
105 - $(CC) $(CFLAGS) -c price_conv.c
106 + ${LIBTOOL} --mode=compile $(CC) $(CFLAGS) -c price_conv.c
108 gdc.o: gdc.c $(GDC_INCL)gdc.h
109 - $(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) $(DEFS) -c gdc.c
110 + ${LIBTOOL} --mode=compile $(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) $(DEFS) -c gdc.c
112 gdc_pie.o: $(GDC_INCL)gdc.h $(GDC_INCL)gdcpie.h gdc_pie.c
113 - $(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) $(DEFS) -c gdc_pie.c
114 + ${LIBTOOL} --mode=compile $(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) $(DEFS) -c gdc_pie.c
116 gdchart.o: $(GDC_INCL)gdc.h $(GDC_INCL)gdchart.h gdchart.c
117 - $(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) $(DEFS) -c gdchart.c
118 + ${LIBTOOL} --mode=compile $(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) $(DEFS) -c gdchart.c
120 array_alloc.o: array_alloc.c array_alloc.h
121 - $(CC) $(CFLAGS) -c array_alloc.c
122 + ${LIBTOOL} --mode=compile $(CC) $(CFLAGS) -c array_alloc.c
124 -libgdc.a: price_conv.o gdc.o gdc_pie.o gdchart.o array_alloc.o
125 - ar cr libgdc.a gdc.o gdchart.o gdc_pie.o price_conv.o array_alloc.o
127 +libgdchart.a: ${LIB_OBJS}
128 + ${LIBTOOL} --mode=link ${CC} -o libgdchart.la ${LIB_OBJS:.o=.lo} \
129 + -L${GD_LD} -lgd -version-info 0:11 -rpath ${PREFIX}/lib
131 # --- supporting libraries ---
132 # should be compile & installed separately