-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
68 lines (52 loc) · 1.36 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
USE_OPENSSL := no
BUILD := $(shell date -u +%Y%m%d-%H%M%S)
OS := $(shell uname -s)
PREFIX = $(DESTDIR)/opt/DigestPlay
TOOLKIT = ../..
DIRECTORIES = \
$(TOOLKIT)/Common \
$(TOOLKIT)/Rewind
ifeq ($(OS), Linux)
FLAGS += -rdynamic
KIND := $(shell grep -E "^6.0" /etc/debian_version > /dev/null ; echo $?)
ifneq ($(KIND), 0)
LIBRARIES += rt
endif
ifeq ($(USE_OPENSSL), yes)
FLAGS += -DUSE_OPENSSL
DEPENDENCIES += openssl
endif
endif
OBJECTS = \
RewindClient.o \
DigestPlay.o
ifneq ($(USE_OPENSSL), yes)
OBJECTS += sha256.o
endif
FLAGS += -g -fno-omit-frame-pointer -O3 -MMD $(foreach directory, $(DIRECTORIES), -I$(directory)) -DBUILD=\"$(BUILD)\"
LIBS += $(foreach library, $(LIBRARIES), -l$(library))
CC = gcc
CFLAGS += $(FLAGS) -std=gnu99
ifneq ($(strip $(DEPENDENCIES)),)
FLAGS += $(shell pkg-config --cflags $(DEPENDENCIES))
LIBS += $(shell pkg-config --libs $(DEPENDENCIES))
endif
all: build
build: $(PREREQUISITES) $(OBJECTS)
$(CC) $(OBJECTS) $(FLAGS) $(LIBS) -o digestplay
install:
install -D -d $(PREFIX)
install -o root -g root digestplay $(PREFIX)
clean:
rm -f $(PREREQUISITES) $(OBJECTS) digestplay
rm -f *.d $(TOOLKIT)/*/*.d
version:
echo "#define VERSION $(shell date -u +%Y%m%d)" > Version.h
debian-package:
./UpdateLog.sh
ifdef ARCH
dpkg-buildpackage -b -a$(ARCH) -tc
else
dpkg-buildpackage -b -tc
endif
.PHONY: all build clean install