Update makefiles

This commit is contained in:
Johannes Schriewer 2024-03-06 22:14:09 +01:00
parent b625df9191
commit 8a30821f32
5 changed files with 84 additions and 10 deletions

View file

@ -1,5 +1,5 @@
SRCS := AudioLib/main.c
INCLUDES := -Iaudio/include
INCLUDES := -Iaudio/
BUILDDIR = .build
TARGET := libaudio-test
@ -13,7 +13,7 @@ CFLAGS = --std=gnu99 -Wall
all: $(TARGET)
$(TARGET): $(OBJS) | audiolib
$(CC) `$(PKGCONFIG) --libs ao` -Laudio/.build/ -Laudio/.build/libmad -Laudio/.build/speexdsp -o $(TARGET) $(OBJS) -laudio -lmad -lspeexresampler -lm
$(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)
@ -26,7 +26,7 @@ $(OBJS): | $(BUILDDIR)
$(BUILDDIR):
mkdir -p $(BUILDDIR)/AudioLib
.PHONY: clean
.PHONY: clean audiolib
clean:
-rm $(OBJS)

View file

@ -5,12 +5,14 @@ SRCS := \
audio_source_testtone.c \
audio_demuxer_mp3.c \
audio_decoder_mp3.c \
audio_demuxer_adts.c \
audio_decoder_aac.c \
audio_filter_param_eq.c \
audio_filter_resample.c \
audio_sink_file.c \
audio_sink_libao.c
INCLUDES := -Iinclude
INCLUDES := -Iinclude `pkg-config --cflags ao`
BUILDDIR = .build
TARGET := $(BUILDDIR)/libaudio.a
@ -18,9 +20,9 @@ OBJS := $(addprefix $(BUILDDIR)/, $(patsubst %.c,%.o, $(SRCS)))
CC = gcc
AR = ar
CFLAGS = --std=gnu99 -Wall
CFLAGS = --std=gnu99 -Wall -Os
all: $(TARGET) $(BUILDDIR)/libmad/libmad.a $(BUILDDIR)/speexdsp/libspeexresampler.a
all: $(TARGET) $(BUILDDIR)/libmad/libmad.a $(BUILDDIR)/speexdsp/libspeexresampler.a $(BUILDDIR)/libfaad2/libfaad2.a
$(TARGET): $(OBJS)
$(AR) -cr $(TARGET) $(OBJS)
@ -31,7 +33,10 @@ $(BUILDDIR)/libmad/libmad.a:
$(BUILDDIR)/speexdsp/libspeexresampler.a:
(cd deps/resampler; make BUILDDIR=$(abspath $(BUILDDIR)/speexdsp))
$(BUILDDIR)/%.o: %.c include/%.h
$(BUILDDIR)/libfaad2/libfaad2.a:
(cd deps/aac; make BUILDDIR=$(abspath $(BUILDDIR)/libfaad2))
$(BUILDDIR)/%.o: %.c %.h
$(CC) $(INCLUDES) $(CFLAGS) -c $< -o $@
$(OBJS): | $(BUILDDIR)
@ -45,4 +50,5 @@ clean:
-rm $(OBJS)
-rm $(TARGET)
(cd deps/mp3; make BUILDDIR=$(abspath $(BUILDDIR)/libmad) clean)
(cd deps/resampler; make BUILDDIR=$(abspath $(BUILDDIR)/speexdsp) clean)
(cd deps/resampler; make BUILDDIR=$(abspath $(BUILDDIR)/speexdsp) clean)
(cd deps/aac; make BUILDDIR=$(abspath $(BUILDDIR)/libfaad2) clean)

68
audio/deps/aac/Makefile Normal file
View file

@ -0,0 +1,68 @@
SRCS := \
bits.c \
cfft.c \
common.c \
decoder.c \
drc.c \
drm_dec.c \
error.c \
filtbank.c \
hcr.c \
huffman.c \
ic_predict.c \
is.c \
lt_predict.c \
mdct.c \
mp4.c \
ms.c \
output.c \
pns.c \
ps_dec.c \
ps_syntax.c \
pulse.c \
rvlc.c \
sbr_dct.c \
sbr_dec.c \
sbr_e_nf.c \
sbr_fbt.c \
sbr_hfadj.c \
sbr_hfgen.c \
sbr_huff.c \
sbr_qmf.c \
sbr_syntax.c \
sbr_tf_grid.c \
specrec.c \
ssr_fb.c \
ssr_ipqf.c \
ssr.c \
syntax.c \
tns.c
BUILDDIR = .build
TARGET := $(BUILDDIR)/libfaad2.a
OBJS := $(addprefix $(BUILDDIR)/, $(patsubst %.c,%.o, $(SRCS)))
CC = gcc
AR = ar
CFLAGS = --std=gnu99 -Wall -Os
INCLUDES = -I.
all: $(TARGET)
$(TARGET): $(OBJS)
$(AR) -cr $(TARGET) $(OBJS)
$(BUILDDIR)/%.o: %.c config.h
$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
$(OBJS): | $(BUILDDIR)
$(BUILDDIR):
mkdir -p $(BUILDDIR)
.PHONY: clean
clean:
-rm $(OBJS)
-rm $(TARGET)

View file

@ -17,7 +17,7 @@ OBJS := $(addprefix $(BUILDDIR)/, $(patsubst %.c,%.o, $(SRCS)))
CC = gcc
AR = ar
CFLAGS = --std=gnu99 -Wall
CFLAGS = --std=gnu99 -Wall -Os
all: $(TARGET)

View file

@ -6,7 +6,7 @@ OBJS := $(addprefix $(BUILDDIR)/, $(patsubst %.c,%.o, $(SRCS)))
CC = gcc
AR = ar
CFLAGS = --std=gnu99 -Wall
CFLAGS = --std=gnu99 -Wall -Os
all: $(TARGET)