aboutsummaryrefslogtreecommitdiff
path: root/utils/Makefile
diff options
context:
space:
mode:
authorTaylor Holberton <taylorcholberton@gmail.com>2016-10-01 22:33:36 -0400
committerTaylor Holberton <taylorcholberton@gmail.com>2016-10-01 22:33:36 -0400
commitc429afa38bef6a838cdd514d446d5d42541d1fb9 (patch)
treedfbfaabd72f8be99b21892289c10749094d59183 /utils/Makefile
parent281af8a08f7938abcff5734a86cfcb5d3ee65b40 (diff)
added DESTDIR to install command and explicit build commands
Diffstat (limited to 'utils/Makefile')
-rw-r--r--utils/Makefile28
1 files changed, 15 insertions, 13 deletions
diff --git a/utils/Makefile b/utils/Makefile
index d591d15..96e815a 100644
--- a/utils/Makefile
+++ b/utils/Makefile
@@ -1,5 +1,5 @@
TOPDIR ?= ..
-SRCDIR ?= $(TOPDIR)
+SRCDIR ?= $(TOPDIR)/src
INCDIR ?= $(TOPDIR)/include
DESTDIR ?=
@@ -7,23 +7,24 @@ PREFIX ?= /usr/local
CROSS_COMPILE ?=
CC = $(CROSS_COMPILE)gcc
-CFLAGS ?= -Wall -Wextra -Werror -Wfatal-errors -I $(INCDIR)
-
-LD = $(CROSS_COMPILE)ld
-LDFLAGS ?=
+override CFLAGS := -Wall -Wextra -Werror -Wfatal-errors -I $(INCDIR) -L $(SRCDIR) -g -O2 $(CFLAGS)
VPATH = $(SRCDIR)
.PHONY: all
-all: tinyplay tinycap tinymix tinypcminfo
+all: -ltinyalsa tinyplay tinycap tinymix tinypcminfo
tinyplay: tinyplay.c -ltinyalsa
+ $(CC) $(CFLAGS) $< -o $@ -ltinyalsa
-tinycap: tinycap.c -ltinyalsa
+tinycap: tinycap.c
+ $(CC) $(CFLAGS) $< -o $@ -ltinyalsa
-tinymix: tinymix.c -ltinyalsa
+tinymix: tinymix.c
+ $(CC) $(CFLAGS) $< -o $@ -ltinyalsa
-tinypcminfo: tinypcminfo.c -ltinyalsa
+tinypcminfo: tinypcminfo.c
+ $(CC) $(CFLAGS) $< -o $@ -ltinyalsa
.PHONY: clean
clean:
@@ -33,8 +34,9 @@ clean:
.PHONY: install
install: tinyplay tinycap tinymix tinypcminfo
- cp -u tinyplay $(PREFIX)/bin/
- cp -u tinycap $(PREFIX)/bin/
- cp -u tinymix $(PREFIX)/bin/
- cp -u tinypcminfo $(PREFIX)/bin/
+ 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/