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

(enh) Build for Linux on ARM. #25

Merged
merged 3 commits into from
Jul 9, 2024
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
28 changes: 21 additions & 7 deletions projects/make/wrenc.make
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ ifeq (.exe,$(findstring .exe,$(ComSpec)))
SHELLTYPE := msdos
endif

# This makefile can be used to compile on Linux for ARM cpu,
# but without the `-m64` flag
machine := $(shell uname -m)

# Configurations
# #############################################

Expand All @@ -38,9 +42,14 @@ TARGETDIR = ../../bin
TARGET = $(TARGETDIR)/wrenc
OBJDIR = obj/64bit/Release
DEFINES += -DNDEBUG -D_GNU_SOURCE
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -O3 -std=c99
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -O3
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64 -s
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -O3 -std=c99
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -O3
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -s
ifeq ($(machine),x86_64)
ALL_CFLAGS += -m64
ALL_CXXFLAGS += -m64
ALL_LDFLAGS += -m64
endif

else ifeq ($(config),release_32bit)
TARGETDIR = ../../bin
Expand All @@ -65,9 +74,14 @@ TARGETDIR = ../../bin
TARGET = $(TARGETDIR)/wrenc_d
OBJDIR = obj/64bit/Debug
DEFINES += -DDEBUG -D_GNU_SOURCE
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -m64 -g -std=c99
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -m64 -g
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64 -m64
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -std=c99
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
ALL_LDFLAGS += $(LDFLAGS) -L/usr/lib64
ifeq ($(machine),x86_64)
ALL_CFLAGS += -m64
ALL_CXXFLAGS += -m64
ALL_LDFLAGS += -m64
endif

else ifeq ($(config),debug_32bit)
TARGETDIR = ../../bin
Expand Down Expand Up @@ -481,4 +495,4 @@ $(OBJDIR)/timer1.o: ../../src/module/timer.c
-include $(OBJECTS:%.o=%.d)
ifneq (,$(PCH))
-include $(PCH_PLACEHOLDER).d
endif
endif
Loading