Merge pull request #10337 from MATEKSYS/master
[betaflight.git] / make / system-id.mk
blobfc28a955e101773c45059f2d1a173200fb6700bc
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 LINUX := 1
23 endif
25 # Mac OSX
26 ifeq ($(UNAME), Darwin)
27 OSFAMILY := macosx
28 MACOSX := 1
29 endif
31 # Windows using MinGW shell
32 ifeq (MINGW, $(findstring MINGW,$(UNAME)))
33 OSFAMILY := windows
34 MINGW := 1
35 WINDOWS := 1
36 endif
38 # Windows using Cygwin shell
39 ifeq (CYGWIN ,$(findstring CYGWIN,$(UNAME)))
40 OSFAMILY := windows
41 WINDOWS := 1
42 CYGWIN := 1
43 endif
45 # report an error if we couldn't work out what OS this is running on
46 ifndef OSFAMILY
47 $(info uname reports $(UNAME))
48 $(info uname -m reports $(ARCH))
49 $(error failed to detect operating system)
50 endif