install: trim the set of installed headers (and libm.a)

This is because all of these headers are included in direct style with
no subfolder so we need them to be in a quite public `include/` folder.
The Makefile installs in `include/openlibm/` but this only works with
extra `-I` flags that are quite annoying to enforce.

With this change, the only OpenLibm headers that are installed are named
`openlibm_*.h`, which is sufficient in terms of namespacing.

Also add a symlink libm.a -> libopenlibm.a.
This commit is contained in:
Lephenixnoir 2022-08-12 22:04:18 +02:00
parent feba6242e4
commit 65aaba96e1
No known key found for this signature in database
GPG key ID: 1BBA026E13FC0495
2 changed files with 24 additions and 5 deletions

View file

@ -93,6 +93,9 @@ install-static: libopenlibm.a
mkdir -p $(DESTDIR)$(libdir)
cp -RpP -f libopenlibm.a $(DESTDIR)$(libdir)/
install-static-superh: install-static
ln -sf libopenlibm.a $(DESTDIR)$(libdir)/libm.a
install-shared: libopenlibm.$(OLM_MAJOR_MINOR_SHLIB_EXT)
mkdir -p $(DESTDIR)$(shlibdir)
cp -RpP -f libopenlibm.*$(SHLIB_EXT)* $(DESTDIR)$(shlibdir)/
@ -106,4 +109,15 @@ install-headers:
cp -RpP -f include/*.h $(DESTDIR)$(includedir)/openlibm
cp -RpP -f src/*.h $(DESTDIR)$(includedir)/openlibm
install: install-static install-shared install-pkgconfig install-headers
install-headers-superh:
mkdir -p $(DESTDIR)$(includedir)
cp -RpP -f \
include/openlibm.h \
include/openlibm_complex.h \
include/openlibm_defs.h \
include/openlibm_fenv.h \
include/openlibm_fenv_sh3eb.h \
include/openlibm_math.h \
$(DESTDIR)$(includedir)
install: install-static install-shared install-pkgconfig

View file

@ -1,17 +1,22 @@
# giteapc: version=1 depends=Lephenixnoir/sh-elf-gcc
# giteapc: version=1 depends=Lephenixnoir/fxsdk,Lephenixnoir/sh-elf-gcc
-include giteapc-config.make
PREFIX ?= $(shell sh-elf-gcc --print-search-dirs | grep install | sed 's/install: //')
# Use the fxSDK's default paths unless specified otherwise on the command line
LIBDIR ?= $(shell fxsdk path lib)
INCDIR ?= $(shell fxsdk path include)
FLAGS := USEGCC=1 TOOLPREFIX=sh-elf- CC=sh-elf-gcc AR=sh-elf-ar \
libdir="$(LIBDIR)" includedir="$(INCDIR)"
configure:
@ true
build:
@ make USEGCC=1 TOOLPREFIX=sh-elf- CC=sh-elf-gcc AR=sh-elf-ar libdir="$(PREFIX)" includedir="$(PREFIX)/include"
@ make $(FLAGS)
install:
@ make USEGCC=1 TOOLPREFIX=sh-elf- CC=sh-elf-gcc AR=sh-elf-ar libdir="$(PREFIX)" includedir="$(PREFIX)/include" install-static install-headers
@ make $(FLAGS) install-static-superh install-headers-superh
uninstall:
@ echo "uninstall not supported for OpenLibm, skipping"