diff --git a/Makefile b/Makefile index cf8bf8a..f6cd75d 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/config.c b/config/config.c similarity index 100% rename from config.c rename to config/config.c diff --git a/config.h b/config/config.h similarity index 100% rename from config.h rename to config/config.h diff --git a/handlers.c b/http/handlers.c similarity index 100% rename from handlers.c rename to http/handlers.c diff --git a/handlers.h b/http/handlers.h similarity index 100% rename from handlers.h rename to http/handlers.h diff --git a/http.c b/http/http.c similarity index 100% rename from http.c rename to http/http.c diff --git a/http.h b/http/http.h similarity index 100% rename from http.h rename to http/http.h diff --git a/server.c b/http/server.c similarity index 100% rename from server.c rename to http/server.c diff --git a/server.h b/http/server.h similarity index 100% rename from server.h rename to http/server.h diff --git a/discord.c b/integrations/discord.c similarity index 100% rename from discord.c rename to integrations/discord.c diff --git a/discord.h b/integrations/discord.h similarity index 100% rename from discord.h rename to integrations/discord.h diff --git a/jellyfin.c b/integrations/jellyfin.c similarity index 100% rename from jellyfin.c rename to integrations/jellyfin.c diff --git a/jellyfin.h b/integrations/jellyfin.h similarity index 100% rename from jellyfin.h rename to integrations/jellyfin.h diff --git a/notify.c b/notifs/notify.c similarity index 100% rename from notify.c rename to notifs/notify.c diff --git a/notify.h b/notifs/notify.h similarity index 100% rename from notify.h rename to notifs/notify.h diff --git a/iptv_api.c b/queue/iptv_api.c similarity index 100% rename from iptv_api.c rename to queue/iptv_api.c diff --git a/iptv_api.h b/queue/iptv_api.h similarity index 100% rename from iptv_api.h rename to queue/iptv_api.h diff --git a/queue.c b/queue/queue.c similarity index 100% rename from queue.c rename to queue/queue.c diff --git a/queue.h b/queue/queue.h similarity index 100% rename from queue.h rename to queue/queue.h diff --git a/buf.c b/util/buf.c similarity index 100% rename from buf.c rename to util/buf.c diff --git a/buf.h b/util/buf.h similarity index 100% rename from buf.h rename to util/buf.h diff --git a/json.c b/util/json.c similarity index 100% rename from json.c rename to util/json.c diff --git a/json.h b/util/json.h similarity index 100% rename from json.h rename to util/json.h