1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2024-11-14 21:40:03 +00:00
oot/tools/audio/Makefile
Tharo aa97586659
[Audio 6/?] Build Soundfonts and the Soundfont Table (#2056)
* [Audio 6/?] Build Soundfonts and the Soundfont Table

* Improve lots of error messages

* First suggested changes

* Make audio build debugging more friendly

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>

* Some fixes from MM review

* Make soundfont_table.h generation depend on the samplebank xmls since they are read, report from which soundfont the invalid pointer indirect warning originates from

---------

Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
2024-08-27 21:09:59 -04:00

51 lines
1.3 KiB
Makefile

PROGRAMS := atblgen sfpatch sbc sfc
ifeq ($(shell which xml2-config),)
$(error xml2-config not found. Did you install libxml2-dev?)
endif
CLANG_FORMAT := clang-format-14
FORMAT_ARGS := -i -style=file
CC := gcc
CFLAGS := -Wall -Wextra -pedantic
OPTFLAGS := -Og -g3
XML_CFLAGS := $(shell xml2-config --cflags)
XML_LDFLAGS := $(shell xml2-config --libs)
.PHONY: all clean distclean format
all: $(PROGRAMS)
$(MAKE) -C sampleconv
clean:
$(RM) $(PROGRAMS)
$(MAKE) -C sampleconv clean
distclean: clean
$(MAKE) -C sampleconv distclean
format:
$(CLANG_FORMAT) $(FORMAT_ARGS) $(shell find . -maxdepth 1 -type f -name "*.[ch]")
$(MAKE) -C sampleconv format
atblgen_SOURCES := audio_tablegen.c samplebank.c soundfont.c xml.c util.c
sfpatch_SOURCES := sfpatch.c util.c
sbc_SOURCES := samplebank_compiler.c samplebank.c aifc.c xml.c util.c
sfc_SOURCES := soundfont_compiler.c samplebank.c soundfont.c aifc.c xml.c util.c
atblgen_CFLAGS := $(XML_CFLAGS)
sbc_CFLAGS := $(XML_CFLAGS)
sfc_CFLAGS := $(XML_CFLAGS)
atblgen_LDFLAGS := $(XML_LDFLAGS)
sbc_LDFLAGS := $(XML_LDFLAGS)
sfc_LDFLAGS := $(XML_LDFLAGS)
define COMPILE =
$(1): $($1_SOURCES)
$(CC) $(CFLAGS) $($1_CFLAGS) $$^ $($1_LDFLAGS) -o $$@
endef
$(foreach p,$(PROGRAMS),$(eval $(call COMPILE,$(p))))