forked from e2iplayer/hlsdl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
executable file
·50 lines (40 loc) · 1.19 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
# Makefile inspiration from Kore (Kore.io)
CC?=gcc
PREFIX?=/usr/local
HLSDL=hlsdl
INSTALL_DIR=$(PREFIX)/bin
OSNAME=$(shell uname -s | sed -e 's/[-_].*//g' | tr A-Z a-z)
S_SRC= src/main.c src/aes_openssl.c src/curl.c src/hls.c src/misc.c src/msg.c src/mpegts.c
ifeq ("$(OSNAME)", "darwin")
CFLAGS+=-I/usr/local/include/
LDFLAGS+=-L/usr/local/lib
else ifeq ("$(OSNAME)", "linux")
CFLAGS+=-D_GNU_SOURCE=1 -std=gnu99
else ifeq ("$(OSNAME)", "mingw32")
CFLAGS+=-D_GNU_SOURCE=1 -std=gnu99 -DCURL_STATICLIB
S_SRC+=msvc/win/memmem.c
else
endif
S_OBJS= $(S_SRC:.c=.o)
CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes
CFLAGS+=-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual
CFLAGS+=-Wsign-compare -Iincludes
CFLAGS+=-DPREFIX='"$(PREFIX)"'
ifeq ("$(OSNAME)", "mingw32")
LDFLAGS+=-Wl,-Bstatic -lpthread -lcurl -lssl -lcrypto -lwsock32 -lws2_32 -lwldap32 -lz
else
LDFLAGS+=-lpthread -lcurl -lcrypto
endif
all: $(S_OBJS)
$(CC) $(S_OBJS) $(LDFLAGS) -o $(HLSDL)
install:
mkdir -p $(INSTALL_DIR)
install -m 555 $(HLSDL) $(INSTALL_DIR)/$(HLSDL)
uninstall:
rm -f $(INSTALL_DIR)/$(HLSDL)
.c.o:
$(CC) $(CFLAGS) -c $< -o $@
clean:
find . -type f -name \*.o -exec rm {} \;
rm -f $(HLSDL)
.PHONY: clean