123 lines
3.1 KiB
Makefile
Raw Normal View History

DEBUG = 0
2015-06-26 16:37:48 +02:00
LIBRETRO_COMMON_DIR := ../libretro-common
2015-09-17 07:01:34 +02:00
INCFLAGS = -I. -I$(LIBRETRO_COMMON_DIR)/include
TARGETS = rmsgpack_test libretrodb_tool plain_converter lua_converter c_converter
2016-01-23 01:07:35 +01:00
ifeq ($(DEBUG), 1)
CFLAGS = -g -O0 -Wall
else
CFLAGS = -g -O2 -Wall -DNDEBUG
endif
LUA_CONVERTER_C = \
rmsgpack.c \
rmsgpack_dom.c \
lua_common.c \
libretrodb.c \
bintree.c \
query.c \
lua_converter.c \
$(LIBRETRO_COMMON_DIR)/compat/compat_fnmatch.c \
$(LIBRETRO_COMMON_DIR)/file/retro_file.c \
2015-11-14 18:12:09 -03:00
$(LIBRETRO_COMMON_DIR)/compat/compat_strl.c
2016-01-23 01:07:35 +01:00
LUA_CONVERTER_OBJS := $(LUA_CONVERTER_C:.c=.o)
PLAIN_CONVERTER_C = \
lexer.c \
parser.c \
rmsgpack.c \
rmsgpack_dom.c \
libretrodb.c \
bintree.c \
query.c \
2015-10-07 12:53:38 +02:00
plain_converter.c \
$(LIBRETRO_COMMON_DIR)/hash/rhash.c \
$(LIBRETRO_COMMON_DIR)/compat/compat_fnmatch.c \
$(LIBRETRO_COMMON_DIR)/file/retro_file.c \
2015-11-14 18:12:09 -03:00
$(LIBRETRO_COMMON_DIR)/compat/compat_strl.c
2016-01-23 01:07:35 +01:00
PLAIN_CONVERTER_OBJS := $(PLAIN_CONVERTER_C:.c=.o)
C_CONVERTER_C = \
rmsgpack.c \
rmsgpack_dom.c \
libretrodb.c \
bintree.c \
query.c \
c_converter.c \
$(LIBRETRO_COMMON_DIR)/hash/rhash.c \
$(LIBRETRO_COMMON_DIR)/compat/compat_fnmatch.c \
$(LIBRETRO_COMMON_DIR)/file/retro_file.c \
$(LIBRETRO_COMMON_DIR)/compat/compat_strl.c
C_CONVERTER_OBJS := $(C_CONVERTER_C:.c=.o)
2015-09-17 07:01:34 +02:00
RARCHDB_TOOL_C = \
rmsgpack.c \
rmsgpack_dom.c \
libretrodb_tool.c \
bintree.c \
query.c \
libretrodb.c \
$(LIBRETRO_COMMON_DIR)/compat/compat_fnmatch.c \
$(LIBRETRO_COMMON_DIR)/file/retro_file.c \
2015-11-14 18:12:09 -03:00
$(LIBRETRO_COMMON_DIR)/compat/compat_strl.c
2015-09-17 07:01:34 +02:00
RARCHDB_TOOL_OBJS := $(RARCHDB_TOOL_C:.c=.o)
TESTLIB_C = \
testlib.c \
2015-01-19 22:47:09 +01:00
query.c \
2015-01-23 05:59:47 +01:00
libretrodb.c \
2015-01-19 22:47:09 +01:00
bintree.c \
rmsgpack.c \
rmsgpack_dom.c \
2015-09-17 07:01:34 +02:00
$(LIBRETRO_COMMON_DIR)/compat/compat_fnmatch.c \
$(LIBRETRO_COMMON_DIR)/file/retro_file.c \
2015-11-14 18:12:09 -03:00
$(LIBRETRO_COMMON_DIR)/compat/compat_strl.c
2015-09-17 07:01:34 +02:00
TESTLIB_OBJS := $(TESTLIB_C:.c=.o)
2014-12-30 21:02:15 +01:00
RMSGPACK_C = \
rmsgpack.c \
rmsgpack_test.c \
$(LIBRETRO_COMMON_DIR)/file/retro_file.c
RMSGPACK_OBJS := $(RMSGPACK_C:.c=.o)
2015-09-17 07:01:34 +02:00
LUA_FLAGS = `pkg-config lua --libs`
2016-01-23 01:07:35 +01:00
TESTLIB_FLAGS = $(CFLAGS) $(LUA_FLAGS) -shared -fpic
2015-01-19 22:47:09 +01:00
.PHONY: all clean check
2015-01-07 18:34:37 +01:00
2016-01-23 01:07:35 +01:00
all: $(TARGETS)
2014-12-30 21:02:15 +01:00
%.o: %.c
2016-01-23 01:07:35 +01:00
$(CC) $(INCFLAGS) $< -c $(CFLAGS) -o $@
2014-12-30 21:02:15 +01:00
2016-01-23 01:07:35 +01:00
plain_converter: $(PLAIN_CONVERTER_OBJS)
$(CC) $(INCFLAGS) $(PLAIN_CONVERTER_OBJS) -o $@
2016-01-23 01:07:35 +01:00
lua_converter: $(LUA_CONVERTER_OBJS)
$(CC) $(INCFLAGS) $(LUA_CONVERTER_OBJS) $(LUA_FLAGS) -o $@
c_converter: $(C_CONVERTER_OBJS)
$(CC) $(INCFLAGS) $(C_CONVERTER_OBJS) $(CFLAGS) -o $@
2016-01-23 01:07:35 +01:00
libretrodb_tool: $(RARCHDB_TOOL_OBJS)
$(CC) $(INCFLAGS) $(RARCHDB_TOOL_OBJS) -o $@
2014-12-30 21:02:15 +01:00
rmsgpack_test: $(RMSGPACK_OBJS)
2016-01-23 01:07:35 +01:00
$(CC) $(INCFLAGS) $(RMSGPACK_OBJS) -g -o $@
2015-01-19 22:47:09 +01:00
2016-01-23 01:07:35 +01:00
testlib.so: $(TESTLIB_OBJS)
$(CC) $(INCFLAGS) $(TESTLIB_FLAGS) $(TESTLIB_OBJS) -o $@
2015-01-19 22:47:09 +01:00
check: testlib.so tests.lua
lua ./tests.lua
2014-12-30 21:02:15 +01:00
clean:
rm -rf $(TARGETS) $(PLAIN_CONVERTER_OBJS) $(LUA_CONVERTER_OBJS) $(C_CONVERTER_OBJS) $(RARCHDB_TOOL_OBJS) $(RMSGPACK_OBJS) $(TESTLIB_OBJS)