-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (47 loc) · 1.5 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
#######################################################################
# Homework Assignment 5, for EECS 22, Fall 2017
#
# Author: Tim Schmidt
# Date: 11/09/2017
#
# Makefile: Makefile for HW 5
#
#######################################################################
# Variables
CC = gcc
DEBUG = -g
#DEBUG = -O2
CFLAGS = -Wall -ansi -std=c99 $(DEBUG) -c $(DEBUG)
LFLAGAS = -Wall -ansi -std=c99 $(DEBUG)
MAIN = -DMAIN
OBJS = MovieLab.o FileIO.o DIPs.o Image.o ImageList.o Movie.o
# Default target
all: MovieLab
test: all
valgrind ./MovieLab
######################### Generate object files #######################
# Target for MovieLab.o
MovieLab.o: MovieLab.c FileIO.h DIPs.h Movie.h Constants.h Image.h
# Target for FileIO.o
FileIO.o: FileIO.c FileIO.h Constants.h Image.h
$(CC) $(CFLAGS) FileIO.c -o FileIO.o
# Target for DIPs.o
DIPs.o: DIPs.c Constants.h DIPs.h
$(CC) $(CFLAGS) DIPs.c -o DIPs.o
# Target for Image.o
Image.o: Image.c Image.h
$(CC) $(CFLAGS) Image.c -o Image.o
# Target for ImageList.o
ImageList.o: ImageList.c ImageList.h Image.h
$(CC) $(CFLAGS) ImageList.c -o ImageList.o
# Target for Movie.o
Movie.o: Movie.c Movie.h ImageList.h Image.h
$(CC) $(CFLAGS) Movie.c -o Movie.o
######################### Generate the executable #####################
# Target for MovieLab
MovieLab: $(OBJS)
$(CC) $(LFLAGS) $(OBJS) -o MovieLab
############################### others ##############################
# Target for clean-up
clean:
rm -f *.o MovieLab `find . -name '*.ppm'! -name 'watermark_template.ppm'`