File: makefile

package info (click to toggle)
giflib 5.1.4-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 3,952 kB
  • sloc: sh: 11,565; ansic: 6,901; xml: 2,401; makefile: 278
file content (162 lines) | stat: -rw-r--r-- 5,833 bytes parent folder | download | duplicates (2)
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
# Regression-test suite for the giflib library and tools
# All utilities have tests except gifbg, gifcolor, and gifhisto.

.SUFFIXES: .gif .rgb

# This is what to do by default
test: render-regress \
	gifbuild-regress \
	gifclrmp-regress \
	gifecho-regress \
	giffilter-regress \
	giffix-regress \
	gifsponge-regress \
	giftext-regress \
	giftool-regress \
	gifwedge-regress
	@echo "No output is good news"

rebuild: render-rebuild \
		gif2rgb-rebuild \
		gifclrmp-rebuild \
		gifecho-rebuild \
		giffix-rebuild \
		giftext-rebuild \
		gifwedge-rebuild

UTILS = ../util
PICS = ../pic

GIFS := $(shell ls ../pic/*.gif)

# Test decompression and rendering by unpacking images,
# converting them to RGB, and comparing that result to a check file.
render-regress:
	@for test in $(GIFS); \
	do \
	    stem=`basename $${test} | sed -e "s/.gif$$//"`; \
	    if echo "Testing RGB rendering of $${test}" >&2; \
	    $(UTILS)/gif2rgb -1 -o /tmp/regress $${test} 2>&1; \
	    then cmp $${stem}.rgb /tmp/regress; \
	    else echo "*** Nonzero return status on $${test}!"; exit 1; fi; \
	done
	@rm -f /tmp/regress
render-rebuild:
	@for test in $(GIFS); do \
		stem=`basename $${test} | sed -e "s/.gif$$//"`; \
		echo "Remaking $${stem}.rgb"; \
		$(UTILS)/gif2rgb -1 -o $${stem}.rgb $${test}; \
	done

gif2rgb-rebuild:
	@echo "Rebuilding gif2rgb checkfile."
	@$(UTILS)/gif2rgb -c 3 -s 100 100 <gifgrid.rgb | $(UTILS)/gifbuild -d >gifgrid.ico
gif2rgb-regress:
	@echo "gif2rgb: Checking idempotency"
	@$(UTILS)/gif2rgb -c 3 -s 100 100 <gifgrid.rgb | $(UTILS)/gifbuild -d | diff -u gifgrid.ico -

gifbuild-regress:
	@echo "gifbuild: basic sanity check"
	@$(UTILS)/gifbuild -d <$(PICS)/treescap.gif | diff -u treescap.ico -
	@echo "gifbuild: Checking idempotency on an icon file."
	@$(UTILS)/gifbuild <$(PICS)/sample.ico | $(UTILS)/gifbuild -d >/tmp/sample-1.ico; $(UTILS)/gifbuild </tmp/sample-1.ico | $(UTILS)/gifbuild -d >/tmp/sample-2.ico; diff -u /tmp/sample-1.ico /tmp/sample-2.ico; rm /tmp/sample-*.ico
	@echo "gifbuild: Checking idempotency on an animation."
	@$(UTILS)/gifbuild -d <$(PICS)/fire.gif >/tmp/fire1.ico
	@$(UTILS)/gifbuild </tmp/fire1.ico >/tmp/fire2.gif
	@$(UTILS)/gifbuild -d </tmp/fire2.gif >/tmp/fire2.ico
	@diff -u /tmp/fire1.ico /tmp/fire2.ico

gifclrmp-regress:
	@for test in $(GIFS); \
	do \
	    stem=`basename $${test} | sed -e "s/.gif$$//"`; \
	    if echo "gifclrmap: Checking colormap of $${test}" >&2; \
	    $(UTILS)/gifclrmp <$${test} >/tmp/regress 2>&1; \
	    then diff -u $${stem}.map /tmp/regress; \
	    else echo "*** Nonzero return status on $${test}!"; exit 1; fi; \
	done
	@rm -f /tmp/regress
gifclrmp-rebuild:
	@for test in $(GIFS); do \
		stem=`basename $${test} | sed -e "s/.gif$$//"`; \
		echo "Remaking $${stem}.map"; \
		$(UTILS)/gifclrmp <$${test} >$${stem}.map; \
	done

gifecho-rebuild:
	@echo "Rebuilding gifecho test."
	@$(UTILS)/gifecho -t "foobar" | $(UTILS)/gifbuild -d >foobar.ico
gifecho-regress:
	@echo "gifecho: Testing gifecho behavior"
	@$(UTILS)/gifecho -t "foobar" | $(UTILS)/gifbuild -d | diff -u foobar.ico -

giffilter-regress:
	@for test in $(GIFS); \
	do \
	    stem=`basename $${test} | sed -e "s/.gif$$//"`; \
	    if echo "giffiltr: Testing copy of $${test}" >&2; \
	    $(UTILS)/giffilter <$${test} | $(UTILS)/gif2rgb >/tmp/regress 2>&1; \
	    then cmp $${stem}.rgb /tmp/regress; \
	    else echo "*** Nonzero return status on $${test}!"; exit 1; fi; \
	done
	@rm -f /tmp/regress

giffix-rebuild:
	@echo "Rebuilding giffix test."
	@head --bytes=-20 <$(PICS)/treescap.gif | $(UTILS)/giffix 2>/dev/null | $(UTILS)/gifbuild -d >giffixed.ico
giffix-regress:
	@echo "giffix: Testing giffix behavior"
	@head --bytes=-20 <$(PICS)/treescap.gif | $(UTILS)/giffix 2>/dev/null | $(UTILS)/gifbuild -d | diff -u giffixed.ico -

gifinto-regress:
	@echo "gifinto: Checking behavior on short files."
	@rm -f /tmp/giflib.tmp
	@$(UTILS)/gifinto <$(PICS)/porsche.gif /tmp/giflib.tmp
	@if test ! -f /tmp/giflib.tmp; then echo "gifinto failed to create a file when it should have."; fi
	@rm -f /tmp/giflib.tmp
	@echo "0123456789" | $(UTILS)/gifinto /tmp/giflib.tmp 2>/dev/null
	@if test -f /tmp/giflib.tmp; then echo "gifinto created a file when it shouldn't have."; fi
	@rm -f /tmp/giflib.tmp

gifsponge-regress:
	@for test in $(GIFS); \
	do \
	    stem=`basename $${test} | sed -e "s/.gif$$//"`; \
	    if echo "gifsponge: Testing copy of $${test}" >&2; \
	    $(UTILS)/gifsponge <$${test} | $(UTILS)/gif2rgb >/tmp/regress 2>&1; \
	    then cmp $${stem}.rgb /tmp/regress; \
	    else echo "*** Nonzero return status on $${test}!"; exit 1; fi; \
	done
	@rm -f /tmp/regress

giftext-regress:
	@for test in $(GIFS); \
	do \
	    stem=`basename $${test} | sed -e "s/.gif$$//"`; \
	    if echo "giftext: Checking text dump of $${test}" >&2; \
	    $(UTILS)/giftext <$${test} >/tmp/regress 2>&1; \
	    then diff -u $${stem}.dmp /tmp/regress; \
	    else echo "*** Nonzero return status on $${test}!"; exit 1; fi; \
	done
	@rm -f /tmp/regress
giftext-rebuild:
	@for test in $(GIFS); do \
		stem=`basename $${test} | sed -e "s/.gif$$//"`; \
		echo "Remaking $${stem}.dmp"; \
		$(UTILS)/giftext <$${test} >$${stem}.dmp; \
	done

giftool-regress:
	@echo "giftool: Checking that expensive copy via giftool is faithful."
	@$(UTILS)/giftool <$(PICS)/gifgrid.gif | $(UTILS)/gif2rgb | cmp - gifgrid.rgb
	@echo "giftool: Checking that it de-interlaces correctly."
	@$(UTILS)/giftool -i on <$(PICS)/treescap-interlaced.gif | $(UTILS)/gif2rgb | cmp - treescap.rgb
	@echo "giftool: Checking that it interlaces correctly."
	@$(UTILS)/giftool -i off <$(PICS)/treescap.gif | $(UTILS)/gif2rgb | cmp - treescap-interlaced.rgb

gifwedge-rebuild:
	@echo "Remaking the gifwedge test."
	@$(UTILS)/gifwedge >wedge.gif
gifwedge-regress:
	@echo "gifwedge: Checking wedge generation."
	@$(UTILS)/gifwedge | cmp - wedge.gif