-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
68 lines (48 loc) · 1.21 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
OS_NAME = $(shell uname -s)
ifneq ($(OS_NAME),Darwin)
$(error Currently only OS X supported)
endif
CC = clang
CFLAGS_RELEASE = -O2
CFLAGS_DEBUG = -O0 -g
ifeq ($(RELEASE),1)
CFLAGS += $(CFLAGS_RELEASE)
else
CFLAGS += $(CFLAGS_DEBUG)
endif
WFLAGS = -Wall \
-Wno-objc-missing-super-calls
FRAMEWORKS = VideoToolbox \
AVFoundation \
CoreVideo \
CoreMedia \
CoreFoundation
SOURCE_DIR = prenc/prenc
BUILD_DIR = build
OBJS_DIR = $(BUILD_DIR)/obj
SRCS_NAMES = prenc.m \
MovieWriter.m \
ProresEncoder.m
OBJS_NAMES = $(SRCS_NAMES:.m=.o)
BIN_NAME = prenc
OBJS = $(addprefix $(OBJS_DIR)/, $(OBJS_NAMES))
BIN = $(BUILD_DIR)/$(BIN_NAME)
INSTALL_DIR = /usr/local/bin
.PHONY: clean
.DEFAULT_GOAL=all
all: dir $(BIN)
$(BIN): $(OBJS)
$(CC) -Wall -fobjc-link-runtime $(addprefix -framework , $(FRAMEWORKS)) $^ -o $@
$(OBJS_DIR)/%.o: $(SOURCE_DIR)/%.m
$(CC) $(CFLAGS) $(WFLAGS) -std=c99 -x objective-c -c $< -o $@
install: $(BIN)
@if test ! -d $(INSTALL_DIR); then mkdir -p $(INSTALL_DIR); fi
cp -f $(BIN) $(INSTALL_DIR)
uninstall:
rm -f $(INSTALL_DIR)/$(BIN_NAME)
dir:
@mkdir -p $(OBJS_DIR)
ctags:
ctags -R --languages=ObjectiveC --langmap=ObjectiveC:.h.m .
clean:
rm -rf $(BUILD_DIR)