Skip to content

Commit

Permalink
I'm losing my mind thanks to CLion right now
Browse files Browse the repository at this point in the history
  • Loading branch information
dargueta committed Sep 12, 2024
1 parent 4307a59 commit d6d8f25
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 2 deletions.
19 changes: 17 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
include dependencies-src.d
include dependencies-tests.d

# WARNING: This makefile is intended to be invoked by LuaRocks, not manually.

# Disable all default build rules so that we have full control.
Expand Down Expand Up @@ -71,11 +74,23 @@ TEST_CPP_OBJECT_FILES = $(TEST_CPP_SOURCES:.cpp=.$(OBJ_EXTENSION))
TEMPLATE_DATA_FILES = $(wildcard src/template_data/*.lua)

LIBRARY_DIRECTORIES = $(strip $(LUA_LIBDIR) $(UNICORN_LIBDIR) $(PTHREAD_LIBDIR) /usr/lib64 /usr/local/lib)
HEADER_DIRECTORIES = $(strip $(CURDIR)/include $(LUA_INCDIR) $(FALLBACK_LUA_INCDIR) $(UNICORN_INCDIR) /usr/local/include)

# The hardcoded version-specific paths here are fallbacks because my IDE can't find the
# Lua headers without them. Is it necessary? No. Will it cause problems? Unlikely. But
# without it, every file is a sea of red squiggles and I'm. Losing. My. Mind.
HEADER_DIRECTORIES = $(strip \
$(CURDIR)/include \
$(LUA_INCDIR) \
$(FALLBACK_LUA_INCDIR) \
$(UNICORN_INCDIR) \
/usr/local/include \
/usr/include/lua$(LUA_VERSION) \
/usr/local/include/lua$(LUA_VERSION))

ifndef USER_CXX_FLAGS
USER_CXX_FLAGS =
endif

OTHER_CXXFLAGS = -std=c++11 -DIS_LUAJIT=$(IS_LUAJIT)
WARN_FLAGS = -Wall -Wextra -Werror -Wpedantic -pedantic-errors
INCLUDE_PATH_FLAGS = $(addprefix -I,$(HEADER_DIRECTORIES))
Expand Down Expand Up @@ -173,7 +188,7 @@ $(LIB_BUILD_TARGET): $(LIB_OBJECT_FILES) | $(BUILD_DIR)
$(LINK_CMD) $(LIBFLAG) -o $@ $^ $(REQUIRED_LIBS_FLAGS)


$(TEST_EXECUTABLE): $(DOCTEST_HEADER) $(TEST_CPP_OBJECT_FILES) $(LIB_OBJECT_FILES) $(TEST_HEADERS)
$(TEST_EXECUTABLE): $(DOCTEST_HEADER) $(TEST_CPP_OBJECT_FILES) $(LIB_OBJECT_FILES) $(TEST_HEADERS) | $(BUILD_DIR)
$(LINK_CMD) -o $@ $(filter %.$(OBJ_EXTENSION),$^) $(REQUIRED_LIBS_FLAGS) $(LINK_TO_LUA_FLAG) -lm


Expand Down
54 changes: 54 additions & 0 deletions dependencies-src.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
src/basic_control_functions.o: src/basic_control_functions.cpp \
include/unicornlua/control_functions.hpp include/unicornlua/lua.hpp \
include/unicornlua/compat.hpp include/unicornlua/engine.hpp \
include/unicornlua/hooks.hpp include/unicornlua/lua.hpp \
include/unicornlua/utils.hpp include/unicornlua/errors.hpp \
include/unicornlua/integer_conversions.hpp \
include/unicornlua/unicornlua.hpp
src/compat.o: src/compat.cpp include/unicornlua/compat.hpp \
include/unicornlua/lua.hpp
src/context.o: src/context.cpp include/unicornlua/context.hpp \
include/unicornlua/engine.hpp include/unicornlua/hooks.hpp \
include/unicornlua/lua.hpp include/unicornlua/compat.hpp \
include/unicornlua/utils.hpp include/unicornlua/errors.hpp
src/control_functions.o: src/control_functions.cpp include/unicornlua/lua.hpp \
include/unicornlua/compat.hpp include/unicornlua/control_functions.hpp \
include/unicornlua/lua.hpp include/unicornlua/engine.hpp \
include/unicornlua/hooks.hpp include/unicornlua/utils.hpp \
include/unicornlua/transaction.hpp
src/engine.o: src/engine.cpp include/unicornlua/context.hpp \
include/unicornlua/engine.hpp include/unicornlua/hooks.hpp \
include/unicornlua/lua.hpp include/unicornlua/compat.hpp \
include/unicornlua/utils.hpp include/unicornlua/control_functions.hpp \
include/unicornlua/lua.hpp include/unicornlua/errors.hpp \
include/unicornlua/memory.hpp include/unicornlua/registers.hpp \
include/unicornlua/register_types.hpp include/unicornlua/unicornlua.hpp
src/errors.o: src/errors.cpp include/unicornlua/errors.hpp \
include/unicornlua/lua.hpp include/unicornlua/compat.hpp
src/hooks.o: src/hooks.cpp include/unicornlua/engine.hpp \
include/unicornlua/hooks.hpp include/unicornlua/lua.hpp \
include/unicornlua/compat.hpp include/unicornlua/utils.hpp \
include/unicornlua/errors.hpp include/unicornlua/transaction.hpp
src/memory.o: src/memory.cpp include/unicornlua/compat.hpp \
include/unicornlua/engine.hpp include/unicornlua/hooks.hpp \
include/unicornlua/lua.hpp include/unicornlua/utils.hpp
src/registers_const.o: src/registers_const.cpp include/unicornlua/lua.hpp \
include/unicornlua/compat.hpp include/unicornlua/registers.hpp \
include/unicornlua/register_types.hpp include/unicornlua/utils.hpp
src/registers.o: src/registers.cpp include/unicornlua/errors.hpp \
include/unicornlua/lua.hpp include/unicornlua/compat.hpp \
include/unicornlua/registers.hpp include/unicornlua/register_types.hpp \
include/unicornlua/register_template_functions.hpp
src/registers_misc.o: src/registers_misc.cpp include/unicornlua/compat.hpp \
include/unicornlua/engine.hpp include/unicornlua/hooks.hpp \
include/unicornlua/lua.hpp include/unicornlua/utils.hpp \
include/unicornlua/errors.hpp include/unicornlua/registers.hpp \
include/unicornlua/register_types.hpp
src/transaction.o: src/transaction.cpp include/unicornlua/lua.hpp \
include/unicornlua/compat.hpp include/unicornlua/transaction.hpp
src/unicorn.o: src/unicorn.cpp include/unicornlua/context.hpp \
include/unicornlua/engine.hpp include/unicornlua/hooks.hpp \
include/unicornlua/lua.hpp include/unicornlua/compat.hpp \
include/unicornlua/utils.hpp include/unicornlua/unicornlua.hpp
src/utils.o: src/utils.cpp include/unicornlua/lua.hpp \
include/unicornlua/compat.hpp include/unicornlua/utils.hpp
30 changes: 30 additions & 0 deletions dependencies-tests.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
tests/c/compat.o: tests/c/compat.cpp tests/c/doctest.h tests/c/fixtures.hpp \
include/unicornlua/engine.hpp include/unicornlua/hooks.hpp \
include/unicornlua/lua.hpp include/unicornlua/compat.hpp \
include/unicornlua/utils.hpp
tests/c/context.o: tests/c/context.cpp include/unicornlua/context.hpp \
include/unicornlua/engine.hpp include/unicornlua/hooks.hpp \
include/unicornlua/lua.hpp include/unicornlua/compat.hpp \
include/unicornlua/utils.hpp tests/c/doctest.h tests/c/fixtures.hpp \
include/unicornlua/errors.hpp
tests/c/engine.o: tests/c/engine.cpp tests/c/doctest.h tests/c/fixtures.hpp \
include/unicornlua/engine.hpp include/unicornlua/hooks.hpp \
include/unicornlua/lua.hpp include/unicornlua/compat.hpp \
include/unicornlua/utils.hpp include/unicornlua/context.hpp \
include/unicornlua/errors.hpp
tests/c/fixtures.o: tests/c/fixtures.cpp tests/c/doctest.h tests/c/fixtures.hpp \
include/unicornlua/engine.hpp include/unicornlua/hooks.hpp \
include/unicornlua/lua.hpp include/unicornlua/compat.hpp \
include/unicornlua/utils.hpp
tests/c/hooks.o: tests/c/hooks.cpp include/unicornlua/hooks.hpp \
include/unicornlua/lua.hpp include/unicornlua/compat.hpp \
tests/c/doctest.h tests/c/fixtures.hpp include/unicornlua/engine.hpp \
include/unicornlua/utils.hpp
tests/c/main.o: tests/c/main.cpp tests/c/doctest.h
tests/c/registers.o: tests/c/registers.cpp tests/c/doctest.h \
include/unicornlua/registers.hpp include/unicornlua/lua.hpp \
include/unicornlua/compat.hpp include/unicornlua/register_types.hpp
tests/c/utils.o: tests/c/utils.cpp tests/c/doctest.h tests/c/fixtures.hpp \
include/unicornlua/engine.hpp include/unicornlua/hooks.hpp \
include/unicornlua/lua.hpp include/unicornlua/compat.hpp \
include/unicornlua/utils.hpp

0 comments on commit d6d8f25

Please sign in to comment.