1DESTDIR ?= 2PREFIX ?= /usr/local 3BINDIR ?= $(PREFIX)/bin 4MANDIR ?= $(PREFIX)/man 5 6CROSS_COMPILE ?= 7CC = $(CROSS_COMPILE)gcc 8 9CFLAGS += -Wall -Wextra -Werror -Wfatal-errors 10CFLAGS += -I ../include 11CFLAGS += -fPIC 12CFLAGS += -O2 13 14LDFLAGS += -L ../src 15LDFLAGS += -pie 16 17VPATH = ../src:../include/tinyalsa 18 19.PHONY: all 20all: -ltinyalsa tinyplay tinycap tinymix tinypcminfo 21 22tinyplay tinycap tinypcminfo tinymix: LDLIBS+=-ldl 23 24tinyplay: tinyplay.o libtinyalsa.a 25 26tinyplay.o: tinyplay.c pcm.h mixer.h asoundlib.h optparse.h 27 28tinycap: tinycap.o libtinyalsa.a 29 30tinycap.o: tinycap.c pcm.h mixer.h asoundlib.h optparse.h 31 32tinymix: tinymix.o libtinyalsa.a 33 34tinymix.o: tinymix.c pcm.h mixer.h asoundlib.h optparse.h 35 36tinypcminfo: tinypcminfo.o libtinyalsa.a 37 38tinypcminfo.o: tinypcminfo.c pcm.h mixer.h asoundlib.h optparse.h 39 40.PHONY: clean 41clean: 42 $(RM) tinyplay tinyplay.o 43 $(RM) tinycap tinycap.o 44 $(RM) tinymix tinymix.o 45 $(RM) tinypcminfo tinypcminfo.o 46 47.PHONY: install 48install: tinyplay tinycap tinymix tinypcminfo 49 install -d $(DESTDIR)$(BINDIR) 50 install tinyplay $(DESTDIR)$(BINDIR)/ 51 install tinycap $(DESTDIR)$(BINDIR)/ 52 install tinymix $(DESTDIR)$(BINDIR)/ 53 install tinypcminfo $(DESTDIR)$(BINDIR)/ 54 install -d $(DESTDIR)$(MANDIR)/man1 55 install tinyplay.1 $(DESTDIR)$(MANDIR)/man1/ 56 install tinycap.1 $(DESTDIR)$(MANDIR)/man1/ 57 install tinymix.1 $(DESTDIR)$(MANDIR)/man1/ 58 install tinypcminfo.1 $(DESTDIR)$(MANDIR)/man1/ 59 60