From 48e9072a7e7d6c8c17718eefcc8f6bb51d1e515e Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Tue, 29 Oct 2013 16:37:07 +0100 Subject: [PATCH] [math] minor update for math lib building use PAPARAZZI_HOME and install to /usr/local by default --- sw/airborne/math/Makefile | 14 ++++++++------ sw/airborne/math/README | 8 ++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/sw/airborne/math/Makefile b/sw/airborne/math/Makefile index f9caa61f30..a1e1ce2809 100644 --- a/sw/airborne/math/Makefile +++ b/sw/airborne/math/Makefile @@ -8,14 +8,15 @@ CC= gcc CFLAGS= -fpic INCLUDES= -I$(PAPARAZZI_SRC)/sw/include -I$(PAPARAZZI_SRC)/sw/airborne -# build in ../../../var/build/math -ifndef BUILDDIR -BUILDDIR=../../../var/build/math +ifeq ($(PAPARAZZI_HOME),) +PAPARAZZI_HOME=$(PAPARAZZI_SRC) endif -ifndef PREFIX -PREFIX=/usr -endif +# build in $(PAPARAZZI_HOME)/var/build/math +BUILDDIR ?= $(PAPARAZZI_HOME)/var/build/math + +PREFIX ?= /usr/local + LIB_INSTALLDIR=${PREFIX}/lib INCLUDE_INSTALLDIR=${PREFIX}/include/pprz PKGCONFIG_INSTALLDIR=${PREFIX}/lib/pkgconfig @@ -48,3 +49,4 @@ $(BUILDDIR)/%.o: %.c clean: $(Q)rm -f $(BUILDDIR)/*.o $(BUILDDIR)/$(LIBNAME).so +.PHONY: all clean shared_lib install_shared_lib diff --git a/sw/airborne/math/README b/sw/airborne/math/README index 9c68398093..3ef7d02785 100644 --- a/sw/airborne/math/README +++ b/sw/airborne/math/README @@ -11,11 +11,11 @@ HOWTO install a shared library to use in other projects 2. Install library: in this folder, type make install_shared_lib - the default install dir is /usr + the default install dir is /usr/local and will install files in - /usr/lib - /usr/lib/pkgconfig - /usr/include/pprz + /usr/local/lib + /usr/local/lib/pkgconfig + /usr/local/include/pprz to change the install dir: PREFIX= make install_shared_lib