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

Bugfix for compilation under macOS #415

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
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
17 changes: 15 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
-include ../../config.mk
-include ../../tools/kconfig/.config

OS:=$(shell uname)

CC:=$(CROSS_COMPILE)gcc
LD:=$(CROSS_COMPILE)ld
AR:=$(CROSS_COMPILE)ar
Expand Down Expand Up @@ -75,6 +77,17 @@ ifeq ($(CC),clang)
CFLAGS+= -Wunreachable-code-break -Wpointer-bool-conversion -Wmissing-variable-declarations
endif

ifeq ($(OS),Darwin)
LIBSIZE=stat -f%z
ifeq ($(SIZE),size)
SUMSIZE=$(SIZE)
else
SUMSIZE=$(SIZE) -t
endif
else
LIBSIZE=du -b
SUMSIZE=$(SIZE) -t
endif

ifeq ($(DEBUG),1)
CFLAGS+=-ggdb
Expand Down Expand Up @@ -353,8 +366,8 @@ lib: mod core
@test $(STRIP) -eq 1 && (echo -e "\t[STRIP] $(PREFIX)/lib/$(LIBNAME)" \
&& $(STRIP_BIN) $(PREFIX)/lib/$(LIBNAME)) \
|| echo -e "\t[KEEP SYMBOLS] $(PREFIX)/lib/$(LIBNAME)"
@echo -e "\t[LIBSIZE] `du -b $(PREFIX)/lib/$(LIBNAME)`"
@echo -e "`size -t $(PREFIX)/lib/$(LIBNAME)`"
@echo -e "\t[LIBSIZE] `$(LIBSIZE) $(PREFIX)/lib/$(LIBNAME)`"
@echo -e "`$(SUMSIZE) $(PREFIX)/lib/$(LIBNAME)`"

loop: mod core
mkdir -p $(PREFIX)/test
Expand Down