Skip to content

Commit

Permalink
build: Eliminate most of the autotools logic
Browse files Browse the repository at this point in the history
Our SDK only has one autotools dependency left (libiconv), and the
toolchain has two that are purely build-time (flex and bison). So given
their simplicity we can finally remove the generic support for
autotools. This means we now only have one .rc per environment.
  • Loading branch information
oleavr committed Jan 26, 2022
1 parent 21c45eb commit 2f82e80
Show file tree
Hide file tree
Showing 10 changed files with 82 additions and 328 deletions.
10 changes: 5 additions & 5 deletions Makefile.freebsd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ gum: build/frida-freebsd-$(build_arch)/libdata/pkgconfig/frida-gum-1.0.pc ##@gum


build/frida-%/libdata/pkgconfig/frida-gum-1.0.pc: build/frida-env-%.rc build/.frida-gum-submodule-stamp
. build/frida-meson-env-$*.rc; \
. build/frida-env-$*.rc; \
builddir=build/tmp-$*/frida-gum; \
if [ ! -f $$builddir/build.ninja ]; then \
$(call meson-setup,$*) \
Expand All @@ -91,7 +91,7 @@ check-gum: gum ##@gum Run tests
core: build/frida-freebsd-$(build_arch)/libdata/pkgconfig/frida-core-1.0.pc ##@core Build

build/tmp-%/frida-core/.frida-ninja-stamp: build/.frida-core-submodule-stamp build/frida-%/libdata/pkgconfig/frida-gum-1.0.pc
. build/frida-meson-env-$*.rc; \
. build/frida-env-$*.rc; \
builddir=$(@D); \
if [ ! -f $$builddir/build.ninja ]; then \
$(call meson-setup,$*) \
Expand All @@ -102,7 +102,7 @@ build/tmp-%/frida-core/.frida-ninja-stamp: build/.frida-core-submodule-stamp bui
@touch $@

build/frida-%/libdata/pkgconfig/frida-core-1.0.pc: build/tmp-%/frida-core/.frida-ninja-stamp
. build/frida-meson-env-$*.rc && $(MESON) install -C build/tmp-$*/frida-core
. build/frida-env-$*.rc && $(MESON) install -C build/tmp-$*/frida-core
@touch $@

check-core: core ##@core Run tests
Expand All @@ -112,7 +112,7 @@ check-core: core ##@core Run tests
python: build/tmp-freebsd-$(build_arch)/frida-$(PYTHON_NAME)/.frida-stamp ##@python Build Python bindings

build/tmp-%/frida-$(PYTHON_NAME)/.frida-stamp: build/.frida-python-submodule-stamp build/frida-%/libdata/pkgconfig/frida-core-1.0.pc
. build/frida-meson-env-$*.rc; \
. build/frida-env-$*.rc; \
builddir=$(@D); \
if [ ! -f $$builddir/build.ninja ]; then \
$(call meson-setup,$*) \
Expand Down Expand Up @@ -165,7 +165,7 @@ check-node: node ##@node Test Node.js bindings
tools: build/tmp-freebsd-$(build_arch)/frida-tools-$(PYTHON_NAME)/.frida-stamp ##@tools Build CLI tools

build/tmp-%/frida-tools-$(PYTHON_NAME)/.frida-stamp: build/.frida-tools-submodule-stamp build/tmp-%/frida-$(PYTHON_NAME)/.frida-stamp
. build/frida-meson-env-$*.rc; \
. build/frida-env-$*.rc; \
builddir=$(@D); \
if [ ! -f $$builddir/build.ninja ]; then \
$(call meson-setup,$*) \
Expand Down
40 changes: 20 additions & 20 deletions Makefile.linux.mk
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ gum-qnx-armeabi: build/frida_thin-qnx-armeabi/lib/pkgconfig/frida-gum-1.0.pc ##@

