forked from mutability/dump1090
-
Notifications
You must be signed in to change notification settings - Fork 239
/
Makefile.cpufeatures
34 lines (28 loc) · 1.41 KB
/
Makefile.cpufeatures
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# -*- makefile -*-
# cmake integration is a little tricky, so let's do this by hand for now
CPUFEATURES_UNAME ?= $(UNAME)
CPUFEATURES_ARCH ?= $(ARCH)
CPUFEATURES_CFLAGS ?= $(CFLAGS)
CPUFEATURES_OBJS := cpu_features/src/filesystem.o cpu_features/src/stack_line_reader.o cpu_features/src/string_view.o
CPUFEATURES_EXTRA_CFLAGS := -std=c99
CPUFEATURES_EXTRA_CPPFLAGS := -DSTACK_LINE_READER_BUFFER_SIZE=1024 -DNDEBUG -Icpu_features/include
ifeq ($(CPUFEATURES_UNAME),Linux)
CPUFEATURES_OBJS += cpu_features/src/hwcaps.o
CPUFEATURES_EXTRA_CPPFLAGS += -DHAVE_STRONG_GETAUXVAL
else ifeq ($(CPUFEATURES_UNAME),Darwin)
CPUFEATURES_EXTRA_CPPFLAGS += -DHAVE_SYSCTLBYNAME
endif
ifeq ($(CPUFEATURES_ARCH),x86_64)
CPUFEATURES_OBJS += cpu_features/src/cpuinfo_x86.o
else ifeq ($(CPUFEATURES_ARCH),amd64)
CPUFEATURES_OBJS += cpu_features/src/cpuinfo_x86.o
else ifneq (,$(filter i%86,$(CPUFEATURES_ARCH)))
CPUFEATURES_OBJS += cpu_features/src/cpuinfo_x86.o
else ifneq (,$(findstring aarch64,$(CPUFEATURES_ARCH)))
CPUFEATURES_OBJS += cpu_features/src/cpuinfo_aarch64.o
else ifneq (,$(findstring arm64,$(CPUFEATURES_ARCH)))
CPUFEATURES_OBJS += cpu_features/src/cpuinfo_aarch64.o
else ifneq (,$(findstring arm,$(CPUFEATURES_ARCH)))
CPUFEATURES_OBJS += cpu_features/src/cpuinfo_arm.o
endif
$(CPUFEATURES_OBJS): override ALL_CCFLAGS := $(CPUFEATURES_CPPFLAGS) $(CPUFEATURES_EXTRA_CPPFLAGS) $(CPUFEATURES_CFLAGS) $(CPUFEATURES_EXTRA_CFLAGS)