-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
51 lines (38 loc) · 1.74 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
CC = gcc
CFLAGS = -g -Wall -std=c99 -c
LDFLAGS = -g -Wall
VGFLAGS = --tool=memcheck --leak-check=full --dsymutil=yes --track-origins=yes
all: PartA PartB
PartA: imageloader.o imageloadertester.o steganography.o
$(CC) $(LDFLAGS) -o imageloadertester imageloader.o imageloadertester.o
$(CC) $(LDFLAGS) -o steganography steganography.o imageloader.o
PartB: imageloader.o gameoflife.o
$(CC) $(LDFLAGS) -o gameOfLife gameoflife.o imageloader.o
imageloader: imageloader.o imageloadertester.o
$(CC) $(LDFLAGS) -o imageloadertester imageloader.o imageloadertester.o
echo "Running imageloadertest"
./imageloadertester testInputs/JohnConway.ppm > studentOutputs/JohnConway.ppm
diff testInputs/JohnConway.ppm studentOutputs/JohnConway.ppm
echo "Diff check: The above lines were different than expected. If no lines show up, then this passed"
imagememcheck: imageloader
echo "Running memory check on imageloadertest"
valgrind $(VGFLAGS) ./imageloadertester testInputs/JohnConway.ppm > studentOutputs/JohnConway.ppm
steganography: imageloader.o steganography.o
echo "Running steganography"
$(CC) $(LDFLAGS) -o steganography steganography.o imageloader.o
./steganography testInputs/JohnConway.ppm > studentOutputs/secretMessage.ppm
steganographymemcheck: steganography
valgrind $(VGFLAGS) ./steganography testInputs/JohnConway.ppm > studentOutputs/secretMessage.ppm
gameoflife: imageloader.o gameoflife.o
$(CC) $(LDFLAGS) -o gameOfLife gameoflife.o imageloader.o
echo "Successfully compiled"
echo "Run ./frames.csh for various tests"
gameoflifememcheck: gameoflife
valgrind $(VGFLAGS) ./gameOfLife testInputs/JohnConway.ppm 0x1808 > studentOutputs/temp.ppm
%.o: %.c
$(CC) $(CFLAGS) $<
clean:
rm -f *.o
rm -f gameOfLife
rm -f steganography
rm -f imageloadertester