summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouis Burda <quent.burda@gmail.com>2021-12-20 16:25:43 +0100
committerLouis Burda <quent.burda@gmail.com>2021-12-20 16:25:43 +0100
commitf07580d31d1148c4a1811c36b09ca0ad50d9576b (patch)
tree05a8fbb44af81f3b5937df80c5af3305ec3ed3c9
parentfaee8e9c6db45c6adacfc5113d55927f92e8bf29 (diff)
downloadtmus-f07580d31d1148c4a1811c36b09ca0ad50d9576b.tar.gz
tmus-f07580d31d1148c4a1811c36b09ca0ad50d9576b.zip
Restructured repository and added automatic make dependency generation
-rw-r--r--.gitignore1
-rw-r--r--Makefile27
-rw-r--r--src/history.c (renamed from history.c)0
-rw-r--r--src/history.h (renamed from history.h)0
-rw-r--r--src/list.c (renamed from list.c)0
-rw-r--r--src/list.h (renamed from list.h)1
-rw-r--r--src/listnav.c (renamed from listnav.c)0
-rw-r--r--src/listnav.h (renamed from listnav.h)0
-rw-r--r--src/main.c (renamed from main.c)0
-rw-r--r--src/player.c (renamed from player.c)0
-rw-r--r--src/player.h (renamed from player.h)0
-rw-r--r--src/ref.c (renamed from ref.c)0
-rw-r--r--src/ref.h (renamed from ref.h)2
-rw-r--r--src/tag.c (renamed from tag.c)0
-rw-r--r--src/tag.h (renamed from tag.h)2
-rw-r--r--src/track.c (renamed from track.c)0
-rw-r--r--src/track.h (renamed from track.h)0
-rw-r--r--src/util.c (renamed from util.c)0
-rw-r--r--src/util.h (renamed from util.h)0
19 files changed, 27 insertions, 6 deletions
diff --git a/.gitignore b/.gitignore
index de19033..db000da 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,4 @@ tmus
env.sh
*.o
todo
+build
diff --git a/Makefile b/Makefile
index 08cc8bc..38dfa13 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,11 @@
-CFLAGS = -I . -g
+CC = clang
+CFLAGS = -I src -g
LDLIBS = -lcurses -lreadline -lmpdclient
+WARNFLAGS = -Wno-pragma-once-outside-header
+
+SRCS = $(wildcard src/*.c)
+OBJS = $(SRCS:src/%.c=build/%.o)
+DEPS = $(OBJS:%.o=%.d)
.PHONY: all tmus clean install uninstall
@@ -8,10 +14,22 @@ all: tmus
clean:
rm tmus
-%.o: %.c %.h
- $(CC) -c -o $@ $< $(CFLAGS) $(LDLIBS)
+build:
+ mkdir build
+
+build/%.o: src/%.c build/%.d
+ @echo DEPS: $^
+ $(CC) -c -o $@ $< $(CFLAGS)
+
+build/main.d: src/main.c | build
+ $(CC) -c -MT build/main.o -MMD -MP -MF $@ $<
-tmus: main.c util.o history.o list.o player.o tag.o track.o listnav.o ref.o
+build/%.d: src/%.c src/%.h | build
+ $(CC) -c -MT build/$*.o -MMD -MP -MF $@ $^ $(WARNFLAGS)
+
+-include $(DEPS)
+
+tmus: $(OBJS)
$(CC) -o $@ $^ $(CFLAGS) $(LDLIBS)
install:
@@ -19,3 +37,4 @@ install:
uninstall:
rm /usr/bin/tmus
+
diff --git a/history.c b/src/history.c
index 6fc615e..6fc615e 100644
--- a/history.c
+++ b/src/history.c
diff --git a/history.h b/src/history.h
index bbf4faa..bbf4faa 100644
--- a/history.h
+++ b/src/history.h
diff --git a/list.c b/src/list.c
index 29ddcf1..29ddcf1 100644
--- a/list.c
+++ b/src/list.c
diff --git a/list.h b/src/list.h
index 2edb132..d74ac9f 100644
--- a/list.h
+++ b/src/list.h
@@ -32,3 +32,4 @@ struct link *link_iter(struct link *link, int n);
void list_push_back(struct link *list, struct link *link);
+//rstrrrstrssiimmrsrsssts
diff --git a/listnav.c b/src/listnav.c
index 707a973..707a973 100644
--- a/listnav.c
+++ b/src/listnav.c
diff --git a/listnav.h b/src/listnav.h
index 688172c..688172c 100644
--- a/listnav.h
+++ b/src/listnav.h
diff --git a/main.c b/src/main.c
index e61665c..e61665c 100644
--- a/main.c
+++ b/src/main.c
diff --git a/player.c b/src/player.c
index ead9281..ead9281 100644
--- a/player.c
+++ b/src/player.c
diff --git a/player.h b/src/player.h
index 9e28903..9e28903 100644
--- a/player.h
+++ b/src/player.h
diff --git a/ref.c b/src/ref.c
index c961dd7..c961dd7 100644
--- a/ref.c
+++ b/src/ref.c
diff --git a/ref.h b/src/ref.h
index 1bc2a5c..3a3936d 100644
--- a/ref.h
+++ b/src/ref.h
@@ -1,6 +1,6 @@
#pragma once
-#include "link.h"
+#include "list.h"
struct ref {
void *data;
diff --git a/tag.c b/src/tag.c
index 452d099..452d099 100644
--- a/tag.c
+++ b/src/tag.c
diff --git a/tag.h b/src/tag.h
index 4854cfb..cf2c757 100644
--- a/tag.h
+++ b/src/tag.h
@@ -1,6 +1,6 @@
#pragma once
-#include "link.h"
+#include "list.h"
#include "util.h"
struct tag {
diff --git a/track.c b/src/track.c
index f7aa2a9..f7aa2a9 100644
--- a/track.c
+++ b/src/track.c
diff --git a/track.h b/src/track.h
index 7a2a142..7a2a142 100644
--- a/track.h
+++ b/src/track.h
diff --git a/util.c b/src/util.c
index e8c0935..e8c0935 100644
--- a/util.c
+++ b/src/util.c
diff --git a/util.h b/src/util.h
index b9f45f4..b9f45f4 100644
--- a/util.h
+++ b/src/util.h