define make-gum-rules
build/$1-%/lib/pkgconfig/frida-gum-1.0.pc: build/$1-env-%.rc build/.frida-gum-submodule-stamp
. build/$1-meson-env-$$*.rc; \
. build/$1-env-$$*.rc; \
builddir=build/$2-$$*/frida-gum; \
if [ ! -f $$$$builddir/build.ninja ]; then \
$$(call meson-setup-for-env,$1,$$*) \
Expand Down Expand Up @@ -146,7 +146,7 @@ core-qnx-arm: build/frida_thin-qnx-arm/lib/pkgconfig/frida-core-1.0.pc ##@core B
core-qnx-armeabi: build/frida_thin-qnx-armeabi/lib/pkgconfig/frida-core-1.0.pc ##@core Build for QNX/armeabi

build/tmp-linux-x86/frida-core/.frida-ninja-stamp: build/.frida-core-submodule-stamp build/frida-linux-x86/lib/pkgconfig/frida-gum-1.0.pc
. build/frida-meson-env-linux-x86.rc; \
. build/frida-env-linux-x86.rc; \
builddir=$(@D); \
if [ ! -f $$builddir/build.ninja ]; then \
$(call meson-setup,linux-x86) \
Expand All @@ -157,7 +157,7 @@ build/tmp-linux-x86/frida-core/.frida-ninja-stamp: build/.frida-core-submodule-s
fi
@touch $@
build/tmp-linux-x86_64/frida-core/.frida-ninja-stamp: build/.frida-core-submodule-stamp build/frida-linux-x86_64/lib/pkgconfig/frida-gum-1.0.pc
. build/frida-meson-env-linux-x86_64.rc; \
. build/frida-env-linux-x86_64.rc; \
builddir=$(@D); \
if [ ! -f $$builddir/build.ninja ]; then \
$(call meson-setup,linux-x86_64) \
Expand All @@ -172,7 +172,7 @@ build/tmp-linux-x86_64/frida-core/.frida-ninja-stamp: build/.frida-core-submodul
fi
@touch $@
build/tmp-android-x86/frida-core/.frida-ninja-stamp: build/.frida-core-submodule-stamp build/frida-android-x86/lib/pkgconfig/frida-gum-1.0.pc
. build/frida-meson-env-android-x86.rc; \
. build/frida-env-android-x86.rc; \
builddir=$(@D); \
if [ ! -f $$builddir/build.ninja ]; then \
$(call meson-setup,android-x86) \
Expand All @@ -184,7 +184,7 @@ build/tmp-android-x86/frida-core/.frida-ninja-stamp: build/.frida-core-submodule
fi
@touch $@
build/tmp-android-x86_64/frida-core/.frida-ninja-stamp: build/.frida-core-submodule-stamp build/frida-android-x86_64/lib/pkgconfig/frida-gum-1.0.pc
. build/frida-meson-env-android-x86_64.rc; \
. build/frida-env-android-x86_64.rc; \
builddir=$(@D); \
if [ ! -f $$builddir/build.ninja ]; then \
$(call meson-setup,android-x86_64) \
Expand All @@ -201,7 +201,7 @@ build/tmp-android-x86_64/frida-core/.frida-ninja-stamp: build/.frida-core-submod
fi
@touch $@
build/tmp-android-arm/frida-core/.frida-ninja-stamp: build/.frida-core-submodule-stamp build/frida-android-arm/lib/pkgconfig/frida-gum-1.0.pc
. build/frida-meson-env-android-arm.rc; \
. build/frida-env-android-arm.rc; \
builddir=$(@D); \
if [ ! -f $$builddir/build.ninja ]; then \
$(call meson-setup,android-arm) \
Expand All @@ -212,7 +212,7 @@ build/tmp-android-arm/frida-core/.frida-ninja-stamp: build/.frida-core-submodule
fi
@touch $@
build/tmp-android-arm64/frida-core/.frida-ninja-stamp: build/.frida-core-submodule-stamp build/frida-android-arm64/lib/pkgconfig/frida-gum-1.0.pc
. build/frida-meson-env-android-arm64.rc; \
. build/frida-env-android-arm64.rc; \
builddir=$(@D); \
if [ ! -f $$builddir/build.ninja ]; then \
$(call meson-setup,android-arm64) \
Expand All @@ -227,7 +227,7 @@ build/tmp-android-arm64/frida-core/.frida-ninja-stamp: build/.frida-core-submodu
fi
@touch $@
build/tmp_thin-%/frida-core/.frida-ninja-stamp: build/.frida-core-submodule-stamp build/frida_thin-%/lib/pkgconfig/frida-gum-1.0.pc
. build/frida_thin-meson-env-$*.rc; \
. build/frida_thin-env-$*.rc; \
builddir=$(@D); \
if [ ! -f $$builddir/build.ninja ]; then \
$(call meson-setup-thin,$*) \
Expand All @@ -240,41 +240,41 @@ build/tmp_thin-%/frida-core/.frida-ninja-stamp: build/.frida-core-submodule-stam

