refactor: reorganize into subdirs (config/ util/ http/ notifs/ queue/ integrations/ static/)

This commit is contained in:
2026-06-09 00:56:27 +02:00
parent 4bcc34ec86
commit 32deda57e0
23 changed files with 33 additions and 18 deletions
+33 -18
View File
@@ -1,16 +1,29 @@
CC = gcc
CFLAGS = -O2 -Wall -Wextra -I. -pthread
CFLAGS = -O2 -Wall -Wextra -pthread \
-I. -Iconfig -Iutil -Ihttp -Inotifs -Iqueue -Iintegrations
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
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
all: $(TARGET)
@@ -22,15 +35,17 @@ $(TARGET): $(OBJS)
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)"
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)"
clean:
rm -f $(OBJS) $(TARGET)