From 65aaba96e1adbc21253fa891788cb4774c78fc53 Mon Sep 17 00:00:00 2001 From: Lephenixnoir Date: Fri, 12 Aug 2022 22:04:18 +0200 Subject: [PATCH] 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. --- Makefile | 16 +++++++++++++++- giteapc.make | 13 +++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 1f4f248..ad47211 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/giteapc.make b/giteapc.make index 7340e5e..de6afee 100644 --- a/giteapc.make +++ b/giteapc.make @@ -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"