From 66a30d686cf9d46f25e649b93bb8cae90a9d7475 Mon Sep 17 00:00:00 2001 From: midipix Date: Wed, 21 Nov 2018 20:48:54 -0500 Subject: build system: created skeleton. --- sysinfo/host/any-host.mk | 7 ++++++ sysinfo/host/host.sh | 48 ++++++++++++++++++++++++++++++++++++ sysinfo/host/i686-nt32-midipix.mk | 5 ++++ sysinfo/host/i686-unknown-linux.mk | 5 ++++ sysinfo/host/i686-w64-mingw32.mk | 5 ++++ sysinfo/host/native.mk | 45 +++++++++++++++++++++++++++++++++ sysinfo/host/x86_64-nt64-midipix.mk | 5 ++++ sysinfo/host/x86_64-unknown-linux.mk | 5 ++++ sysinfo/host/x86_64-w64-mingw32.mk | 5 ++++ 9 files changed, 130 insertions(+) create mode 100644 sysinfo/host/any-host.mk create mode 100755 sysinfo/host/host.sh create mode 100644 sysinfo/host/i686-nt32-midipix.mk create mode 100644 sysinfo/host/i686-unknown-linux.mk create mode 100644 sysinfo/host/i686-w64-mingw32.mk create mode 100644 sysinfo/host/native.mk create mode 100644 sysinfo/host/x86_64-nt64-midipix.mk create mode 100644 sysinfo/host/x86_64-unknown-linux.mk create mode 100644 sysinfo/host/x86_64-w64-mingw32.mk (limited to 'sysinfo/host') diff --git a/sysinfo/host/any-host.mk b/sysinfo/host/any-host.mk new file mode 100644 index 0000000..acb606a --- /dev/null +++ b/sysinfo/host/any-host.mk @@ -0,0 +1,7 @@ +include $(PROJECT_DIR)/sysinfo/os/any-os.mk + +ARCH = +HOST_BITS = +HOST_UNDERSCORE = + +CROSS_HOST = $(TARGET) diff --git a/sysinfo/host/host.sh b/sysinfo/host/host.sh new file mode 100755 index 0000000..686edca --- /dev/null +++ b/sysinfo/host/host.sh @@ -0,0 +1,48 @@ +#!/bin/sh + +error_msg() +{ + echo $@ >&2 +} + +host_test() +{ + mb_hdrdir=$(pwd)/build + mkdir -p $mb_hdrdir || exit 2 + + if [ -z "$mb_compiler" ]; then + echo "config error: compiler not set." + exit 2 + fi + + $mb_compiler $mb_cflags -dumpmachine && return 0 + + error_msg "config error: invalid compiler." + exit 2 +} + +# one: args +for arg ; do + case "$arg" in + --help) usage + ;; + --compiler=*) + mb_compiler=${arg#*=} + ;; + --cflags=*) + mb_cflags=${arg#*=} + ;; + *) + error_msg ${arg#}: "unsupported config argument." + exit 2 + ;; + esac +done + + +# two: test +host_test + + +# all done +exit 0 diff --git a/sysinfo/host/i686-nt32-midipix.mk b/sysinfo/host/i686-nt32-midipix.mk new file mode 100644 index 0000000..fd4b8f8 --- /dev/null +++ b/sysinfo/host/i686-nt32-midipix.mk @@ -0,0 +1,5 @@ +include $(PROJECT_DIR)/sysinfo/os/midipix.mk + +ARCH = nt32 +HOST_BITS = 32 +HOST_UNDERSCORE = '_' diff --git a/sysinfo/host/i686-unknown-linux.mk b/sysinfo/host/i686-unknown-linux.mk new file mode 100644 index 0000000..bec437c --- /dev/null +++ b/sysinfo/host/i686-unknown-linux.mk @@ -0,0 +1,5 @@ +include $(PROJECT_DIR)/sysinfo/os/linux.mk + +ARCH = i386 +HOST_BITS = 32 +HOST_UNDERSCORE = '_' diff --git a/sysinfo/host/i686-w64-mingw32.mk b/sysinfo/host/i686-w64-mingw32.mk new file mode 100644 index 0000000..b18e2e3 --- /dev/null +++ b/sysinfo/host/i686-w64-mingw32.mk @@ -0,0 +1,5 @@ +include $(PROJECT_DIR)/sysinfo/os/mingw.mk + +ARCH = w32 +HOST_BITS = 32 +HOST_UNDERSCORE = '_' diff --git a/sysinfo/host/native.mk b/sysinfo/host/native.mk new file mode 100644 index 0000000..f0cf720 --- /dev/null +++ b/sysinfo/host/native.mk @@ -0,0 +1,45 @@ +include $(PROJECT_DIR)/sysinfo/os/$(NATIVE_OS).mk + +OS = $(NATIVE_OS) +HOST_BITS = $(NATIVE_OS_BITS) +HOST_UNDERSCORE = $(NATIVE_OS_UNDERSCORE) + +ifeq ($(OS),linux) + ifeq ($(HOST_BITS),32) + ARCH = i386 + else ifeq ($(HOST_BITS),64) + ARCH = x86_64 + endif +endif + +ifeq ($(OS),midipix) + ifeq ($(HOST_BITS),32) + ARCH = nt32 + else ifeq ($(HOST_BITS),64) + ARCH = nt64 + endif +endif + +ifeq ($(OS),mingw) + ifeq ($(HOST_BITS),32) + ARCH = w32 + else ifeq ($(HOST_BITS),64) + ARCH = w64 + endif +endif + +ifeq ($(OS),bsd) + ifeq ($(HOST_BITS),32) + ARCH = bsd32 + else ifeq ($(HOST_BITS),64) + ARCH = bsd64 + endif +endif + +ifeq ($(OS),darwin) + ifeq ($(HOST_BITS),32) + ARCH = dw32 + else ifeq ($(HOST_BITS),64) + ARCH = dw64 + endif +endif diff --git a/sysinfo/host/x86_64-nt64-midipix.mk b/sysinfo/host/x86_64-nt64-midipix.mk new file mode 100644 index 0000000..d0e1d52 --- /dev/null +++ b/sysinfo/host/x86_64-nt64-midipix.mk @@ -0,0 +1,5 @@ +include $(PROJECT_DIR)/sysinfo/os/midipix.mk + +ARCH = nt64 +HOST_BITS = 64 +HOST_UNDERSCORE = '' diff --git a/sysinfo/host/x86_64-unknown-linux.mk b/sysinfo/host/x86_64-unknown-linux.mk new file mode 100644 index 0000000..4bd1bff --- /dev/null +++ b/sysinfo/host/x86_64-unknown-linux.mk @@ -0,0 +1,5 @@ +include $(PROJECT_DIR)/sysinfo/os/linux.mk + +ARCH = x86_64 +HOST_BITS = 64 +HOST_UNDERSCORE = '' diff --git a/sysinfo/host/x86_64-w64-mingw32.mk b/sysinfo/host/x86_64-w64-mingw32.mk new file mode 100644 index 0000000..a86f9b0 --- /dev/null +++ b/sysinfo/host/x86_64-w64-mingw32.mk @@ -0,0 +1,5 @@ +include $(PROJECT_DIR)/sysinfo/os/mingw.mk + +ARCH = w64 +HOST_BITS = 64 +HOST_UNDERSCORE = '' -- cgit v1.2.3