vgmstream/cli/Makefile

73 lines
1.8 KiB
Makefile
Raw Normal View History

###############################
# CLI tools
###############################
LIBAO_IPATH = ../../libao/include
LIBAO_LPATH = ../../libao/bin
2021-08-14 17:22:47 +02:00
###############################################################################
### main defs
CFLAGS += $(DEF_CFLAGS) -DVAR_ARRAYS $(EXTRA_CFLAGS)
LDFLAGS += -L../src -lvgmstream -lm $(EXTRA_LDFLAGS)
TARGET_EXT_LIBS =
2024-07-07 21:25:59 +02:00
OUTPUT_CLI = vgmstream-cli
OUTPUT_123 = vgmstream123
OUTPUT_API = api_example
2024-07-07 21:25:59 +02:00
ifeq ($(TARGET_OS),Windows_NT)
2021-08-14 17:22:47 +02:00
CFLAGS += -DWIN32 -I../ext_includes -I../ext_libs/Getopt
2023-01-15 21:10:44 +01:00
LDFLAGS += -L../ext_libs/$(DLL_DIR)
LIBAO_INC = -I$(LIBAO_IPATH)
LIBAO_LIB = -L$(LIBAO_LPATH) -lao
2024-07-25 18:21:23 +02:00
# strip needs full name
OUTPUT_CLI = vgmstream-cli.exe
OUTPUT_123 = vgmstream123.exe
OUTPUT_API = api_example.exe
else
2021-08-14 17:22:47 +02:00
#todo move to subfolders and remove
CFLAGS += -I../ext_includes
LIBAO_LIB = -lao
endif
CFLAGS += $(LIBS_CFLAGS)
LDFLAGS += $(LIBS_LDFLAGS)
TARGET_EXT_LIBS += $(LIBS_TARGET_EXT_LIBS)
2024-07-28 18:24:40 +02:00
CLI_SRCS = vgmstream_cli.c vgmstream_cli_utils.c wav_utils.c
V123_SRCS = vgmstream123.c wav_utils.c
export CFLAGS LDFLAGS
###############################################################################
### targets
vgmstream_cli: libvgmstream.a $(TARGET_EXT_LIBS)
2024-07-28 18:24:40 +02:00
$(CC) $(CFLAGS) $(CLI_SRCS) $(LDFLAGS) -o $(OUTPUT_CLI)
$(STRIP) $(OUTPUT_CLI)
vgmstream123: libvgmstream.a $(TARGET_EXT_LIBS)
2024-07-28 18:24:40 +02:00
$(CC) $(CFLAGS) $(LIBAO_INC) $(V123_SRCS) $(LDFLAGS) $(LIBAO_LIB) -o $(OUTPUT_123)
$(STRIP) $(OUTPUT_123)
2024-07-07 21:25:59 +02:00
api_example: libvgmstream.a $(TARGET_EXT_LIBS)
$(CC) $(CFLAGS) api_example.c $(LDFLAGS) -o $(OUTPUT_API)
2024-07-25 18:21:23 +02:00
$(STRIP) $(OUTPUT_API)
2024-07-07 21:25:59 +02:00
libvgmstream.a:
$(MAKE) -C ../src $@
$(TARGET_EXT_LIBS):
$(MAKE) -C ../ext_libs $@
clean:
2024-07-14 20:31:50 +02:00
$(RMF) $(OUTPUT_CLI) $(OUTPUT_123) $(OUTPUT_API)
.PHONY: clean vgmstream_cli libvgmstream.a $(TARGET_EXT_LIBS)