File: Makefile

package info (click to toggle)
jbigkit 2.0-2%2Bdeb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,100 kB
  • sloc: ansic: 5,626; makefile: 200
file content (154 lines) | stat: -rw-r--r-- 5,717 bytes parent folder | download
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
# Unix makefile for the JBIG-KIT PBM tools
# $Id: Makefile 1293 2008-08-25 22:26:39Z mgk25 $

# Select an ANSI/ISO C compiler here, e.g. GNU gcc is recommended
CC = gcc

# Options for the compiler
CFLAGS = -g -Wall -ansi -pedantic -I../libjbig # --coverage
export LD_LIBRARY_PATH = ../libjbig/.libs

.PHONY: all test test82 test85
.SUFFIXES: .1 .5 .txt $(SUFFIXES)

all: pbmtojbg jbgtopbm pbmtojbg85 jbgtopbm85 \
	pbmtojbg.txt jbgtopbm.txt pbm.txt pgm.txt

pbmtojbg: pbmtojbg.o ../libjbig/libjbig.a
	$(CC) $(CFLAGS) -o pbmtojbg pbmtojbg.o -L../libjbig/.libs -ljbig

jbgtopbm: jbgtopbm.o ../libjbig/libjbig.a
	$(CC) $(CFLAGS) -o jbgtopbm jbgtopbm.o -L../libjbig/.libs -ljbig

pbmtojbg85: pbmtojbg85.o ../libjbig/libjbig.a
	$(CC) $(CFLAGS) -o pbmtojbg85 pbmtojbg85.o -L../libjbig/.libs -ljbig

jbgtopbm85: jbgtopbm85.o ../libjbig/libjbig.a
	$(CC) $(CFLAGS) -o jbgtopbm85 jbgtopbm85.o -L../libjbig/.libs -ljbig

jbgtopbm.o: jbgtopbm.c ../libjbig/jbig.h
pbmtojbg.o: pbmtojbg.c ../libjbig/jbig.h
jbgtopbm85.o: jbgtopbm85.c ../libjbig/jbig85.h
pbmtojbg85.o: pbmtojbg85.c ../libjbig/jbig85.h

../libjbig/libjbig.a: ../libjbig/jbig.c ../libjbig/jbig.h \
	../libjbig/jbig_ar.c ../libjbig/jbig_ar.h
	make -C ../libjbig libjbig.a

test: test82 test85

test82: pbmtojbg jbgtopbm
	make IMG=ccitt1     OPTIONSP=                      dotest1
	make IMG=ccitt2     OPTIONSP=                      dotest1
	make IMG=ccitt3     OPTIONSP=                      dotest1
	make IMG=xvlogo    "OPTIONSP=-d 3"                 dotest1
	make IMG=sandra     OPTIONSP=      OPTIONSJ=       dotest2g
	make IMG=sandra     OPTIONSP=-b    OPTIONSJ=-b     dotest2g
	make IMG=sandra     OPTIONSP=-q    OPTIONSJ=       dotest2g
	make IMG=sandra    "OPTIONSP=-o 0" OPTIONSJ=       dotest2g
	make IMG=sandra    "OPTIONSP=-o 2" OPTIONSJ=       dotest2g
	make IMG=multi      OPTIONSP=      OPTIONSJ=       dotest2g
	make IMG=multi      OPTIONSP=-b    OPTIONSJ=-b     dotest2g
	make IMG=mx        "OPTIONSP=-q -s 3 -m 128"       dotest1
	make IMG=mx        "OPTIONSP=-q -s 3 -m 128"       dotest2b
	make IMG=mx        "OPTIONSP=-q -s 3 -m 128 -p 92" dotest2b
	make IMG=mx        "OPTIONSP=-q -Y -1"             dotest2b
	make IMG=mx        "OPTIONSP=-Y -1"                dotest2b
	rm -f test-*.jbg test-*.pbm test-*.pgm
	./jbgtopbm ../examples/ccitt1.jbg | ./pbmtojbg > test-ccitt1.jbg
	cmp ../examples/ccitt1.jbg test-ccitt1.jbg
	rm -f test-*.jbg test-*.pbm test-*.pgm
	./jbgtopbm < ../examples/ccitt1.jbg | ./pbmtojbg - test-ccitt1.jbg
	cmp ../examples/ccitt1.jbg test-ccitt1.jbg
	rm -f test-*.jbg test-*.pbm test-*.pgm
	./jbgtopbm < ../examples/ccitt1.jbg - test-ccitt1.pbm ; \
	  ./pbmtojbg test-ccitt1.pbm test-ccitt1.jbg
	cmp ../examples/ccitt1.jbg test-ccitt1.jbg
	rm -f test-*.jbg test-*.pbm test-*.pgm
	./jbgtopbm ../examples/ccitt1.jbg test-ccitt1.pbm ; \
	  ./pbmtojbg test-ccitt1.pbm >test-ccitt1.jbg
	cmp ../examples/ccitt1.jbg test-ccitt1.jbg
	rm -f test-*.jbg test-*.pbm test-*.pgm
	@echo
	@echo "The pbmtools have PASSED the functional tests. Good!"
	@echo

