evisum/src/tingle/makefile

24 lines
576 B
Makefile

PROGRAM=tingle
SOURCES=tingle.c
CFLAGS=-O2 -Wall -pedantic -std=c99 -lpthread
LDFLAGS=-lm -pthread
HAVE_ALSA := 0
ALSA_TEST := $(shell pkg-config --exists alsa 1>&2 2>/dev/null; echo $$?)
HAVE_ALSA := $(shell if [ $(ALSA_TEST) -eq 0 ]; then echo "true"; else echo "false"; fi)
UNAME := $(shell uname -s)
ifeq ($(UNAME),Darwin)
CFLAGS += -framework CoreAudio
else ifeq ($(UNAME),Linux)
ifeq ($(HAVE_ALSA),true)
CFLAGS += -lasound -DHAVE_ALSA=1
endif
endif
default:
$(CC) $(SOURCES) $(CFLAGS) $(LDFLAGS) -o tingle
clean:
-rm $(PROGRAM)