Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Makefile #2537

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 17 additions & 20 deletions src/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
arch = $(shell dpkg --print-architecture)
platform = $(shell uname -m)
prefix =

Expand Down Expand Up @@ -47,34 +48,30 @@ ifeq ($(platform), armv6l)
CFLAGS += -march=armv6
CFLAGS += -lrt
ZWOSDK = -Llib/armv6 -I./include
endif

ifeq ($(platform), armv7l)
CC = arm-linux-gnueabihf-g++
AR= arm-linux-gnueabihf-ar
CFLAGS += -march=armv7 -mthumb
ZWOSDK = -Llib/armv7 -I./include
endif

#Ubuntu 20.04 added by Jos Wennmacker
ifeq ($(platform), aarch64)
CC = g++
AR= ar
ZWOSDK = -Llib/armv8 -I./include
endif

ifeq ($(platform), x86_64)
else ifeq ($(platform), x86_64)
CC = g++
AR= ar
ZWOSDK = -Llib/x64 -I./include
endif

ifeq ($(platform), i386)
else ifeq ($(platform), i386)
CC = g++
AR= ar
ZWOSDK = -Llib/x86 -I./include
else ifeq ($(arch), arm64)
# Ubuntu 20.04 added by Jos Wennmacker.
CC = g++
AR= ar
ZWOSDK = -Llib/armv8 -I./include
else # $(platform) = armv7l or $(arch) = armhf
# Starting with the Feb 2023 Bullseye release, both 32- and 64-bit return
# $(platform) of "aarch64" on 64-bit hardware so we need to check $(arch),
# which returns "armhf" on 32-bit OS and "armhf" on 64-bit OS.
CC = arm-linux-gnueabihf-g++
AR= arm-linux-gnueabihf-ar
CFLAGS += -march=armv7 -mthumb
ZWOSDK = -Llib/armv7 -I./include
endif


ifeq (,$(CC))
$(warning Could not identify the proper compiler for your platform.)
$(error Unknown platform $(platform))
Expand Down