-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile~
81 lines (59 loc) · 2.53 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
# 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 ###############
CC = gcc # The compiler being used
# Updating include path to use Comp 40 .h files and CII interfaces
IFLAGS = -I/comp/40/include -I/usr/sup/cii40/include/cii
# 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=gnu99 -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/lib64 -L/usr/sup/cii40/lib64
# 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 -larith40 -lnetpbm -lcii40 -lm
# 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: a2test 40image quantizer comprdr bitpack
## 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 $@
## Linking step (.o -> executable program)
a2test: a2test.o uarray2b.o uarray2.o a2plain.o
$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS)
40image: decomprdr.o uarray2.o 40image.o a2plain.o compress40.o quantizer.o compression.o decompression.o bitpack.o wordpack.o comprdr.o
$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS)
quantizer: quantizer.o testquant.o
$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS)
comprdr: comprdr.o testcrdr.o uarray2.o
$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS)
bitpack: bittest.o bitpack.o
$(CC) $(LDFLAGS) $^ -o $@ $(LDLIBS)
clean:
rm -f a2test 40image quantizer comprdr bitpack *.o