aboutsummaryrefslogtreecommitdiff
path: root/src/Makefile
diff options
context:
space:
mode:
authorTaylor Holberton <taylorcholberton@gmail.com>2016-10-01 22:33:05 -0400
committerTaylor Holberton <taylorcholberton@gmail.com>2016-10-01 22:33:05 -0400
commit281af8a08f7938abcff5734a86cfcb5d3ee65b40 (patch)
tree8e4e53ffc6bcba9b79e82ef18e50a5b23b9648bf /src/Makefile
parentb4ea00f6bd2ee20c40780349ba00be6e56109531 (diff)
added install to multiarch dir and override CFLAGS mechanism
Diffstat (limited to 'src/Makefile')
-rw-r--r--src/Makefile12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Makefile b/src/Makefile
index 1549650..50a692f 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1,15 +1,14 @@
TOPDIR ?= ..
-SRCDIR ?= $(TOPDIR)/src
INCDIR ?= $(TOPDIR)/include
+DEB_HOST_MULTIARCH := $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
DESTDIR ?=
PREFIX ?= /usr/local
CROSS_COMPILE =
CC = $(CROSS_COMPILE)gcc
-CFLAGS = -Wall -Wextra -Werror -Wfatal-errors
-CFLAGS += -I $(INCDIR)
-CFLAGS += -fPIC
+override CFLAGS := -Wall -Wextra -Werror -Wfatal-errors -I $(INCDIR) -fPIC $(CFLAGS)
AR = $(CROSS_COMPILE)ar
ARFLAGS = rcs
@@ -40,6 +39,7 @@ clean:
.PHONY: install
install: libtinyalsa.a libtinyalsa.so
- cp -u libtinyalsa.a $(DESTDIR)$(PREFIX)/lib/
- cp -u libtinyalsa.so $(DESTDIR)$(PREFIX)/lib/
+ mkdir -p $(DESTDIR)$(PREFIX)/lib/$(DEB_HOST_MULTIARCH)
+ cp -u libtinyalsa.a $(DESTDIR)$(PREFIX)/lib/$(DEB_HOST_MULTIARCH)
+ cp -u libtinyalsa.so $(DESTDIR)$(PREFIX)/lib/$(DEB_HOST_MULTIARCH)