generated from detiuaveiro/image8bit-pub
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (60 loc) · 2.2 KB
/
Makefile
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
# make # to compile files and create the executables
# make pgm # to download example images to the pgm/ dir
# make setup # to setup the test files in test/ dir
# make tests # to run basic tests
# make clean # to cleanup object files and executables
# make cleanobj # to cleanup object files only
CFLAGS = -Wall -O2 -g
PROGS = imageTool imageTest
TESTS = test1 test2 test3 test4 test5 test6 test7 test8 test9
# Default rule: make all programs
all: $(PROGS)
imageTest: imageTest.o image8bit.o instrumentation.o error.o
imageTest.o: image8bit.h instrumentation.h
imageTool: imageTool.o image8bit.o instrumentation.o error.o
imageTool.o: image8bit.h instrumentation.h
# Rule to make any .o file dependent upon corresponding .h file
%.o: %.h
pgm:
wget -O- https://sweet.ua.pt/jmr/aed/pgm.tgz | tar xzf -
.PHONY: setup
setup: test/
test/:
wget -O- https://sweet.ua.pt/jmr/aed/test.tgz | tar xzf -
@#mkdir -p $@
@#curl -s -o test/aed-trab1-test.zip https://sweet.ua.pt/mario.antunes/aed/test/aed-trab1-test.zip
@#unzip -q -o test/aed-trab1-test.zip -d test/
test1: $(PROGS) setup
./imageTool test/original.pgm neg save neg.pgm
cmp neg.pgm test/neg.pgm
test2: $(PROGS) setup
./imageTool test/original.pgm thr 128 save thr.pgm
cmp thr.pgm test/thr.pgm
test3: $(PROGS) setup
./imageTool test/original.pgm bri .33 save bri.pgm
cmp bri.pgm test/bri.pgm
test4: $(PROGS) setup
./imageTool test/original.pgm rotate save rotate.pgm
cmp rotate.pgm test/rotate.pgm
test5: $(PROGS) setup
./imageTool test/original.pgm mirror save mirror.pgm
cmp mirror.pgm test/mirror.pgm
test6: $(PROGS) setup
./imageTool test/original.pgm crop 100,100,100,100 save crop.pgm
cmp crop.pgm test/crop.pgm
test7: $(PROGS) setup
./imageTool test/small.pgm test/original.pgm paste 100,100 save paste.pgm
cmp paste.pgm test/paste.pgm
test8: $(PROGS) setup
./imageTool test/small.pgm test/original.pgm blend 100,100,.33 save blend.pgm
cmp blend.pgm test/blend.pgm
test9: $(PROGS) setup
./imageTool test/original.pgm blur 7,7 save blur.pgm
cmp blur.pgm test/blur.pgm
.PHONY: tests
tests: $(TESTS)
# Make uses builtin rule to create .o from .c files.
cleanobj:
rm -f *.o
clean: cleanobj
rm -f $(PROGS)