forked from frida/frida
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (31 loc) · 1.16 KB
/
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
26
27
28
29
30
31
32
33
34
35
modules = capstone frida-gum frida-core frida-python frida-node frida-tools
all $(MAKECMDGOALS):
@build_os=$$(uname -s | tr '[A-Z]' '[a-z]' | sed 's,^darwin$$,macos,'); \
$(MAKE) -f Makefile.$$build_os.mk $(MAKECMDGOALS)
git-submodules:
@if [ ! -f frida-core/meson.build ]; then \
git submodule init; \
git submodule update --init --recursive; \
fi
-include git-submodules
define make-update-submodule-stamp
$1-update-submodule-stamp: git-submodules
@mkdir -p build
@cd $1 \
&& git log -1 --format=%H > ../build/.$1-submodule-stamp.tmp \
&& git status >> ../build/.$1-submodule-stamp.tmp \
&& git diff >> ../build/.$1-submodule-stamp.tmp
@if [ -f build/.$1-submodule-stamp ]; then \
if cmp -s build/.$1-submodule-stamp build/.$1-submodule-stamp.tmp; then \
rm build/.$1-submodule-stamp.tmp; \
else \
mv build/.$1-submodule-stamp.tmp build/.$1-submodule-stamp; \
fi \
else \
mv build/.$1-submodule-stamp.tmp build/.$1-submodule-stamp; \
fi
endef
$(foreach m,$(modules),$(eval $(call make-update-submodule-stamp,$m)))
git-submodule-stamps: $(foreach m,$(modules),$m-update-submodule-stamp)
-include git-submodule-stamps
.PHONY: all $(MAKECMDGOALS)