summaryrefslogtreecommitdiff
path: root/Makefile
blob: 761b4285d9d593432cca9882d747e1cc1853a65a (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
compiler = gcc
linker = gcc
cflags = -I./ -g $(includes) $(defines) \
	-Wall -Wextra -pedantic -std=c99
lflags = -lX11 -lm
target = twinkplayer
includes =
defines = \
	-Dplat_posix \
	-Dplat_pulse \
	-Dis64bit=1 \
	-Dplat_x86 \
	-DDEBUG
luigi = luigi.o

sources = \
	library.c \
	main.c \
	memory.c \
	plat.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)