-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
25 lines (19 loc) · 828 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
PRJ_NAME := pe
PRJ_BRANCH := 1.0
PRJ_VERSION := $(PRJ_BRANCH).0
PRJ_TYPE := lib
TEST_EXTRA_LINK_LIBS = -lrt -lpthread
CPP_EXTRA_FLAGS = -Wall -Wextra -Wno-unused-parameter -Werror -fmax-errors=1 -Wno-deprecated-declarations
LIB_PRELOAD = build/lib/$(BUILD_MODE)/libPePreload-$(PRJ_BRANCH).so
TARGET_EXTRA_DEPENDENCY = $(LIB_PRELOAD)
TEST_LAUNCHER = LD_PRELOAD=$(LIB_PRELOAD) #LD_DEBUG=symbols,libs,calls
include ../makefile/Makefile
LINK_OPTIONS += -Wl,-init,initPe
$(LIB_PRELOAD): build/obj/$(BUILD_MODE)/preload/PePreload.o
$(V)echo " linking $@"
$(V)mkdir -p $(@D)
$(V)gcc -shared -g -Wl,-init,initPePreload -o $@ $< -ldl -lpthread
build/obj/$(BUILD_MODE)/preload/PePreload.o: src/preload/PePreload.c
$(V)echo " compiling $<"
$(V)mkdir -p $(@D)
$(V)gcc -fPIC -Wall -g -O0 -c $< -o $@ # -DPEPRELOAD_DEBUG