sm64pc/tools/Makefile

40 lines
1.2 KiB
Makefile
Raw Normal View History

2019-08-25 06:46:40 +02:00
CC := gcc
2020-06-07 14:16:09 +02:00
CXX := g++
2020-06-02 18:44:34 +02:00
CFLAGS := -I../include -I. -Wall -Wextra -Wno-unused-parameter -pedantic -std=c99 -O2 -s
LDFLAGS := -lm
2020-09-07 04:14:13 +02:00
PROGRAMS := textconv aifc_decode aiff_extract_codebook vadpcm_enc tabledesign
2020-06-02 18:44:34 +02:00
default: all
2019-08-25 06:46:40 +02:00
textconv_SOURCES := textconv.c utf8.c hashtable.c
aifc_decode_SOURCES := aifc_decode.c
aiff_extract_codebook_SOURCES := aiff_extract_codebook.c
2019-09-01 21:50:50 +02:00
tabledesign_SOURCES := sdk-tools/tabledesign/codebook.c sdk-tools/tabledesign/estimate.c sdk-tools/tabledesign/print.c sdk-tools/tabledesign/tabledesign.c
2020-06-02 18:44:34 +02:00
tabledesign_CFLAGS := -Iaudiofile -Wno-uninitialized
tabledesign_LDFLAGS := -Laudiofile -laudiofile -lstdc++ -lm
2019-08-25 06:46:40 +02:00
vadpcm_enc_SOURCES := sdk-tools/adpcm/vadpcm_enc.c sdk-tools/adpcm/vpredictor.c sdk-tools/adpcm/quant.c sdk-tools/adpcm/util.c sdk-tools/adpcm/vencode.c
vadpcm_enc_CFLAGS := -Wno-unused-result -Wno-uninitialized -Wno-sign-compare -Wno-absolute-value
LIBAUDIOFILE := audiofile/libaudiofile.a
$(LIBAUDIOFILE):
@$(MAKE) -C audiofile
2019-08-25 06:46:40 +02:00
2020-06-02 18:44:34 +02:00
all: $(LIBAUDIOFILE) $(PROGRAMS) $(CXX_PROGRAMS)
2019-08-25 06:46:40 +02:00
clean:
2020-06-02 18:44:34 +02:00
$(RM) $(PROGRAMS) $(CXX_PROGRAMS)
$(MAKE) -C audiofile clean
2019-08-25 06:46:40 +02:00
define COMPILE
$(1): $($1_SOURCES)
2020-06-02 18:44:34 +02:00
$(CC) $(CFLAGS) $($1_CFLAGS) $$^ -o $$@ $(LDFLAGS) $($1_LDFLAGS)
2019-08-25 06:46:40 +02:00
endef
$(foreach p,$(PROGRAMS),$(eval $(call COMPILE,$(p))))
2020-06-02 18:44:34 +02:00
2020-09-07 04:14:13 +02:00
.PHONY: all clean default