aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTaylor Holberton <taylorcholberton@gmail.com>2016-10-01 13:08:08 -0400
committerTaylor Holberton <taylorcholberton@gmail.com>2016-10-01 13:08:08 -0400
commit22ab7da256ceea13963f9383e065d2ef8bfb8f5d (patch)
tree369dc4e0430e4c602a731568511f66b5f82ae4d9 /Makefile
parent626a822af99650a68e668fe8af3f06850866106f (diff)
put source files into src dir
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile29
1 files changed, 5 insertions, 24 deletions
diff --git a/Makefile b/Makefile
index f4be161..aa6c49d 100644
--- a/Makefile
+++ b/Makefile
@@ -1,44 +1,25 @@
export TOPDIR = $(shell pwd)
-export SRCDIR = $(TOPDIR)
+export SRCDIR = $(TOPDIR)/src
export INCDIR = $(TOPDIR)/include
export DESTDIR ?=
export PREFIX ?= /usr/local
export CROSS_COMPILE =
-CC = $(CROSS_COMPILE)gcc
-CFLAGS = -Wall -Wextra -Werror -Wfatal-errors -I $(INCDIR)
-
-LD = $(CROSS_COMPILE)ld
-LDFLAGS =
-
-OBJECTS = mixer.o pcm.o
-LIB = libtinyalsa.a
-SHLIB = libtinyalsa.so
-
.PHONY: all
-all: $(LIB) $(SHLIB)
+all:
+ $(MAKE) -C src
$(MAKE) -C utils
-$(SHLIB): $(OBJECTS)
- $(CC) $(LDFLAGS) -shared $(OBJECTS) -o $(SHLIB)
-
-$(LIB): $(OBJECTS)
- $(CROSS_COMPILE)$(AR) rcs $@ $^
-
-%.o: %.c
- $(CROSS_COMPILE)$(CC) $(CFLAGS) -fPIC -c $^ -o $@
-
.PHONY: clean
clean:
- -rm $(LIB) $(SHLIB) $(OBJECTS)
+ $(MAKE) -C src clean
$(MAKE) -C utils clean
.PHONY: install
install: $(LIB) $(SHLIB)
- cp -u $(SHLIB) $(PREFIX)/lib/
- cp -u $(LIB) $(PREFIX)/lib/
mkdir -p $(PREFIX)/include/tinyalsa
cp -Ru $(INCDIR)/tinyalsa $(PREFIX)/include/
+ $(MAKE) -C src install
$(MAKE) -C utils install