dotest1:
	./jbgtopbm ../examples/$(IMG).jbg test-$(IMG).pbm
	./pbmtojbg $(OPTIONSP) test-$(IMG).pbm test-$(IMG).jbg
	cmp test-$(IMG).jbg ../examples/$(IMG).jbg

dotest2b:
	./pbmtojbg $(OPTIONSP) test-$(IMG).pbm test-$(IMG).jbg
	./jbgtopbm $(OPTIONSJ) test-$(IMG).jbg test-$(IMG)-2.pbm
	cmp test-$(IMG).pbm test-$(IMG)-2.pbm

dotest2g:
	./pbmtojbg $(OPTIONSP) ../examples/$(IMG).pgm test-$(IMG).jbg
	./jbgtopbm $(OPTIONSJ) test-$(IMG).jbg test-$(IMG).pgm
	cmp test-$(IMG).pgm ../examples/$(IMG).pgm

test85: pbmtojbg jbgtopbm pbmtojbg85 jbgtopbm85 test-t82.pbm
	export LD_LIBRARY_PATH=`pwd`/../libjbig/.libs
	echo $(LD_LIBRARY_PATH)
	make IMG=t82 "OPTIONSP=-p 0"      dotest85
	make IMG=t82 "OPTIONSP=-p 8"      dotest85
	make IMG=t82 "OPTIONSP=-p 8 -r"   dotest85b
	make IMG=t82 "OPTIONSP=-p 64"     dotest85
	make IMG=t82 "OPTIONSP=-p 72"     dotest85
	make IMG=t82 "OPTIONSP=-s 2 -C c" dotest85
	make IMG=t82 "OPTIONSP=-s 99999"  dotest85
	make IMG=t82 "OPTIONSP=-Y 9999 0" dotest85
	make IMG=t82 "OPTIONSP=-Y 1951 0" dotest85
	make IMG=t82 "OPTIONSP=-Y -1 127" dotest85
	make IMG=t82 "OPTIONSP=-Y -1 128" dotest85
	make IMG=t82 "OPTIONSP=-Y -1 1919" dotest85
	make IMG=t82 "OPTIONSP=-Y -1 1920" dotest85
	make IMG=t82 "OPTIONSP=-Y -1 1949" dotest85
	make IMG=t82 "OPTIONSP=-Y -1 1950" dotest85
	make IMG=ccitt1 dotest85
	make IMG=ccitt2 dotest85
	make IMG=ccitt3 dotest85
	rm -f test-*.jbg test-*.jbg85 test-*.pbm
	@echo
	@echo "The T.85 pbmtools have PASSED the functional tests. Good!"
	@echo

dotest85: test-$(IMG).pbm
	./pbmtojbg85  $(OPTIONSP) test-$(IMG).pbm test-$(IMG).jbg85
	ls -l test-$(IMG).jbg85
	./jbgtopbm test-$(IMG).jbg85 test-$(IMG).pbm85
	cmp test-$(IMG).pbm test-$(IMG).pbm85
	rm test-$(IMG).pbm85
	./jbgtopbm85 test-$(IMG).jbg85 test-$(IMG).pbm85
	cmp test-$(IMG).pbm test-$(IMG).pbm85
	rm test-$(IMG).pbm85
	./jbgtopbm85 -B 1 test-$(IMG).jbg85 test-$(IMG).pbm85
	cmp test-$(IMG).pbm test-$(IMG).pbm85

dotest85b: test-$(IMG).pbm
	./pbmtojbg -f $(OPTIONSP) test-$(IMG).pbm test-$(IMG).jbg85
	ls -l test-$(IMG).jbg85
	./jbgtopbm test-$(IMG).jbg85 test-$(IMG).pbm85
	cmp test-$(IMG).pbm test-$(IMG).pbm85
	rm test-$(IMG).pbm85
	./jbgtopbm85 test-$(IMG).jbg85 test-$(IMG).pbm85
	cmp test-$(IMG).pbm test-$(IMG).pbm85
	rm test-$(IMG).pbm85
	./jbgtopbm85 -B 1 test-$(IMG).jbg85 test-$(IMG).pbm85
	cmp test-$(IMG).pbm test-$(IMG).pbm85

test-%.pbm: ../examples/%.jbg
	./jbgtopbm $< $@

test-t82.pbm:
	make -C ../libjbig tstcodec
	../libjbig/tstcodec $@

.1.txt .5.txt:
	groff -man -Tascii -P -c -P -b -P -u $< >$@

clean:
	rm -f *.o *~ core pbmtojbg jbgtopbm pbmtojbg85 jbgtopbm85
	rm -f test-*.jbg test-*.pbm test-*.pgm test-*.jbg85 test-*.pbm85
	rm -f *.gcda *.gcno