summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rwxr-xr-xbuild45
1 files changed, 23 insertions, 22 deletions
diff --git a/build b/build
index 6acf866..81646cb 100755
--- a/build
+++ b/build
@@ -12,11 +12,15 @@ targets = $(OPK_HOST_ARCH)
version = $$(printf '%s\n' '$(OPK_SOURCE_VERSION_UPSTREAM)' | sed 's/+sip.*//')
base_version = $$(printf '%s\n' '$(OPK_SOURCE)' | sed 's/^gcc-//')
+
+target = ~none # Will be set in sub-makes
target_gnu = $$(oh-architecture $(target))
builddir = obj-$(target)
destdir = dest-$(target)
+include ../targets.d/$(target).mk
+
# /usr/lib/<target>/ld.so is a symbolic link for use by GCC to find the system's
# dynamic linker. It should be provided by the development package of any
# standard C library.
@@ -38,7 +42,8 @@ common_opts = \
--with-nls \
--with-sysroot="$${OPK_SYSROOT}" \
--with-gxx-include-dir="/usr/include/c++-$(base_version)" \
- --enable-clocale=gnu
+ --enable-clocale=gnu \
+ $(target_opts)
full_opts = \
$(common_opts) \
@@ -85,17 +90,14 @@ nop:
configure-native configure-cross:
set -e; \
- . "../targets.d/$(target).sh"; \
if [ 'x$(OPK_HOST_PLAT)' = 'xbootstrap1' ]; then \
oh-autoconfigure -B "$(builddir)" -t "$(target)" -- \
- $(bootstrap1_opts) \
- $${target_opts} \
- $(extra_opts); \
+ $(bootstrap1_opts) \
+ $(extra_opts); \
else \
oh-autoconfigure -B "$(builddir)" -t "$(target)" -- \
- $(full_opts) \
- $${target_opts} \
- $(extra_opts); \
+ $(full_opts) \
+ $(extra_opts); \
fi
build-gcc-config:
@@ -106,22 +108,21 @@ build-gcc-config:
# These commands run once per target, but they modify files in the src/
# directory that other targets might also use, so backups are made.
set -e; \
- . "../targets.d/$(target).sh"; \
- [ -e "src/gcc/config/$${gcc_config_file}.orig" ] || \
- mv "src/gcc/config/$${gcc_config_file}" \
- "src/gcc/config/$${gcc_config_file}.orig"; \
- define_pattern=".define $${gcc_config_interp_macro}"; \
+ [ -e "src/gcc/config/$(gcc_config_file).orig" ] || \
+ mv "src/gcc/config/$(gcc_config_file)" \
+ "src/gcc/config/$(gcc_config_file).orig"; \
+ define_pattern=".define $(gcc_config_interp_macro)"; \
sed "s|^\($${define_pattern}\) \".*\"$$|\1 \"$(elf_interp)\"|" \
- "src/gcc/config/$${gcc_config_file}.orig" \
- >"src/gcc/config/$${gcc_config_file}"; \
- [ -e "src/gcc/config/$${gcc_config_fragment}.orig" ] || \
- mv "src/gcc/config/$${gcc_config_fragment}" \
- "src/gcc/config/$${gcc_config_fragment}.orig"; \
- sed "$${gcc_config_fragment_script}" \
- "src/gcc/config/$${gcc_config_fragment}.orig" \
- >"src/gcc/config/$${gcc_config_fragment}"; \
+ "src/gcc/config/$(gcc_config_file).orig" \
+ >"src/gcc/config/$(gcc_config_file)"; \
+ [ -e "src/gcc/config/$(gcc_config_fragment).orig" ] || \
+ mv "src/gcc/config/$(gcc_config_fragment)" \
+ "src/gcc/config/$(gcc_config_fragment).orig"; \
+ sed "$(gcc_config_fragment_script)" \
+ "src/gcc/config/$(gcc_config_fragment).orig" \
+ >"src/gcc/config/$(gcc_config_fragment)"; \
printf '\nMULTIARCH_DIRNAME = %s\n' "$(target)" \
- >>"src/gcc/config/$${gcc_config_fragment}"
+ >>"src/gcc/config/$(gcc_config_fragment)"
build-native: build-gcc-config
oh-autobuild -B "$(builddir)" -T $(native_target) -- \