2021-01-23 15:50:59 +01:00
|
|
|
###############################
|
2018-01-07 20:13:20 +01:00
|
|
|
# CLI tools
|
2021-01-23 15:50:59 +01:00
|
|
|
###############################
|
2008-01-31 07:15:03 +01:00
|
|
|
|
2021-08-10 23:54:04 +02:00
|
|
|
LIBAO_IPATH = ../../libao/include
|
|
|
|
LIBAO_LPATH = ../../libao/bin
|
|
|
|
|
2021-08-14 17:22:47 +02:00
|
|
|
###############################################################################
|
|
|
|
### main defs
|
2021-08-10 23:54:04 +02:00
|
|
|
|
|
|
|
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
|
2021-08-10 23:54:04 +02:00
|
|
|
|
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)
|
2021-08-10 23:54:04 +02:00
|
|
|
|
|
|
|
LIBAO_INC = -I$(LIBAO_IPATH)
|
|
|
|
LIBAO_LIB = -L$(LIBAO_LPATH) -lao
|
2018-01-07 20:13:20 +01:00
|
|
|
else
|
2021-08-14 17:22:47 +02:00
|
|
|
#todo move to subfolders and remove
|
2021-08-10 23:54:04 +02:00
|
|
|
CFLAGS += -I../ext_includes
|
2018-01-07 20:13:20 +01:00
|
|
|
|
2021-08-10 23:54:04 +02:00
|
|
|
LIBAO_LIB = -lao
|
|
|
|
endif
|
2018-01-07 20:13:20 +01:00
|
|
|
|
2021-01-23 15:50:59 +01:00
|
|
|
CFLAGS += $(LIBS_CFLAGS)
|
|
|
|
LDFLAGS += $(LIBS_LDFLAGS)
|
|
|
|
TARGET_EXT_LIBS += $(LIBS_TARGET_EXT_LIBS)
|
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
|
|
|
|
export CFLAGS LDFLAGS
|
|
|
|
|
2021-01-23 15:50:59 +01:00
|
|
|
|
|
|
|
###############################################################################
|
2018-01-07 20:13:20 +01:00
|
|
|
### targets
|
|
|
|
|
|
|
|
vgmstream_cli: libvgmstream.a $(TARGET_EXT_LIBS)
|
2021-08-15 19:15:56 +02:00
|
|
|
$(CC) $(CFLAGS) vgmstream_cli.c $(LDFLAGS) -o $(OUTPUT_CLI)
|
2018-01-07 20:13:20 +01:00
|
|
|
$(STRIP) $(OUTPUT_CLI)
|
|
|
|
|
2018-01-18 23:29:11 +01:00
|
|
|
vgmstream123: libvgmstream.a $(TARGET_EXT_LIBS)
|
2021-08-15 19:15:56 +02:00
|
|
|
$(CC) $(CFLAGS) $(LIBAO_INC) vgmstream123.c $(LDFLAGS) $(LIBAO_LIB) -o $(OUTPUT_123)
|
2018-01-18 23:29:11 +01:00
|
|
|
$(STRIP) $(OUTPUT_123)
|
2008-03-25 08:25:46 +01:00
|
|
|
|
2024-07-07 21:25:59 +02:00
|
|
|
api_example: libvgmstream.a $(TARGET_EXT_LIBS)
|
|
|
|
$(CC) $(CFLAGS) api_example.c $(LDFLAGS) -o $(OUTPUT_API)
|
|
|
|
$(STRIP) api_example
|
|
|
|
|
2008-03-10 20:20:40 +01:00
|
|
|
libvgmstream.a:
|
2015-01-22 01:28:43 +01:00
|
|
|
$(MAKE) -C ../src $@
|
2008-02-06 01:27:51 +01:00
|
|
|
|
2018-01-07 20:13:20 +01:00
|
|
|
$(TARGET_EXT_LIBS):
|
|
|
|
$(MAKE) -C ../ext_libs $@
|
|
|
|
|
2008-01-31 07:15:03 +01:00
|
|
|
clean:
|
2024-07-14 20:31:50 +02:00
|
|
|
$(RMF) $(OUTPUT_CLI) $(OUTPUT_123) $(OUTPUT_API)
|
2018-01-07 20:13:20 +01:00
|
|
|
|
|
|
|
.PHONY: clean vgmstream_cli libvgmstream.a $(TARGET_EXT_LIBS)
|