-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
76 lines (57 loc) · 1.77 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
#-----------------------------------------------
# tivodecode-ng Makefile for GCC/GNU make et al.
# This file will be overwritten by configure.
#-----------------------------------------------
# General options. POST is for any post-processing that needs doing.
ifeq ($(DEBUG),Y)
OPTS = -g -Wall -Wextra -pedantic
else
OPTS = -O2 -Wall -pedantic -flto
POST = strip $@
endif
# PREFIX is the base directory under which to install the binary and man
# page; generally either /usr/local or /usr (or perhaps /opt...).
PREFIX = /usr/local
#--------------------------------------------------------------
# RM is the Delete command ("rm" or "del", as appropriate), and SEP is the
# separator for multi-statement lines... some systems require ";", while
# others need "&&".
ifeq ($(OS),Windows_NT)
RM = del
SEP = &&
E = .exe
LFLAGS = -static
else
RM = rm -f
SEP = ;
E =
LFLAGS =
endif
O = o
.SUFFIXES: .cxx
.PHONY: clean dep install
all: tivodecode$(E) tdcat$(E)
OBJS1 = TuringFast.$(O) cli_common.$(O) getopt_td.$(O) happyfile.$(O) \
hexlib.$(O) md5.$(O) sha1.$(O) turing_stream.$(O) tivo_parse.$(O)
OBJS2 = tivo_decoder_base.$(O) tivo_decoder_mpeg_parser.$(O) \
tivo_decoder_ps.$(O) tivo_decoder_ts.$(O) tivo_decoder_ts_pkt.$(O) \
tivo_decoder_ts_stream.$(O)
OBJS3 = tivodecode.$(O) tdcat.$(O)
$(OBJS1) $(OBJS2) $(OBJS3): %.o: %.cxx
$(CXX) $(OPTS) -c $<
tivodecode$(E): tivodecode.$(O) $(OBJS1) $(OBJS2)
$(CXX) $(LFLAGS) -o tivodecode$(E) tivodecode.$(O) $(OBJS1) $(OBJS2)
$(POST)
tdcat$(E): tdcat.$(O) $(OBJS1)
$(CXX) $(LFLAGS) -o tdcat$(E) tdcat.$(O) $(OBJS1)
$(POST)
dep:
$(CXX) -MM *.cxx | sed s/"\.o"/"\.\$$(O)"/ > depend
clean:
$(RM) *.$(O)
$(RM) tivodecode$(E)
$(RM) tdcat$(E)
install::
install -c -s tivodecode $(PREFIX)/bin
install -c -s tdcat $(PREFIX)/bin
include depend