summaryrefslogtreecommitdiff
path: root/Makefile
blob: 25fb8bcc1d91292d17624bf52bdbcbd73d36693f (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
35
36
37
38
39
40
41
42
compiler = gcc
linker = gcc
cflags = -I./ -g $(includes) $(defines) \
	-Wall -Wextra -pedantic -std=c99
lflags = -lX11 -lm -lpulse -lpulse-simple -lpthread 
target = twinkplayer
includes =
defines = \
	-Dplat_posix \
	-Dplat_pulse \
	-Dis64bit=1 \
	-Dplat_x86 \
	-DDEBUG \
	-DUI_LINUX 
luigi = luigi.o

sources = \
	library.c \
	main.c \
	memory.c \
	plat.c \
	playlist.c

objects = $(sources:%.c=%.o)

all: $(target)

$(objects): %.o : %.c
	$(compiler) -MMD -MF $(basename $@).d $(cflags) -o $@ -c $<

$(luigi): luigi.c
	gcc -MMD -MF $(basename $@).d -DUI_LINUX -w -std=c11 -g -o $@ -c $<

$(target): $(objects) $(luigi)
	$(linker) $(objects) $(luigi) -o $@ $(lflags)

clean:
	rm *.d
	rm *.o
	rm -f $(target)

-include $(sources:%.c=%.d)