[Olsr-dev] [PATCH v1 4/5] PUD: add nmealib to build
Ferry Huberts
(spam-protected)
Thu May 10 16:10:00 CEST 2012
From: Ferry Huberts <(spam-protected)>
Signed-off-by: Ferry Huberts <(spam-protected)>
---
lib/pud/Makefile | 22 +++++++++++++++++-----
lib/pud/nmealib/Makefile | 18 +++++++++---------
lib/pud/nmealib/Makefile.inc | 5 +----
3 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/lib/pud/Makefile b/lib/pud/Makefile
index f45a866..3a92829 100644
--- a/lib/pud/Makefile
+++ b/lib/pud/Makefile
@@ -1,6 +1,8 @@
+NMEALIB_PATH = nmealib
LIBRARY_PATH = wireformat
JAVA_PATH = wireformat-java
include $(LIBRARY_PATH)/Makefile.inc
+NMEALIB_NAME := nmea
LIBRARY_NAME := $(PROJECT)
@@ -14,11 +16,13 @@ CFLAGS += -Werror -D_GNU_SOURCE
RESOURCESDIR = ./resources
+NMEALIB_INC = $(NMEALIB_PATH)/include
+NMEALIB_LIB = $(NMEALIB_PATH)/lib
LIBRARY_INC = $(LIBRARY_PATH)/include
LIBRARY_LIB = $(LIBRARY_PATH)/lib
-CFLAGS += -I $(LIBRARY_INC)
-LIBS += -L $(LIBRARY_LIB) -lnmea -lm -l$(LIBRARY_NAME)
+CFLAGS += -I $(NMEALIB_INC) -I $(LIBRARY_INC)
+LIBS += -L $(NMEALIB_LIB) -L $(LIBRARY_LIB) -l$(NMEALIB_NAME) -lm -l$(LIBRARY_NAME)
ifneq ($(OS),linux)
@@ -34,21 +38,22 @@ else
GIT_SHA = $(shell git describe 2> /dev/null || echo "Unknown")
CFLAGS += -DGIT_SHA=\"$(GIT_SHA)\" -DPLUGIN_VER=\"$(PLUGIN_VER)\"
-.PHONY: all default_target install uninstall clean doc doc-clean library java java-instal java-uninstall
+.PHONY: all default_target install uninstall clean doc doc-clean nmealib library java java-instal java-uninstall
all: default_target
-default_target: library $(PLUGIN_FULLNAME)
+default_target: nmealib library $(PLUGIN_FULLNAME)
# repeat from toplevel Makefile.inc, and adjust: we need the library includes
%.d: %.c
- @$(filter-out $(CCACHE),$(CC)) -M $(strip $(CPPFLAGS)) -I $(LIBRARY_INC) "$<" | sed -e '1s/\($(call quote,$(*F))\.o\)[ :]*/$(call quote,$(*D)/\1 $@: Makefile $(TOPDIR)$(if $(TOPDIR),/)Makefile.inc) /g' >"$@"
+ @$(filter-out $(CCACHE),$(CC)) -M $(strip $(CPPFLAGS)) -I $(NMEALIB_INC) -I $(LIBRARY_INC) "$<" | sed -e '1s/\($(call quote,$(*F))\.o\)[ :]*/$(call quote,$(*D)/\1 $@: Makefile $(TOPDIR)$(if $(TOPDIR),/)Makefile.inc) /g' >"$@"
$(PLUGIN_FULLNAME): $(OBJS) version-script.txt
@echo "[LD] $@"
@$(CC) $(LDFLAGS) -o $(PLUGIN_FULLNAME) $(OBJS) $(LIBS)
install: all
+ @$(MAKE) -C $(NMEALIB_PATH) DESTDIR=$(DESTDIR) install
@$(MAKE) -C $(LIBRARY_PATH) DESTDIR=$(DESTDIR) install
$(INSTALL_LIB)
mkdir -p "$(ETCDIR)"
@@ -56,6 +61,7 @@ install: all
$(STRIP) "$(LIBDIR)/$(PLUGIN_FULLNAME)"
uninstall:
+ @$(MAKE) -C $(NMEALIB_PATH) DESTDIR=$(DESTDIR) uninstall
@$(MAKE) -C $(LIBRARY_PATH) DESTDIR=$(DESTDIR) uninstall
rm -f "$(LIBDIR)/lib$(PLUGIN_NAME).so" "$(LIBDIR)/$(PLUGIN_NAME)" "$(ETCDIR)/olsrd.pud.position.conf"
$(UNINSTALL_LIB)
@@ -65,19 +71,25 @@ clean:
@echo "[$@]"
@rm -f $(OBJS) $(SRCS:%.c=%.d) "$(PLUGIN_FULLNAME)"
@$(MAKE) -C doc clean
+ @$(MAKE) -C $(NMEALIB_PATH) clean
@$(MAKE) -C $(LIBRARY_PATH) clean
@$(MAKE) -C $(JAVA_PATH) clean
doc:
@$(MAKE) -C doc all
+ @$(MAKE) -C $(NMEALIB_PATH) doc
@$(MAKE) -C $(LIBRARY_PATH) doc
@$(MAKE) -C $(JAVA_PATH) doc
doc-clean:
@$(MAKE) -C doc clean
+ @$(MAKE) -C $(NMEALIB_PATH) doc clean
@$(MAKE) -C $(LIBRARY_PATH) doc clean
@$(MAKE) -C $(JAVA_PATH) doc clean
+nmealib:
+ @$(MAKE) -C $(NMEALIB_PATH) all
+
library:
@$(MAKE) -C $(LIBRARY_PATH) all
diff --git a/lib/pud/nmealib/Makefile b/lib/pud/nmealib/Makefile
index 6ba877a..abc3ed9 100644
--- a/lib/pud/nmealib/Makefile
+++ b/lib/pud/nmealib/Makefile
@@ -10,9 +10,9 @@ DESTDIR ?=
MACHINE=$(shell uname -m)
ifeq ($(strip $(MACHINE)),x86_64)
-LIBDIR = usr/lib64
+LIBDIR_INSTALL = usr/lib64
else
-LIBDIR = usr/lib
+LIBDIR_INSTALL = usr/lib
endif
INCLUDEDIR = usr/include
@@ -61,10 +61,10 @@ doc:
$(MAKE) -C doc all
install: all
- @mkdir -v -p "$(DESTDIR)/$(LIBDIR)"
- cp "lib/$(LIBNAME)" "$(DESTDIR)/$(LIBDIR)/$(LIBNAME).$(VERSION)"
- $(STRIP) "$(DESTDIR)/$(LIBDIR)/$(LIBNAME).$(VERSION)"
- ldconfig -n "$(DESTDIR)/$(LIBDIR)"
+ @mkdir -v -p "$(DESTDIR)/$(LIBDIR_INSTALL)"
+ cp "lib/$(LIBNAME)" "$(DESTDIR)/$(LIBDIR_INSTALL)/$(LIBNAME).$(VERSION)"
+ $(STRIP) "$(DESTDIR)/$(LIBDIR_INSTALL)/$(LIBNAME).$(VERSION)"
+ ldconfig -n "$(DESTDIR)/$(LIBDIR_INSTALL)"
install-headers: all
@mkdir -v -p "$(DESTDIR)/$(INCLUDEDIR)"
@@ -72,9 +72,9 @@ install-headers: all
cp -r include/nmea "$(DESTDIR)/$(INCLUDEDIR)"
uninstall:
- rm -f "$(DESTDIR)/$(LIBDIR)/$(LIBNAME)" "$(DESTDIR)/$(LIBDIR)/$(LIBNAME).$(VERSION)"
- ldconfig -n "$(DESTDIR)/$(LIBDIR)"
- @rmdir -v -p --ignore-fail-on-non-empty "$(DESTDIR)/$(LIBDIR)"
+ rm -f "$(DESTDIR)/$(LIBDIR_INSTALL)/$(LIBNAME)" "$(DESTDIR)/$(LIBDIR_INSTALL)/$(LIBNAME).$(VERSION)"
+ ldconfig -n "$(DESTDIR)/$(LIBDIR_INSTALL)"
+ @rmdir -v -p --ignore-fail-on-non-empty "$(DESTDIR)/$(LIBDIR_INSTALL)"
uninstall-headers:
rm -fr "$(DESTDIR)/$(INCLUDEDIR)/nmea"
diff --git a/lib/pud/nmealib/Makefile.inc b/lib/pud/nmealib/Makefile.inc
index 98ee50d..8b286b2 100644
--- a/lib/pud/nmealib/Makefile.inc
+++ b/lib/pud/nmealib/Makefile.inc
@@ -24,10 +24,7 @@ GITVERSION = $(shell git describe --dirty='-dirty')
# we expect the version to be like 'v0.5.3-27-g0c2727a' and then strip the 'v',
# and the '-27-g0c2727a' parts
-VERSION=$(shell git describe | \
- sed -r -e 's/^([^[:digit:]]+)(.*)/\2/' \
- -e 's/^([^-]+)(.*)/\1/' | \
- grep -E '[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+')
+VERSION=0.6.6
# protect against no version number
ifeq ($(strip $(VERSION)),)
--
1.7.7.6
More information about the Olsr-dev
mailing list