Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
executable file
·94 lines (74 loc) · 3.2 KB
/
Copy pathMakefile
File metadata and controls
executable file
·94 lines (74 loc) · 3.2 KB
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
# Makefile for computer vision hw2
# Your UNI
UNI = ad2718
# VARIOUS VARIABLES (you will need to change some of these)
# The compiler. If you're writing code using c++, change gcc to g++
CC = g++
# Compile time flags. If you want to compile with debugging turned off, remove the -g
CFLAGS = -g
# Libraries to link against. You should only need to link against the math library (-lm).
LFLAGS = -lm
# The utilities object. Leave this as is.
UTILS = vision_utilities.c
UTILSH = vision_utilities.h
# Enter the names of your source files here. If you have header files as well,
# then do not include them here (they will be autoincluded).
P1SRC = p1.cpp
P2SRC = p2.cpp
P3SRC = p3.cpp FoundObject.cpp
P4SRC = p4.cpp FoundObject.cpp PropertyFinder.cpp
# Threshold for binarization. Change this.
THRESHOLD = 142
# This contains a list of various images and other files generated from
# running your programs. By default, it contains the filenames of all files
# generated from running the 'test' target. If you generate any other files,
# make sure this is correct. This list of files is deleted when 'make clean'
# or 'make submit' are run (to prevent submitting all these files).
OUTPUTS_TO_CLEAN = p11.pgm p12.pgm p13.pgm p21.pgm p22.pgm p23.pgm p31.pgm p32.pgm p33.pgm p421.pgm p431.pgm p413.pgm p423.pgm data1 data2 data3
# THE BUILD RULES (you shouldn't need to edit any of these)
# 'make test' builds all 4 programs and then tests them.
# You should check to see that the final output images p4xx.pgm are correct
test: all
./p1 two_objects.pgm $(THRESHOLD) p11.pgm
./p1 many_objects_1.pgm $(THRESHOLD) p12.pgm
./p1 many_objects_2.pgm $(THRESHOLD) p13.pgm
./p2 p11.pgm p21.pgm
./p2 p12.pgm p22.pgm
./p2 p13.pgm p23.pgm
./p3 p21.pgm data1 p31.pgm
./p3 p22.pgm data2 p32.pgm
./p3 p23.pgm data3 p33.pgm
./p4 p22.pgm data1 p421.pgm
./p4 p23.pgm data1 p431.pgm
./p4 p21.pgm data3 p413.pgm
./p4 p22.pgm data3 p423.pgm
# 'make all' builds all 4 programs (but doesn't run them)
all: p1 p2 p3 p4
# 'make p1' builds p1 only
p1: $(P1SRC) $(UTILS)
$(CC) $(CFLAGS) -o $@ $(P1SRC) $(UTILS) $(LFLAGS)
# 'make p2' builds p2 only
p2: $(P2SRC) $(UTILS)
$(CC) $(CFLAGS) -o $@ $(P2SRC) $(UTILS) $(LFLAGS)
# 'make p3' builds p3 only
p3: $(P3SRC) $(UTILS)
$(CC) $(CFLAGS) -o $@ $(P3SRC) $(UTILS) $(LFLAGS)
# 'make p4' builds p4 only
p4: $(P4SRC) $(UTILS)
$(CC) $(CFLAGS) -o $@ $(P4SRC) $(UTILS) $(LFLAGS)
# the rule for building the vision utilities
vision_utilities.o: vision_utilities.c vision_utilities.h
$(CC) -c -Wall -pedantic -o $@ vision_utilities.c
# 'make submit' creates a tar of all files in the directory
# NOTE 1: It also runs 'make clean' before submission.
# NOTE 2: Make sure to post the generated .tar.gz file to the Homework 2 Dropbox
# on CourseWorks
submit: clean
tar -czvf $(UNI)-hw2.tar.gz $(P1SRC) $(P2SRC) $(P3SRC) $(P4SRC) $(UTILS) $(UTILSH) Makefile README
# 'make extract' extracts all files into a new folder named UNI
extract: $(UNI).tar.gz
mkdir -p $(UNI)
tar -xvf $(UNI)-hw2.tar.gz -C $(UNI)/
# 'make clean' removes all output and temporary files
clean:
-rm -f p1 p2 p3 p4 vision_utilities.o $(OUTPUTS_TO_CLEAN) core CORE