-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
83 lines (68 loc) · 1.61 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
82
#
# Makefile
#
PROGNAME = ngtc
CODECDIR = /codecs
BINDIR = /usr/local/bin
SRC = hqv.c codec.c lav.c mpeg.c io.c mp4box.c demuxer.c libx264.c encoder.c log.c vfilter.c
GENARGS = -Wall -D_FILE_OFFSET_BITS=64 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_GNU_SOURCE
STATARGS = -Wl,-z,noexecstack -ffast-math -rdynamic -static -pthread
WINSTATARGS = -Wl,--large-address-aware -lpthread -ffast-math -static -static-libgcc
FLAGS = -Lbuild/lib -Ibuild/include
FLAGS32 = -Lbuild/lib32 -Ibuild/include
FLAGS64 = -Lbuild/lib64 -Ibuild/include
LAVC_LIBS = -lavfilter -lavformat -lavcodec -lswscale -lavutil -lavcore
BASE_LIBS = -lz -lbz2 -lm -lpthread
EXTRA_LIBS = -lfaac -lmp3lame -lx264 -lpng -lm -lpthread
VP8_LIBS = -lvpx -lvorbis -lvorbisenc -logg
MACHINE = $(shell uname -m)
ifeq ($(MACHINE),x86_64)
FLAGS = $(FLAGS64)
else
endif
ifeq ($(DEBUG),1)
OPT = -g
else
OPT = -O3
endif
ifeq ($(CROSS),1)
OPT := $(OPT) -m32
FLAGS = $(FLAGS32)
endif
SYSTEM = $(shell uname -s)
ifeq ($(SYSTEM),Linux)
OS = -DSYS_LINUX
endif
ifeq ($(SYSTEM),Darwin)
OS = -DSYS_MACOSX
endif
ifeq ($(SYSTEM),CYGWIN_NT-5.1)
OS =
STATARGS = $(WINSTATARGS)
BASE_LIBS = -lz -lm -lpthread -lcygwin
endif
ifeq ($(STATIC),1)
ARGS = $(STATARGS) $(GENARGS)
else
ARGS = $(GENARGS)
endif
all: ngtc
ngtc:
./version.sh
gcc $(OPT) $(ARGS) \
-o $(PROGNAME) $(SRC) \
$(PROGNAME).c $(OS) $(FLAGS) \
$(LAVC_LIBS) \
$(BASE_LIBS) \
$(EXTRA_LIBS)
version:
./version.sh
install:
mkdir -p $(CODECDIR)
cp -f codecs/* $(CODECDIR)/
strip $(PROGNAME)
cp -f $(PROGNAME) $(BINDIR)/
cp -f scripts/process.pl $(BINDIR)/
cp -f scripts/combine.pl $(BINDIR)/
clean:
rm -f $(PROGNAME)