2026-06-09 00:31:08 +02:00
|
|
|
CC = gcc
|
2026-06-09 00:56:27 +02:00
|
|
|
CFLAGS = -O2 -Wall -Wextra -pthread \
|
|
|
|
|
-I. -Iconfig -Iutil -Ihttp -Inotifs -Iqueue -Iintegrations
|
2026-06-09 00:31:08 +02:00
|
|
|
LDFLAGS = -pthread -lcurl
|
|
|
|
|
TARGET = iptv-dl
|
|
|
|
|
|
2026-06-09 00:56:27 +02:00
|
|
|
SRCS = main.c \
|
|
|
|
|
config/config.c \
|
|
|
|
|
util/buf.c \
|
|
|
|
|
util/json.c \
|
|
|
|
|
http/http.c \
|
|
|
|
|
http/server.c \
|
|
|
|
|
http/handlers.c \
|
|
|
|
|
notifs/notify.c \
|
|
|
|
|
queue/iptv_api.c \
|
|
|
|
|
queue/queue.c \
|
|
|
|
|
integrations/discord.c \
|
|
|
|
|
integrations/jellyfin.c
|
|
|
|
|
|
|
|
|
|
OBJS = $(SRCS:.c=.o)
|
|
|
|
|
|
|
|
|
|
# Install paths (override: make install PREFIX=/usr/local)
|
|
|
|
|
PREFIX = /usr/local
|
|
|
|
|
BINDIR = $(PREFIX)/bin
|
|
|
|
|
SHAREDIR = $(PREFIX)/share/iptv-dl
|
|
|
|
|
SYSCONFDIR = /etc/iptv-downloader
|
2026-06-09 00:31:08 +02:00
|
|
|
|
|
|
|
|
all: $(TARGET)
|
|
|
|
|
|
|
|
|
|
$(TARGET): $(OBJS)
|
|
|
|
|
$(CC) $(OBJS) $(LDFLAGS) -o $@
|
|
|
|
|
|
|
|
|
|
%.o: %.c
|
|
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
|
|
install: $(TARGET)
|
|
|
|
|
install -d $(BINDIR) $(SHAREDIR) $(SYSCONFDIR)
|
2026-06-09 00:56:27 +02:00
|
|
|
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 ""
|
|
|
|
|
@echo "Installed to $(BINDIR)/iptv-dl"
|
|
|
|
|
@echo "Create config at ~/.iptv-downloader/config.json or $(SYSCONFDIR)/config.json"
|
|
|
|
|
@echo "Run: iptv-dl --dump-config (to see active defaults)"
|
2026-06-09 00:31:08 +02:00
|
|
|
|
|
|
|
|
clean:
|
|
|
|
|
rm -f $(OBJS) $(TARGET)
|
|
|
|
|
|
|
|
|
|
.PHONY: all install clean
|