aboutsummaryrefslogtreecommitdiff
path: root/utils/Makefile
blob: 96e815af86a6a180a59c314a7e9561fcafbe0aa8 (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
39
40
41
42
TOPDIR ?= ..
SRCDIR ?= $(TOPDIR)/src
INCDIR ?= $(TOPDIR)/include

DESTDIR ?=
PREFIX ?= /usr/local
CROSS_COMPILE ?=

CC = $(CROSS_COMPILE)gcc
override CFLAGS := -Wall -Wextra -Werror -Wfatal-errors -I $(INCDIR) -L $(SRCDIR) -g -O2 $(CFLAGS)

VPATH = $(SRCDIR)

.PHONY: all
all: -ltinyalsa tinyplay tinycap tinymix tinypcminfo

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

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

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

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

.PHONY: clean
clean:
	rm -f tinyplay tinycap
	rm -f tinymix
	rm -f tinypcminfo

.PHONY: install
install: tinyplay tinycap tinymix tinypcminfo
	mkdir -p $(DESTDIR)$(PREFIX)/bin
	cp -u tinyplay $(DESTDIR)$(PREFIX)/bin/
	cp -u tinycap $(DESTDIR)$(PREFIX)/bin/
	cp -u tinymix $(DESTDIR)$(PREFIX)/bin/
	cp -u tinypcminfo $(DESTDIR)$(PREFIX)/bin/