-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
77 lines (56 loc) · 2.5 KB
/
Makefile
File metadata and controls
77 lines (56 loc) · 2.5 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
# Makefile for locality (Comp 40 Assignment 3)
#
# Includes build rules for a2test and ppmtrans.
#
# This Makefile is more verbose than necessary. In each assignment
# we will simplify the Makefile using more powerful syntax and implicit rules.
#
# Last updated: February 16, 2016
############## Variables ###############
# INCLUDES = uarrayb.h compress40.h a2plain.h a2blocked.h pnm.h
CC = gcc # The compiler being used
# Updating include path to use Comp 40 .h files and CII interfaces
IFLAGS = -I/comp/40/build/include -I/usr/sup/cii40/include/cii -I/comp/40/build/lib
# Compile flags
# Set debugging information, allow the c99 standard,
# max out warnings, and use the updated include path
# CFLAGS = -g -std=c99 -Wall -Wextra -Werror -Wfatal-errors -pedantic $(IFLAGS)
#
# For this assignment, we have to change things a little. We need
# to use the GNU 99 standard to get the right items in time.h for the
# the timing support to compile.
#
CFLAGS = -g -std=c99 -Wall -Wextra -Werror -Wfatal-errors -pedantic $(IFLAGS)
# Linking flags
# Set debugging information and update linking path
# to include course binaries and CII implementations
LDFLAGS = -g -L/comp/40/build/lib -L/usr/sup/cii40/lib64 -L/comp/40/build/include
# Libraries needed for linking
# All programs cii40 (Hanson binaries) and *may* need -lm (math)
# 40locality is a catch-all for this assignment, netpbm is needed for pnm
# rt is for the "real time" timing library, which contains the clock support
LDLIBS = -l40locality -lnetpbm -lcii40 -lm -lrt -larith40
# Collect all .h files in your directory.
# This way, you can never forget to add
# a local .h file in your dependencies.
#
# This bugs Mark, who dislikes false dependencies, but
# he agrees with Noah that you'll probably spend hours
# debugging if you forget to put .h files in your
# dependency list.
INCLUDES = $(shell echo *.h)
############### Rules ###############
all: 40image ppmdiff
## Compile step (.c files -> .o files)
# To get *any* .o file, compile its .c file with the following rule.
%.o: %.c $(INCLUDES)
$(CC) $(CFLAGS) -c $< -o $@ $(LDLIBS)
## Linking step (.o -> executable program)
40image: 40image.o compress40.o uarray2.o a2plain.o uarray2b.o a2blocked.o IO.o getDCT.o getVCS.o bitpack.o getword.o
$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS)
ppmdiff: ppmdiff.o uarray2.o a2plain.o uarray2b.o a2blocked.o
$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS)
bitpackTesting: bitpack.o bitpackTesting.o
$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS)
clean:
rm -f ppmdiff 40image bitpack *.o core* vgcore*