-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (28 loc) · 832 Bytes
/
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
#
# http://www.gnu.org/software/make/manual/make.html
#
CC:=gcc
INCLUDES:=$(shell pkg-config --cflags libavformat libavcodec libswresample libswscale libavutil sdl)
CFLAGS:=-Wall -ggdb
LDFLAGS:=$(shell pkg-config --libs libavformat libavcodec libswresample libswscale libavutil sdl) -lm
EXE:=tutorial01.out tutorial02.out tutorial03.out tutorial04.out\
tutorial05.out tutorial06.out tutorial07.out tutorial08.out
#
# This is here to prevent Make from deleting secondary files.
#
.SECONDARY:
#
# $< is the first dependency in the dependency list
# $@ is the target name
#
all: dirs $(addprefix bin/, $(EXE))
dirs:
mkdir -p obj
mkdir -p bin
bin/%.out: obj/%.o
$(CC) $(CFLAGS) $< $(LDFLAGS) -o $@
obj/%.o : %.c
$(CC) $(CFLAGS) $< $(INCLUDES) -c -o $@
clean:
rm -f obj/*
rm -f bin/*