diff options
| author | Louis Burda <quent.burda@gmail.com> | 2021-12-20 16:25:43 +0100 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2021-12-20 16:25:43 +0100 |
| commit | f07580d31d1148c4a1811c36b09ca0ad50d9576b (patch) | |
| tree | 05a8fbb44af81f3b5937df80c5af3305ec3ed3c9 | |
| parent | faee8e9c6db45c6adacfc5113d55927f92e8bf29 (diff) | |
| download | tmus-f07580d31d1148c4a1811c36b09ca0ad50d9576b.tar.gz tmus-f07580d31d1148c4a1811c36b09ca0ad50d9576b.zip | |
Restructured repository and added automatic make dependency generation
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | Makefile | 27 | ||||
| -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
@@ -3,3 +3,4 @@ tmus env.sh *.o todo +build @@ -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 @@ -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 @@ -1,6 +1,6 @@ #pragma once -#include "link.h" +#include "list.h" struct ref { void *data; @@ -1,6 +1,6 @@ #pragma once -#include "link.h" +#include "list.h" #include "util.h" struct tag { |
