From e158ebe08a0c40b28563378b3cde671cb00aa1c0 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Tue, 13 Nov 2018 16:16:47 +0100 Subject: Add install-dev make target for installing headers/pkgconfig/library --- build/linux/Makefile.in | 43 +++++++++++++++++++++++++++++++++++++------ build/linux/configure.ac | 9 ++++++++- build/linux/libastra.pc.in | 10 ++++++++++ 3 files changed, 55 insertions(+), 7 deletions(-) create mode 100644 build/linux/libastra.pc.in diff --git a/build/linux/Makefile.in b/build/linux/Makefile.in index 13e1344..2129519 100644 --- a/build/linux/Makefile.in +++ b/build/linux/Makefile.in @@ -34,6 +34,8 @@ all: $(TARGETS) prefix=@prefix@ exec_prefix=@exec_prefix@ datarootdir=@datarootdir@ +includedir=@includedir@ +libdir=@libdir@ srcdir=@srcdir@ abs_top_builddir=@abs_top_builddir@ @@ -354,7 +356,7 @@ endif endif libastra.la: $(ALL_OBJECTS) - ./libtool --mode=link --tag=CXX $(LD) -rpath @libdir@ -o $@ $(LDFLAGS) $(LIBS) $+ + ./libtool --mode=link --tag=CXX $(LD) -rpath $(libdir) -o $@ $(LDFLAGS) $(LIBS) $+ %.o: %.cpp $(MKDIR) $(*D)/$(DEPDIR) @@ -435,9 +437,9 @@ distclean: clean rm -f $(srcdir)/configure Makefile install-libraries: libastra.la - $(INSTALL_SH) -m 755 -d @libdir@ - ./libtool --mode=install $(INSTALL_SH) -m 644 libastra.la @libdir@ - ./libtool --mode=finish @libdir@ + $(INSTALL_SH) -m 755 -d $(libdir) + ./libtool --mode=install $(INSTALL_SH) -m 644 libastra.la $(libdir) + ./libtool --mode=finish $(libdir) # ------------------------ @@ -535,8 +537,37 @@ else install-octave: endif +ifeq ($(install_type),module) + +install-dev: + @echo "install-dev is not compatible with the 'module' install type." + @echo "Please use 'prefix' or 'dir' instead." + +install-headers: + @echo "install-headers is not compatible with the 'module' install type." + @echo "Please use 'prefix' or 'dir' instead." + +else + +install-headers: + $(INSTALL_SH) -m 755 -d $(includedir) + $(INSTALL_SH) -m 755 -d $(includedir)/astra + $(INSTALL_SH) -m 755 -d $(includedir)/astra/cuda + $(INSTALL_SH) -m 755 -d $(includedir)/astra/cuda/2d + $(INSTALL_SH) -m 755 -d $(includedir)/astra/cuda/3d + $(INSTALL_SH) -m 644 $(srcdir)/../../include/astra/*.h $(includedir)/astra + $(INSTALL_SH) -m 644 $(srcdir)/../../include/astra/*.inl $(includedir)/astra + $(INSTALL_SH) -m 644 $(srcdir)/../../include/astra/cuda/2d/*.h $(includedir)/astra/cuda/2d + $(INSTALL_SH) -m 644 $(srcdir)/../../include/astra/cuda/3d/*.h $(includedir)/astra/cuda/3d + +install-dev: install-libraries install-headers libastra.pc + $(INSTALL_SH) -m 755 -d $(libdir) + $(INSTALL_SH) -m 755 -d $(libdir)/pkgconfig/ + $(INSTALL_SH) -m 644 libastra.pc $(libdir)/pkgconfig/ +endif + -Makefile: $(srcdir)/Makefile.in config.status +Makefile libastra.pc: %: $(srcdir)/%.in config.status CONFIG_HEADERS= CONFIG_LINKS= CONFIG_FILES=$@ $(SHELL) ./config.status config.status: $(srcdir)/configure @@ -547,7 +578,7 @@ $(srcdir)/configure: $(srcdir)/configure.ac @echo "configure.ac has been changed. Regenerating configure script" cd $(srcdir) && $(SHELL) ./autogen.sh -.PHONY: all mex test clean distclean install install-libraries py install-python-site-packages install-python install-octave install-matlab-so install-octave-so +.PHONY: all mex test clean distclean install install-libraries py install-python-site-packages install-python install-octave install-matlab-so install-octave-so install-headers install-dev # don't remove intermediate files: .SECONDARY: diff --git a/build/linux/configure.ac b/build/linux/configure.ac index ac0d82f..cb478f7 100644 --- a/build/linux/configure.ac +++ b/build/linux/configure.ac @@ -135,6 +135,13 @@ fi AC_ARG_VAR(NVCCFLAGS, [CUDA nvcc flags]) +PKGCONFIG_CFLAGS_EXTRA= +if test x"$HAVECUDA" = xyes; then + PKGCONFIG_CFLAGS_EXTRA="-DASTRA_CUDA" +fi +AC_SUBST(PKGCONFIG_CFLAGS_EXTRA) + + AC_SUBST(HAVECUDA) AC_SUBST(LDFLAGS_CUDA) @@ -295,7 +302,7 @@ AC_SUBST(SAVED_CXXFLAGS) AC_SUBST(SAVED_NVCCFLAGS) AC_SUBST(SAVED_LDFLAGS) AC_SUBST(SAVED_LIBS) -AC_CONFIG_FILES([Makefile]) +AC_CONFIG_FILES([Makefile libastra.pc]) AC_OUTPUT echo diff --git a/build/linux/libastra.pc.in b/build/linux/libastra.pc.in new file mode 100644 index 0000000..d2bf554 --- /dev/null +++ b/build/linux/libastra.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: libastra +Description: ASTRA Toolbox +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lastra +Cflags: -I${includedir} @PKGCONFIG_CFLAGS_EXTRA@ -- cgit v1.2.3