Swap OS and machine detection so OS comes first

This is in preparation for target architecture detection through
gcc / g++.
This commit is contained in:
katjav 2018-01-20 17:18:34 +01:00
parent 872c34b1d3
commit 4be3e99acb

View file

@ -425,39 +425,10 @@ endif
################################################################################ ################################################################################
### variables per platform ##################################################### ### platform detection #########################################################
################################################################################ ################################################################################
#=== flags per architecture ====================================================
# Set architecture-dependent cflags, mainly for Linux. For Mac and Windows,
# arch.c.flags are overriden below.
machine := $(shell uname -m)
# Raspberry Pi 1st generation
ifeq ($(machine), armv6l)
arch.c.flags = -march=armv6 -mfpu=vfp -mfloat-abi=hard
endif
# Beagle, Udoo, RPi2 etc.
ifeq ($(machine), armv7l)
arch.c.flags = -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard
endif
# Intel 32 bit, build with SSE and SSE2 instructions
ifeq ($(findstring $(machine), i386 i686), $(machine))
arch.c.flags = -march=pentium4 -mfpmath=sse -msse -msse2
endif
# Intel/AMD 64 bit, build with SSE, SSE2 and SSE3 instructions
ifeq ($(findstring $(machine), ia64 x86_64), $(machine))
arch.c.flags = -march=core2 -mfpmath=sse -msse -msse2 -msse3
endif
#=== operating system ========================================================== #=== operating system ==========================================================
@ -485,6 +456,44 @@ $(eval $(for$(system)))
# TODO: Cygwin, Android # TODO: Cygwin, Android
#=== architecture ==============================================================
machine := $(shell uname -m)
################################################################################
### variables per platform #####################################################
################################################################################
#=== flags per architecture ====================================================
# Set architecture-dependent cflags, mainly for Linux. For Mac and Windows,
# arch.c.flags are overriden below.
# Raspberry Pi 1st generation
ifeq ($(machine), armv6l)
arch.c.flags = -march=armv6 -mfpu=vfp -mfloat-abi=hard
endif
# Beagle, Udoo, RPi2 etc.
ifeq ($(machine), armv7l)
arch.c.flags = -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard
endif
# Intel 32 bit, build with SSE and SSE2 instructions
ifeq ($(findstring $(machine), i386 i686), $(machine))
arch.c.flags = -march=pentium4 -mfpmath=sse -msse -msse2
endif
# Intel/AMD 64 bit, build with SSE, SSE2 and SSE3 instructions
ifeq ($(findstring $(machine), ia64 x86_64), $(machine))
arch.c.flags = -march=core2 -mfpmath=sse -msse -msse2 -msse3
endif
#=== flags and paths for Linux ================================================= #=== flags and paths for Linux =================================================