Refactor debugType (#13866)
[betaflight.git] / mk / system-id.mk
blob1fd42ed4ef3fdcfaae35577258096a9a457ae091
1 # shared.mk
3 # environment variables common to all operating systems supported by the make system
5 # Make sure we know a few things about the architecture
6 UNAME := $(shell uname)
7 ARCH := $(shell uname -m)
8 ifneq (,$(filter $(ARCH), x86_64 amd64))
9 X86-64 := 1
10 X86_64 := 1
11 AMD64 := 1
12 ARCHFAMILY := x86_64
13 else
14 ARCHFAMILY := $(ARCH)
15 endif
17 # configure some variables dependent upon what type of system this is
19 # Linux
20 ifeq ($(UNAME), Linux)
21 OSFAMILY := linux
22 endif
24 # Mac OSX
25 ifeq ($(UNAME), Darwin)
26 OSFAMILY := macosx
27 endif
29 # Windows using MinGW shell
30 ifeq (MINGW, $(findstring MINGW,$(UNAME)))
31 OSFAMILY := windows
32 MINGW := 1
33 endif
35 # Windows using Cygwin shell
36 ifeq (CYGWIN ,$(findstring CYGWIN,$(UNAME)))
37 OSFAMILY := windows
38 CYGWIN := 1
39 endif
41 # report an error if we couldn't work out what OS this is running on
42 ifndef OSFAMILY
43 $(info uname reports $(UNAME))
44 $(info uname -m reports $(ARCH))
45 $(error failed to detect operating system)
46 endif