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

libmphoenix: separate math.h from libphoenix (draft) #166

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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: 12 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ include ../phoenix-rtos-build/Makefile.$(TARGET_SUFF)
SYSROOT := $(shell $(CC) $(CFLAGS) -print-sysroot)
MULTILIB_DIR := $(shell $(CC) $(CFLAGS) -print-multi-directory)
LIBC_INSTALL_DIR := $(SYSROOT)/lib/$(MULTILIB_DIR)
LIBC_INSTALL_NAMES := libc.a libm.a crt0.o libg.a
LIBC_INSTALL_NAMES := libc.a crt0.o libg.a
HEADERS_INSTALL_DIR := $(SYSROOT)/usr/include
LIBNAME := libphoenix.a

Expand All @@ -40,17 +40,17 @@ CFLAGS += -Iinclude -fno-builtin-malloc


OBJS = $(PREFIX_O)_startc.o
LIBM_OBJS = $(PREFIX_O)_startc.o


all: $(PREFIX_A)libphoenix.a

all: $(PREFIX_A)libphoenix.a $(PREFIX_A)libmphoenix.a

# Libphoenix .o files
include arch/$(TARGET_SUFF)/Makefile
include ctype/Makefile
include err/Makefile
include errno/Makefile
include locale/Makefile
include math/Makefile
include misc/Makefile
include net/Makefile
include netinet/Makefile
Expand All @@ -67,24 +67,31 @@ include termios/Makefile
include time/Makefile
include unistd/Makefile

# Libmphoenix .o files
include math/Makefile

#include test/Makefile

$(PREFIX_A)libphoenix.a: $(OBJS)
$(ARCH)

$(PREFIX_A)libmphoenix.a: $(LIBM_OBJS)
$(ARCH)

SRCHEADERS := $(shell find include -name \*.h)

#HEADERS := $(patsubst include/%,$(HEADERS_INSTALL_DIR)%,$(SRCHEADERS))
install: $(PREFIX_A)libphoenix.a $(SRCHEADERS)
install: $(PREFIX_A)libphoenix.a $(PREFIX_A)libmphoenix.a $(SRCHEADERS)
@echo INSTALL "$(LIBC_INSTALL_DIR)/*"; \
mkdir -p "$(LIBC_INSTALL_DIR)"; \
cp -a "$<" "$(LIBC_INSTALL_DIR)"; \
cp -a $(PREFIX_A)libmphoenix.a "$(LIBC_INSTALL_DIR)"; \
for lib in $(LIBC_INSTALL_NAMES); do \
if [ ! -e "$(LIBC_INSTALL_DIR)/$$lib" ]; then \
ln -sf "$(LIBC_INSTALL_DIR)/libphoenix.a" "$(LIBC_INSTALL_DIR)/$$lib"; \
fi \
done; \
ln -sf "$(LIBC_INSTALL_DIR)/libmphoenix.a" "$(LIBC_INSTALL_DIR)/libm.a"; \
echo INSTALL "$(HEADERS_INSTALL_DIR)/*"; \
mkdir -p "$(HEADERS_INSTALL_DIR)"; \
cp -a include/* "$(HEADERS_INSTALL_DIR)";
Expand Down
2 changes: 1 addition & 1 deletion math/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
# Copyright 2012-2015, 2020 Phoenix Systems
#

OBJS += $(addprefix $(PREFIX_O)math/, trig.o power.o exp.o common.o hyper.o)
LIBM_OBJS += $(addprefix $(PREFIX_O)math/, trig.o power.o exp.o common.o hyper.o)