From 22ab7da256ceea13963f9383e065d2ef8bfb8f5d Mon Sep 17 00:00:00 2001 From: Taylor Holberton Date: Sat, 1 Oct 2016 13:08:08 -0400 Subject: put source files into src dir --- Makefile | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3