forked from knightsc/gapstone
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (25 loc) · 881 Bytes
/
Makefile
File metadata and controls
30 lines (25 loc) · 881 Bytes
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
26
27
28
29
30
GO_CGO_CFLAGS := CGO_CFLAGS='-O1 -I$(CURDIR)/capstone/include'
GO_CGO_LDFLAGS := CGO_LDFLAGS='-O1 -g -L$(CURDIR)/capstone/build -lcapstone'
GO_LD_LIBRARY_PATH := LD_LIBRARY_PATH='$(CURDIR)/capstone/build:$(LD_LIBRARY_PATH)'
LIBCAPSTONE_OBJ := capstone/build/libcapstone.a
$(LIBCAPSTONE_OBJ):
if [ ! -e capstone/Makefile ]; then \
git submodule update --init --recursive; \
fi
cd capstone && \
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCAPSTONE_USE_ARCH_REGISTRATION=0 \
-DCAPSTONE_ARCHITECTURE_DEFAULT=1 \
-DCAPSTONE_BUILD_SHARED_LIBS=1 \
-DCAPSTONE_BUILD_CSTOOL=0 && \
cmake --build build
.DEFAULT_GOAL := update
.PHONY: update
update:
./genspec ./capstone/build
./genconst ./capstone/bindings/python/capstone
.PHONY: gotest
gotest: $(LIBCAPSTONE_OBJ)
@rm -f *.SPEC.test
$(GO_LD_LIBRARY_PATH) $(GO_CGO_CFLAGS) $(GO_CGO_LDFLAGS) go test -v .