2024-01-24 11:08:49 +00:00
|
|
|
include vars.mk
|
|
|
|
|
2024-01-30 08:56:00 +00:00
|
|
|
PHONY_TARGETS = all clean
|
|
|
|
ifeq ($(OS), Windows_NT)
|
|
|
|
EXE_SUFFIX = .exe
|
|
|
|
else
|
|
|
|
EXE_SUFFIX =
|
|
|
|
|
|
|
|
PHONY_TARGETS += install
|
|
|
|
PREFIX = /usr/local
|
|
|
|
BINDIR = ${PREFIX}/bin
|
|
|
|
endif
|
|
|
|
|
2024-01-24 11:08:49 +00:00
|
|
|
CC = gcc
|
|
|
|
|
2024-01-26 06:38:01 +00:00
|
|
|
CFLAGS = -I${TINYWAV_DIR} -I${MIDI_PARSER_DIR}/include -fPIC -Wall -Wpedantic -Wextra -Wno-unused-parameter
|
2024-01-24 11:08:49 +00:00
|
|
|
|
2024-01-30 08:56:00 +00:00
|
|
|
PROGRAM = ${BUNDLE_NAME}${EXE_SUFFIX}
|
2024-01-24 11:08:49 +00:00
|
|
|
|
2024-01-30 08:56:00 +00:00
|
|
|
all: build/${PROGRAM}
|
|
|
|
|
|
|
|
build/${PROGRAM}: src/main.c ${TINYWAV_DIR}/tinywav.c ${MIDI_PARSER_DIR}/src/midi-parser.c | build
|
2024-01-24 11:08:49 +00:00
|
|
|
${CC} $^ -o $@ ${CFLAGS} ${CFLAGS_EXTRA} ${LDFLAGS_EXTRA}
|
|
|
|
|
|
|
|
build:
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -fr build
|
|
|
|
|
2024-01-30 08:56:00 +00:00
|
|
|
ifneq ($(OS), Windows_NT)
|
|
|
|
install: all
|
|
|
|
mkdir -p -m 0755 ${BINDIR}
|
|
|
|
install -m 0755 build/${PROGRAM} ${BINDIR}
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: ${PHONY_TARGETS}
|