audiolib/Makefile

34 lines
695 B
Makefile

SRCS := AudioLib/main.c
INCLUDES := -Iaudio/
BUILDDIR = .build
TARGET := libaudio-test
OBJS := $(addprefix $(BUILDDIR)/, $(patsubst %.c,%.o, $(SRCS)))
CC = gcc
AR = ar
PKGCONFIG = pkg-config
CFLAGS = --std=gnu99 -Wall
all: $(TARGET)
$(TARGET): $(OBJS) | audiolib
$(CC) `$(PKGCONFIG) --libs ao` -Laudio/.build/ -Laudio/.build/libmad -Laudio/.build/speexdsp -Laudio/.build/libfaad2 -o $(TARGET) $(OBJS) -laudio -lmad -lspeexresampler -lfaad2 -lm
audiolib:
(cd audio; make)
$(BUILDDIR)/%.o: %.c
$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
$(OBJS): | $(BUILDDIR)
$(BUILDDIR):
mkdir -p $(BUILDDIR)/AudioLib
.PHONY: clean audiolib
clean:
-rm $(OBJS)
-rm $(TARGET)
(cd audio; make clean)