Skip to content

Commit

Permalink
Makefile simplifications
Browse files Browse the repository at this point in the history
  • Loading branch information
dargueta committed Nov 20, 2024
1 parent 3355387 commit 13f41a4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 7 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ UNICORN_INCDIR = /usr/include
LUA := $(shell $(LUAROCKS) config variables.LUA)
LUA_DIR := $(shell $(LUAROCKS) config variables.LUA_DIR)
LUA_INCDIR = $(LUA_DIR)/include
LUA_LIBDIR = $(LUA_DIR)/lib
LUA_VERSION = $(shell $(LUA) -e 'print(_VERSION:sub(5))')

################################################################################
Expand Down Expand Up @@ -68,9 +67,7 @@ LIB_OBJECT_FILES = $(LIB_C_SOURCES:.c=.$(OBJ_EXTENSION))

TEMPLATE_DATA_FILES = $(addprefix $(SOURCE_DIR)/template_data/,basic_control_functions.lua register_types.lua)

# Unicorn 1.x gets put into places not on the typical linker search path, so we need to
# hardcode these additional directories it could appear in.
LIBRARY_DIRECTORIES = $(strip $(LUA_LIBDIR) $(UNICORN_LIBDIR) $(PTHREAD_LIBDIR) /usr/lib64 /usr/local/lib)
LIBRARY_DIRECTORIES = $(strip $(UNICORN_LIBDIR) $(PTHREAD_LIBDIR))

# 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
Expand Down Expand Up @@ -110,7 +107,12 @@ LINK_CMD = $(LD) $(LIB_PATH_FLAGS) $(LDFLAGS)


# Uncomment for debugging autogenerated files
# .PRECIOUS: $(ALL_AUTOGENERATED_SOURCES) $(LUA_SOURCE_DIR)/%_extracted_consts.lua %_const_gen.c
#.PRECIOUS: $(ALL_AUTOGENERATED_SOURCES) \
# $(LUA_SOURCE_DIR)/%_const_gen.c \
# $(LUA_SOURCE_DIR)/%_extracted_consts.txt \
# $(LUA_SOURCE_DIR)/%_extracted_consts.lua \
# %registers_const_gen.c \
# %_const_gen.c


# This must be the first rule, don't move it.
Expand Down
3 changes: 1 addition & 2 deletions unicorn-2.3.0-1.rockspec
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,10 @@ build = {
LD = "$(LD)",
LIBFLAG = "$(LIBFLAG)",
LUA_DIR = "$(LUA_DIR)",
LUA_INCDIR="$(LUA_INCDIR)",
LUA_INCDIR = "$(LUA_INCDIR)",
UNICORN_INCDIR = "$(UNICORN_INCDIR)",
UNICORN_LIBDIR = "$(UNICORN_LIBDIR)",
PTHREAD_LIBDIR = "$(PTHREAD_LIBDIR)",
LUALIB = "$(LUALIB)",
},
install_target = "__install",
install_variables = {
Expand Down

0 comments on commit 13f41a4

Please sign in to comment.