build/frida-linux-x86/lib/pkgconfig/frida-core-1.0.pc: build/tmp-linux-x86/frida-core/.frida-helper-and-agent-stamp
@rm -f build/tmp-linux-x86/frida-core/src/frida-data-{helper,agent}*
. build/frida-meson-env-linux-x86.rc && $(MESON) install -C build/tmp-linux-x86/frida-core
. build/frida-env-linux-x86.rc && $(MESON) install -C build/tmp-linux-x86/frida-core
@touch $@
build/frida-linux-x86_64/lib/pkgconfig/frida-core-1.0.pc: build/tmp-linux-x86/frida-core/.frida-helper-and-agent-stamp build/tmp-linux-x86_64/frida-core/.frida-helper-and-agent-stamp
@rm -f build/tmp-linux-x86_64/frida-core/src/frida-data-{helper,agent}*
. build/frida-meson-env-linux-x86_64.rc && $(MESON) install -C build/tmp-linux-x86_64/frida-core
. build/frida-env-linux-x86_64.rc && $(MESON) install -C build/tmp-linux-x86_64/frida-core
@touch $@
build/frida-android-x86/lib/pkgconfig/frida-core-1.0.pc: build/tmp-android-x86/frida-core/.frida-helper-and-agent-stamp build/tmp-android-arm/frida-core/.frida-agent-stamp
@rm -f build/tmp-android-x86/frida-core/src/frida-data-{helper,agent}*
. build/frida-meson-env-android-x86.rc && $(MESON) install -C build/tmp-android-x86/frida-core
. build/frida-env-android-x86.rc && $(MESON) install -C build/tmp-android-x86/frida-core
@touch $@
build/frida-android-x86_64/lib/pkgconfig/frida-core-1.0.pc: build/tmp-android-x86/frida-core/.frida-helper-and-agent-stamp build/tmp-android-x86_64/frida-core/.frida-helper-and-agent-stamp build/tmp-android-arm/frida-core/.frida-agent-stamp build/tmp-android-arm64/frida-core/.frida-agent-stamp
@rm -f build/tmp-android-x86_64/frida-core/src/frida-data-{helper,agent}*
. build/frida-meson-env-android-x86_64.rc && $(MESON) install -C build/tmp-android-x86_64/frida-core
. build/frida-env-android-x86_64.rc && $(MESON) install -C build/tmp-android-x86_64/frida-core
@touch $@
build/frida-android-arm/lib/pkgconfig/frida-core-1.0.pc: build/tmp-android-arm/frida-core/.frida-helper-and-agent-stamp
@rm -f build/tmp-android-arm/frida-core/src/frida-data-{helper,agent}*
. build/frida-meson-env-android-arm.rc && $(MESON) install -C build/tmp-android-arm/frida-core
. build/frida-env-android-arm.rc && $(MESON) install -C build/tmp-android-arm/frida-core
@touch $@
build/frida-android-armbe8/lib/pkgconfig/frida-core-1.0.pc: build/tmp-android-armbe8/frida-core/.frida-helper-and-agent-stamp
@rm -f build/tmp-android-armbe8/frida-core/src/frida-data-{helper,agent}*
. build/frida-meson-env-android-armbe8.rc && $(MESON) install -C build/tmp-android-armbe8/frida-core
. build/frida-env-android-armbe8.rc && $(MESON) install -C build/tmp-android-armbe8/frida-core
@touch $@
build/frida-android-arm64/lib/pkgconfig/frida-core-1.0.pc: build/tmp-android-arm/frida-core/.frida-helper-and-agent-stamp build/tmp-android-arm64/frida-core/.frida-helper-and-agent-stamp
@rm -f build/tmp-android-arm64/frida-core/src/frida-data-{helper,agent}*
. build/frida-meson-env-android-arm64.rc && $(MESON) install -C build/tmp-android-arm64/frida-core
. build/frida-env-android-arm64.rc && $(MESON) install -C build/tmp-android-arm64/frida-core
@touch $@
build/frida_thin-%/lib/pkgconfig/frida-core-1.0.pc: build/tmp_thin-%/frida-core/.frida-ninja-stamp
. build/frida_thin-meson-env-$*.rc && $(MESON) install -C build/tmp_thin-$*/frida-core
. build/frida_thin-env-$*.rc && $(MESON) install -C build/tmp_thin-$*/frida-core
@touch $@

