-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
59 lines (43 loc) · 1.69 KB
/
Makefile
File metadata and controls
59 lines (43 loc) · 1.69 KB
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
# DEBUG changes behaviour completly and is for developing / debugging the application
# DEBUG disabled is the correct setting
CC ?= gcc
USE_FFMPEG=1
FFMPEG_PATH=../FFmpeg
ifeq ($(USE_FFMPEG),)
CFLAGS ?=-O2 -Wall
else
CFLAGS ?=-O2 -Wall -DFFMPEG -I. -I${FFMPEG_PATH}
endif
# DEBUG=-DDEBUG -g
PREFIX ?= /usr/local
SRCS=ts2shout.c pes.c mpa_header.c util.c crc32.c rds.c dsmcc.c
CURRENT_VERSION:=$(shell git describe 2>/dev/null)
ifeq ($(CURRENT_VERSION),)
CURRENT_VERSION := "unknown"
endif
CURRENT_DATE:=$(shell date '+%d.%m.%Y %H:%M' 2>/dev/null)
ifeq ($(CURRENT_DATE),)
CURRENT_DATE := "unkown"
endif
DEPDIR := .deps
DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.d
COMPILE.c = $(CC) -DCURRENT_VERSION="${CURRENT_VERSION}" -DCURRENT_DATE="${CURRENT_DATE}" $(DEPFLAGS) $(DEBUG) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
%.o : %.c
%.o : %.c $(DEPDIR)/%.d | $(DEPDIR)
$(COMPILE.c) $(OUTPUT_OPTION) $<
$(DEPDIR): ; @mkdir -p $@
DEPFILES := $(SRCS:%.c=$(DEPDIR)/%.d)
ifeq ($(USE_FFMPEG),)
ts2shout: ts2shout.o mpa_header.o util.o pes.o crc32.o rds.o dsmcc.o
${CC} ${DEBUG} ${LDFLAGS} -o ts2shout ts2shout.o rds.o mpa_header.o util.o pes.o crc32.o dsmcc.o -lcurl -lz
else
ts2shout: ts2shout.o mpa_header.o util.o pes.o crc32.o rds.o dsmcc.o
${CC} ${DEBUG} ${LDFLAGS} -o ts2shout ts2shout.o rds.o mpa_header.o util.o pes.o crc32.o dsmcc.o ${FFMPEG_PATH}/libavcodec/libavcodec.a ${FFMPEG_PATH}/libavutil/libavutil.a -lX11 -lva -lva-drm -lva-x11 -lpthread -lswresample -lcurl -lz -lm
endif
clean:
rm -f *.o ts2shout
install: ts2shout
install -g root -m 555 -o root ts2shout ${PREFIX}/bin/ts2shout
install -D -g root -m 444 -o root ts2shout.1 ${PREFIX}/man/man1/ts2shout.1
$(DEPFILES):
include $(wildcard $(DEPFILES))