aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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