summaryrefslogtreecommitdiffstats
path: root/Makefile
blob: 847b97169b56d9df777eddfe159e636629a124b1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
CFLAGS = -I src -g
LDLIBS = -lcurses -lreadline -lmpdclient
DEPFLAGS =  -MT $@ -MMD -MP -MF build/$*.d

SRCS = $(wildcard src/*.c)
OBJS = $(SRCS:src/%.c=build/%.o)
DEPS = $(OBJS:%.o=%.d)

.PHONY: all tmus clean install uninstall

all: tmus

clean:
	rm -rf build

build:
	mkdir build

build/%.o: src/%.c build/%.d
	$(CC) -c -o $@ $(DEPFLAGS) $(CFLAGS) $<

build/%.d: | build;

include $(DEPS)

tmus: $(OBJS)
	$(CC) -o $@ $^ $(CFLAGS) $(LDLIBS)

install:
	install -m 755 tmus /usr/bin

uninstall:
	rm /usr/bin/tmus