2024-08-28 01:09:59 +00:00
|
|
|
PROGRAMS := atblgen sfpatch sbc sfc
|
2024-08-15 00:54:31 +00:00
|
|
|
|
|
|
|
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)
|
2024-08-09 02:39:18 +00:00
|
|
|
|
|
|
|
.PHONY: all clean distclean format
|
|
|
|
|
2024-08-15 00:54:31 +00:00
|
|
|
all: $(PROGRAMS)
|
2024-08-09 02:39:18 +00:00
|
|
|
$(MAKE) -C sampleconv
|
|
|
|
|
|
|
|
clean:
|
2024-08-15 00:54:31 +00:00
|
|
|
$(RM) $(PROGRAMS)
|
2024-08-09 02:39:18 +00:00
|
|
|
$(MAKE) -C sampleconv clean
|
|
|
|
|
|
|
|
distclean: clean
|
|
|
|
$(MAKE) -C sampleconv distclean
|
|
|
|
|
|
|
|
format:
|
2024-08-15 00:54:31 +00:00
|
|
|
$(CLANG_FORMAT) $(FORMAT_ARGS) $(shell find . -maxdepth 1 -type f -name "*.[ch]")
|
2024-08-09 02:39:18 +00:00
|
|
|
$(MAKE) -C sampleconv format
|
2024-08-15 00:54:31 +00:00
|
|
|
|
2024-08-28 01:09:59 +00:00
|
|
|
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
|
2024-08-15 00:54:31 +00:00
|
|
|
|
2024-08-17 21:42:15 +00:00
|
|
|
atblgen_CFLAGS := $(XML_CFLAGS)
|
|
|
|
sbc_CFLAGS := $(XML_CFLAGS)
|
2024-08-28 01:09:59 +00:00
|
|
|
sfc_CFLAGS := $(XML_CFLAGS)
|
2024-08-15 00:54:31 +00:00
|
|
|
|
2024-08-17 21:42:15 +00:00
|
|
|
atblgen_LDFLAGS := $(XML_LDFLAGS)
|
|
|
|
sbc_LDFLAGS := $(XML_LDFLAGS)
|
2024-08-28 01:09:59 +00:00
|
|
|
sfc_LDFLAGS := $(XML_LDFLAGS)
|
2024-08-15 00:54:31 +00:00
|
|
|
|
|
|
|
define COMPILE =
|
|
|
|
$(1): $($1_SOURCES)
|
|
|
|
$(CC) $(CFLAGS) $($1_CFLAGS) $$^ $($1_LDFLAGS) -o $$@
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(foreach p,$(PROGRAMS),$(eval $(call COMPILE,$(p))))
|