File: makefile.sample

package info (click to toggle)
graphviz 2.8-3%2Betch1
  • links: PTS
  • area: main
  • in suites: etch
  • size: 20,480 kB
  • ctags: 22,071
  • sloc: ansic: 163,260; cpp: 36,565; sh: 25,024; yacc: 2,358; tcl: 1,808; makefile: 1,745; cs: 805; perl: 801; ml: 649; awk: 160; lex: 153; python: 105; ruby: 32; php: 6
file content (171 lines) | stat: -rwxr-xr-x 5,463 bytes parent folder | download | duplicates (10)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171

#Command for building a shared library. This varies depending on the OS.

LINK_SHARED_HEAD=ld -shared
LINK_SHARED_TAIL=

#If the ar command fails on your system, consult the ar manpage
#for your system. 
AR=ar

CFLAGS=-g -DHAVE_LIBPNG -DHAVE_LIBZ -DHAVE_LIBJPEG -DHAVE_MALLOC_H -DHAVE_LIBFREETYPE -DHAVE_LIBXPM

LIBS=-lgd  -lpng -lz -ljpeg -lfreetype -lm

INCLUDEDIRS=-I. -I/usr/include/freetype2 -I/usr/include/X11 -I/usr/X11R6/include/X11 -I/usr/local/include

LIBDIRS=-L/usr/local/lib -L/usr/lib/X11 -L/usr/X11R6/lib

INSTALL_LIB=/usr/lib

INSTALL_INCLUDE=/usr/include

INSTALL_BIN=/usr/bin

#
#
# Changes should not be required below here.
#
#

# Update these with each release!

MAJOR_VERSION=2
VERSION=2.0.3

COMPILER=gcc -fPIC

CC=$(COMPILER) $(INCLUDEDIRS)
LINK=$(CC) $(LIBDIRS) $(LIBS)

PROGRAMS=$(BIN_PROGRAMS) $(TEST_PROGRAMS)

BIN_PROGRAMS=pngtogd pngtogd2 gdtopng gd2topng gd2copypal gdparttopng webpng gd2togif gdcmpgif giftogd2
TEST_PROGRAMS=gdtest gddemo gd2time gdtestft testac fontsizetest fontwheeltest

default: instructions

instructions:
	@echo Edit this Makefile if you wish. The configure script makes
	@echo reasonable guesses, but as of this writing \(2.0.2\) has not
	@echo been field-tested on a lot of systems.
	@echo
	@echo Second, type \'make install\' as root.
	@echo
	@echo This installs the GD ${VERSION} shared library,
	@echo which is required in order to use the included
	@echo utility programs, and also includes the utility
	@echo programs such as webpng, pngtogd, etc.
	@echo 
	@echo OPTIONAL third step: type \'make test\' to build 
	@echo the optional test programs. Type \'make install\' FIRST.
	@echo
	@echo IF SHARED LIBRARIES WON\'T WORK FOR YOU: 
	@echo Type \'make libgd.a\' to produce a static library,
	@echo which you can install manually in /usr/lib.

test: $(TEST_PROGRAMS)

install: libgd.so.${VERSION} $(BIN_PROGRAMS)
	sh ./install-item 755 pngtogd $(INSTALL_BIN)/pngtogd
	sh ./install-item 755 pngtogd2 $(INSTALL_BIN)/pngtogd2
	sh ./install-item 755 gdtopng $(INSTALL_BIN)/gdtopng
	sh ./install-item 755 gd2topng $(INSTALL_BIN)/gd2topng
	sh ./install-item 755 gd2copypal $(INSTALL_BIN)/gd2copypal
	sh ./install-item 755 gdparttopng $(INSTALL_BIN)/gdparttopng
	sh ./install-item 755 webpng $(INSTALL_BIN)/webpng
	sh ./install-item 755 gd2togif $(INSTALL_BIN)/gd2togif
	sh ./install-item 755 gdcmpgif $(INSTALL_BIN)/gdcmpgif
	sh ./install-item 755 giftogd2 $(INSTALL_BIN)/giftogd2
	sh ./install-item 755 bdftogd $(INSTALL_BIN)/bdftogd
	sh ./install-item 644 gd.h $(INSTALL_INCLUDE)/gd.h
	sh ./install-item 644 gdcache.h $(INSTALL_INCLUDE)/gdcache.h
	sh ./install-item 644 gd_io.h $(INSTALL_INCLUDE)/gd_io.h
	sh ./install-item 644 gdfontg.h $(INSTALL_INCLUDE)/gdfontg.h
	sh ./install-item 644 gdfontl.h $(INSTALL_INCLUDE)/gdfontl.h
	sh ./install-item 644 gdfontmb.h $(INSTALL_INCLUDE)/gdfontmb.h
	sh ./install-item 644 gdfonts.h $(INSTALL_INCLUDE)/gdfonts.h
	sh ./install-item 644 gdfontt.h $(INSTALL_INCLUDE)/gdfontt.h

