summaryrefslogtreecommitdiff
path: root/src/Makefile
blob: f8b0aaf144e5aa5efcb2f89e571bda2abca2d401 (plain)
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
CC=gcc
# For debug
#CFLAGS=-W -Wall -Werror -Wno-error=unused-parameter -g
#LDFLAGS=-Werror -g

# For release
CFLAGS=-W -Wall -Werror -Wno-error=unused-parameter -O2
LDFLAGS=-Werror
EXEC=music2light

CFLAGS+=$(shell pkg-config --cflags gtk+-2.0 gthread-2.0 libpulse)
# Maths for FFT related code, libftdi is the driver for USB2DMX module
LDFLAGS+=-lm -lftdi
# -lrt for nanosleep but create many tiny buffers from PulseAudio
#LDFLAGS+=-lm -lftdi -lrt
LDFLAGS+=$(shell pkg-config --libs gtk+-2.0 gthread-2.0 libpulse)

SRC= $(wildcard *.c)
OBJ= $(SRC:.c=.o)

all: $(EXEC)

$(EXEC): $(OBJ)
	$(CC) -o $@ $^ $(LDFLAGS)

#main.o: hello.h

%.o: %.c
	$(CC) -o $@ -c $< $(CFLAGS)

.PHONY: clean mrproper

clean:
	rm *.o

mrproper: clean
	rm $(EXEC)