build/tmp-%/frida-core/.frida-helper-and-agent-stamp: build/tmp-%/frida-core/.frida-ninja-stamp
. build/frida-meson-env-$*.rc && ninja -C build/tmp-$*/frida-core src/frida-helper lib/agent/frida-agent.so
. build/frida-env-$*.rc && ninja -C build/tmp-$*/frida-core src/frida-helper lib/agent/frida-agent.so
@touch $@
build/tmp-%/frida-core/.frida-agent-stamp: build/tmp-%/frida-core/.frida-ninja-stamp
. build/frida-meson-env-$*.rc && ninja -C build/tmp-$*/frida-core lib/agent/frida-agent.so
. build/frida-env-$*.rc && ninja -C build/tmp-$*/frida-core lib/agent/frida-agent.so
@touch $@

check-core-linux-x86: core-linux-x86 ##@core Run tests for Linux/x86
Expand All @@ -300,7 +300,7 @@ python-linux-arm64: build/tmp_thin-linux-arm64/frida-$(PYTHON_NAME)/.frida-stamp

define make-python-rule
build/$2-%/frida-$$(PYTHON_NAME)/.frida-stamp: build/.frida-python-submodule-stamp build/$1-%/lib/pkgconfig/frida-core-1.0.pc
. build/$1-meson-env-$$*.rc; \
. build/$1-env-$$*.rc; \
builddir=$$(@D); \
if [ ! -f $$$$builddir/build.ninja ]; then \
$$(call meson-setup-for-env,$1,$$*) \
Expand Down Expand Up @@ -406,7 +406,7 @@ tools-linux-arm64: build/tmp_thin-linux-arm64/frida-tools-$(PYTHON_NAME)/.frida-

define make-tools-rule
build/$2-%/frida-tools-$$(PYTHON_NAME)/.frida-stamp: build/.frida-tools-submodule-stamp build/$2-%/frida-$$(PYTHON_NAME)/.frida-stamp
. build/$1-meson-env-$$*.rc; \
. build/$1-env-$$*.rc; \
builddir=$$(@D); \
if [ ! -f $$$$builddir/build.ninja ]; then \
$$(call meson-setup-for-env,$1,$$*) \
Expand Down
Loading

0 comments on commit 2f82e80

Please sign in to comment.