gddemo: gddemo.o
	$(CC) gddemo.o -o gddemo	$(LIBDIRS) $(LIBS)

testac: testac.o
	$(CC) testac.o -o testac	$(LIBDIRS) $(LIBS)

pngtogd: pngtogd.o
	$(CC) pngtogd.o -o pngtogd	$(LIBDIRS) $(LIBS) 

webpng: webpng.o
	$(CC) webpng.o -o webpng	$(LIBDIRS) $(LIBS)

pngtogd2: pngtogd2.o
	$(CC) pngtogd2.o -o pngtogd2	$(LIBDIRS) $(LIBS)

gdtopng: gdtopng.o
	$(CC) gdtopng.o -o gdtopng	$(LIBDIRS) $(LIBS)

gd2topng: gd2topng.o
	$(CC) gd2topng.o -o gd2topng	$(LIBDIRS) $(LIBS)

gd2togif: gd2togif.o
	$(CC) gd2togif.o -o gd2togif    $(LIBDIRS) $(LIBS)

gdcmpgif: gdcmpgif.o
	$(CC) gdcmpgif.o -o gdcmpgif    $(LIBDIRS) $(LIBS)

giftogd2: giftogd2.o
	$(CC) giftogd2.o -o giftogd2      $(LIBDIRS) $(LIBS)

gd2copypal: gd2copypal.o
	$(CC) gd2copypal.o -o gd2copypal	$(LIBDIRS) $(LIBS)

gdparttopng: gdparttopng.o
	$(CC) gdparttopng.o -o gdparttopng	$(LIBDIRS) $(LIBS)

gdtest: gdtest.o
	$(CC) gdtest.o -o gdtest	$(LIBDIRS) $(LIBS)

gd2time: gd2time.o
	$(CC) gd2time.o -o gd2time	$(LIBDIRS) $(LIBS)

gdtestft: gdtestft.o
	$(CC) --verbose gdtestft.o -o gdtestft $(LIBDIRS) $(LIBS)

fontwheeltest: fontwheeltest.o
	$(CC) --verbose fontwheeltest.o -o fontwheeltest $(LIBDIRS) $(LIBS)

fontsizetest: fontsizetest.o
	$(CC) --verbose fontsizetest.o -o fontsizetest $(LIBDIRS) $(LIBS)

LIBOBJS=gd.o gd_gd.o gd_gd2.o gd_io.o gd_io_dp.o \
		gd_io_file.o gd_ss.o gd_io_ss.o gd_png.o gd_jpeg.o gdxpm.o \
		gdfontt.o gdfonts.o gdfontmb.o gdfontl.o gdfontg.o \
		gdtables.o gdft.o gdcache.o gdkanji.o wbmp.o \
		gd_wbmp.o gdhelpers.o gd_topal.o 

#Shared library. This should work fine on any ELF platform (Linux, etc.) with
#GNU ld or something similarly intelligent. To avoid the chicken-and-egg
#problem, this target also installs the library so that applications can
#actually find it.

libgd.so.${VERSION}: ${LIBOBJS}
	-rm -f libgd.so.${VERSION} 2>/dev/null
	${LINK_SHARED_HEAD} -o libgd.so.${VERSION} ${LIBOBJS} 
	sh ./install-item 644 libgd.so.${VERSION} \
		$(INSTALL_LIB)/libgd.so.${VERSION}
	-rm $(INSTALL_LIB)/libgd.so.${MAJOR_VERSION} 2>/dev/null
	ln -s $(INSTALL_LIB)/libgd.so.${VERSION} \
		$(INSTALL_LIB)/libgd.so.${MAJOR_VERSION}	
	-rm $(INSTALL_LIB)/libgd.so 2>/dev/null
	ln -s $(INSTALL_LIB)/libgd.so.${VERSION} \
		$(INSTALL_LIB)/libgd.so	

#Static library, if you really need one for some reason.
libgd.a: ${LIBOBJS}
	rm -f libgd.a
	$(AR) rc libgd.a ${LIBOBJS}
	-ranlib libgd.a

clean:
	rm -f *.o *.a *.so ${PROGRAMS} test/gdtest.jpg test/gdtest.wbmp test/fttest.png test/fttest.jpg font*test*.png