Files
iptv-downloader/Makefile
T

39 lines
1.2 KiB
Makefile
Raw Normal View History

CC = gcc
CFLAGS = -O2 -Wall -Wextra -I. -pthread
LDFLAGS = -pthread -lcurl
TARGET = iptv-dl
SRCS = main.c config.c buf.c json.c http.c discord.c jellyfin.c \
iptv_api.c queue.c notify.c handlers.c server.c
OBJS = $(SRCS:.c=.o)
# Install paths (override with: make install PREFIX=/usr/local)
PREFIX = /usr/local
BINDIR = $(PREFIX)/bin
SHAREDIR = $(PREFIX)/share/iptv-dl
SYSCONFDIR = /etc/iptv-downloader
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(OBJS) $(LDFLAGS) -o $@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
install: $(TARGET)
install -d $(BINDIR) $(SHAREDIR) $(SYSCONFDIR)
install -m 755 $(TARGET) $(BINDIR)/iptv-dl
install -m 644 static/iptv.css $(SHAREDIR)/iptv.css
install -m 644 static/iptv.js $(SHAREDIR)/iptv.js
install -m 644 static/downloads.js $(SHAREDIR)/downloads.js
install -m 644 static/series_show.js $(SHAREDIR)/series_show.js
install -m 644 static/header.html $(SHAREDIR)/header.html
install -m 644 static/footer.html $(SHAREDIR)/footer.html
@echo "Installed. Create config at $(SYSCONFDIR)/config.json or ~/.iptv-downloader/config.json"
@echo "Run: $(BINDIR)/iptv-dl --dump-config (to see defaults)"
clean:
rm -f $(OBJS) $(TARGET)
.PHONY: all install clean