Skip to content

Commit

Permalink
khook: makefile cleanup (realpath replacement using perl)
Browse files Browse the repository at this point in the history
  • Loading branch information
milabs committed Mar 16, 2024
1 parent d477187 commit 3aae1e2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Makefile.khook
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
realpath_relative_to = $(shell perl -e 'use File::Spec; print File::Spec->abs2rel("$(2)","$(1)")') # realpath --relative-to=/a/path /b/path

ifneq ($(KERNELRELEASE),)
KHOOK_DIR := $(shell dirname $(shell realpath --relative-to=$(src) $(lastword $(MAKEFILE_LIST))))
KHOOK_DIR := $(patsubst %/,%,$(dir $(call realpath_relative_to,$(src),$(lastword $(MAKEFILE_LIST)))))
KHOOK_GOALS := $(KHOOK_DIR)/khook/engine.o
ifeq ($(ARCH),x86)
ifeq (x86,$(findstring x86,$(ARCH)))
KHOOK_GOALS += $(KHOOK_DIR)/khook/x86/hook.o $(KHOOK_DIR)/khook/x86/stub.o
else
$(error "ARCH is NOT supported")
Expand Down

0 comments on commit 3aae1e2

Please sign in to comment.