summaryrefslogtreecommitdiff
path: root/graphics/gdchart/files/patch-makefile
blob: 696ad4f13d4273bb21db4bebc04fdc28c8f30c1c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
--- makefile.orig	Sat Nov  4 02:49:46 2000
+++ makefile	Mon Jun 18 01:15:50 2001
@@ -2,8 +2,8 @@
 GDC_LIB  = .
 
 # GDChart requires the gd library - www.boutell.com/gd/
-GD_INCL  = ../gd-1.8.3
-GD_LIB   = ../gd-1.8.3
+GD_INCL  = $(LOCALBASE)/include/gd
+GD_LIB   = $(LOCALBASE)/lib
 
 # libgd requires libpng
 # PNG_INCL = ../libpng-1.0.8
@@ -30,37 +30,35 @@
 # LIB_PATHS = $(LIB_PATHS) -R$(PNG_LIB) -R$(ZLIB_LIB)
 # LIB_PATHS = $(LIB_PATHS) -Xlinker -rpath -Xlinker $(PNG_LIB) -Xlinker -rpath -Xlinker $(ZLIB_LIB)
 
-CC=gcc
-
-all: gdc_samp1 gdc_samp2 gdc_pie_samp
+all: libgdchart.a
 
 # --- compile the samples ---
 gdc_pie_samp.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdcpie.h gdc_pie_samp.c
-	$(CC) -I$(GDC_INCL) -c gdc_pie_samp.c
+	$(CC) $(CFLAGS) -I$(GDC_INCL) -c gdc_pie_samp.c
 
 gdc_samp1.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdchart.h gdc_samp1.c
-	$(CC) -I$(GDC_INCL) $(JPEG_DEF) -c gdc_samp1.c
+	$(CC) $(CFLAGS) -I$(GDC_INCL) $(JPEG_DEF) -c gdc_samp1.c
 
 gdc_samp2.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gdchart.h gdc_samp2.c
-	$(CC) -I$(GDC_INCL) $(JPEG_DEF) -c gdc_samp2.c
+	$(CC) $(CFLAGS) -I$(GDC_INCL) $(JPEG_DEF) -c gdc_samp2.c
 
 # --- link the samples ---
 gdc_samp1: gdc.o gdchart.o price_conv.o gdc_samp1.o gifencode.o $(GD_LIB)/libgd.a
-	$(CC) -o gdc_samp1 \
+	$(CC) $(CFLAGS) -o gdc_samp1 \
 			 gdc.o gdchart.o price_conv.o gifencode.o \
 			 gdc_samp1.o \
 			 $(LIB_PATHS) \
 			 -lgd -lz -lpng $(JPEG_LK) -lm
 
 gdc_samp2: gdc.o gdchart.o price_conv.o gdc_samp2.o gifencode.o $(GD_LIB)/libgd.a
-	$(CC) -o gdc_samp2 \
+	$(CC) $(CFLAGS) -o gdc_samp2 \
 			 gdc.o gdchart.o price_conv.o gifencode.o \
 			 gdc_samp2.o \
 			 $(LIB_PATHS) \
 			 -lgd -lz -lpng $(JPEG_LK) -lm
 
 gdc_pie_samp: gdc.o gdc_pie.o price_conv.o gdc_pie_samp.o gifencode.o $(GD_LIB)/libgd.a
-	$(CC) -o gdc_pie_samp \
+	$(CC) $(CFLAGS) -o gdc_pie_samp \
 			 gdc.o gdc_pie.o price_conv.o gifencode.o \
 			 gdc_pie_samp.o \
 			 $(LIB_PATHS) \
@@ -68,24 +66,31 @@
 
 # --- compile the lib ---
 gifencode.o: gifencode.c gifencode.h
-	$(CC) -I$(GD_INCL) -c gifencode.c
+	$(CC) $(CFLAGS) -I$(GD_INCL) -c gifencode.c
 
 price_conv.o: price_conv.c
-	$(CC) -c price_conv.c
+	$(CC) $(CFLAGS) -c price_conv.c
 
 gdc.o: gdc.c $(GDC_INCL)/gdc.h $(GDC_INCL)/gifencode.h
-	$(CC) -I$(GD_INCL) -I$(GDC_INCL) $(JPEG_DEF) -c gdc.c
+	$(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) $(JPEG_DEF) -c gdc.c
 
 gdc_pie.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gifencode.h $(GDC_INCL)/gdcpie.h gdc_pie.c
-	$(CC) -I$(GD_INCL) -I$(GDC_INCL) $(JPEG_DEF) -c gdc_pie.c
+	$(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) $(JPEG_DEF) -c gdc_pie.c
 
 gdchart.o: $(GDC_INCL)/gdc.h $(GDC_INCL)/gifencode.h $(GDC_INCL)/gdchart.h gdchart.c
-	$(CC) -I$(GD_INCL) -I$(GDC_INCL) $(JPEG_DEF) -c gdchart.c
+	$(CC) $(CFLAGS) -I$(GD_INCL) -I$(GDC_INCL) $(JPEG_DEF) -c gdchart.c
 
 # --- supporting libraries ---
 # should be compile & installed separately
 # $(GD_LIB)/libgd.a:
 # 	cd $(GD_LIB) ; make -f Makefile libgd.a
+
+libgdchart.a: gdc.o gdc_pie.o gdchart.o price_conv.o gifencode.o
+	$(AR) rc libgdchart.a gdc.o gdc_pie.o gdchart.o price_conv.o \
+	gifencode.o
+	@if [ -x $(RANLIB) ] ; then \
+	  $(RANLIB) libgdchart.a; \
+	fi;
 
 # --- clean ---
 clean: