diff options
author | Taylor Holberton <taylorcholberton@gmail.com> | 2016-10-01 12:55:10 -0400 |
---|---|---|
committer | Taylor Holberton <taylorcholberton@gmail.com> | 2016-10-01 12:55:10 -0400 |
commit | 626a822af99650a68e668fe8af3f06850866106f (patch) | |
tree | e33248c3298a65adf7eb9ebbd40cc1273979a4b1 /Makefile | |
parent | e67926e8ec3f5086d668c4d1e7e41feca7f8aa41 (diff) |
cleaned up makefile
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 30 |
1 files changed, 20 insertions, 10 deletions
@@ -1,24 +1,33 @@ -CFLAGS ?= -Wall -LDFLAGS ?= -INC = include +export TOPDIR = $(shell pwd) +export SRCDIR = $(TOPDIR) +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 -CROSS_COMPILE = -PREFIX = /usr/local .PHONY: all all: $(LIB) $(SHLIB) $(MAKE) -C utils $(SHLIB): $(OBJECTS) - $(CROSS_COMPILE)$(CC) $(LDFLAGS) -shared $(OBJECTS) -o $(SHLIB) + $(CC) $(LDFLAGS) -shared $(OBJECTS) -o $(SHLIB) $(LIB): $(OBJECTS) $(CROSS_COMPILE)$(AR) rcs $@ $^ %.o: %.c - $(CROSS_COMPILE)$(CC) $(CFLAGS) -fPIC -c $^ -I$(INC) -o $@ + $(CROSS_COMPILE)$(CC) $(CFLAGS) -fPIC -c $^ -o $@ .PHONY: clean clean: @@ -27,8 +36,9 @@ clean: .PHONY: install install: $(LIB) $(SHLIB) - cp -u $(SHLIB) $(PREFIX)/lib/$(SHLIB) - cp -u $(LIB) $(PREFIX)/lib/$(LIB) + cp -u $(SHLIB) $(PREFIX)/lib/ + cp -u $(LIB) $(PREFIX)/lib/ mkdir -p $(PREFIX)/include/tinyalsa - cp -u $(INC)/tinyalsa/asoundlib.h $(PREFIX)/include/tinyalsa/asoundlib.h + cp -Ru $(INCDIR)/tinyalsa $(PREFIX)/include/ + $(MAKE) -C utils install |