Repository : ssh://git@open-mesh.org/batman-adv
Branch 'master' now includes:
5276048 batman-adv: Fix regression in bla multiline comment style
cca9d02 batman-adv: Fix build of batman-adv without BLA
762081b Merge branch 'next'
Repository : ssh://git@open-mesh.org/batman-adv
On branch : master
>---------------------------------------------------------------
commit 4e3c233cbdc129e83ece90a16fd338cb4834a53a
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Thu Oct 18 11:43:54 2012 +0200
batman-adv: Recommend not to change Makefile for configuration
The Makefile suggests to change it to enable or disable features. This resulted
in patch submissions with changed Makefile even when this change would not be
necessary.
Instead the configuration should be done using the make parameters explained in
README.external
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
Signed-off-by: Marek Lindner <lindner_marek(a)yahoo.de>
>---------------------------------------------------------------
4e3c233cbdc129e83ece90a16fd338cb4834a53a
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index c6266a2..4d70e40 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@
# 02110-1301, USA
#
-# changing the CONFIG_* line to 'y' enables the related feature
+# read README.external for more information about the configuration
# B.A.T.M.A.N. debugging:
export CONFIG_BATMAN_ADV_DEBUG=n
# B.A.T.M.A.N. bridge loop avoidance:
Repository : ssh://git@open-mesh.org/alfred
On branch : master
>---------------------------------------------------------------
commit fd9df5a63808dbe05a79bed6db493f456279516f
Author: Sven Eckelmann <sven(a)narfation.org>
Date: Wed Oct 17 21:38:23 2012 +0200
alfred: Prepare makefile for distributions
Distributions must be able to easily set CPPFLAGS, CFLAGS and LDFLAGS to have
full control about optimization or security related flags. It is also necessary
to be able to install all files.
Signed-off-by: Sven Eckelmann <sven(a)narfation.org>
>---------------------------------------------------------------
fd9df5a63808dbe05a79bed6db493f456279516f
Makefile | 89 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
1 file changed, 79 insertions(+), 10 deletions(-)
diff --git a/Makefile b/Makefile
index 92299ac..9796528 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,81 @@
-LDFLAGS=-ggdb -static
-CFLAGS=-O2 -Wall -ggdb
-BIN=alfred
-OBJS=main.o server.o client.o netsock.o send.o recv.o hash.o unix_sock.o util.o
-default: all
-all: $(BIN)
-$(BIN): $(OBJS)
- gcc $(LDFLAGS) $(OBJS) -o $(BIN)
+#!/usr/bin/make -f
+# -*- makefile -*-
+#
+# Copyright (C) 2012 B.A.T.M.A.N. contributors
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of version 2 of the GNU General Public
+# License as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA
+#
+
+# alfred build
+BINARY_NAME = alfred
+OBJ = main.o server.o client.o netsock.o send.o recv.o hash.o unix_sock.o util.o
+
+# alfred flags and options
+CFLAGS += -pedantic -Wall -W -std=gnu99 -fno-strict-aliasing -MD
+LDLIBS +=
+
+# disable verbose output
+ifneq ($(findstring $(MAKEFLAGS),s),s)
+ifndef V
+ Q_CC = @echo ' ' CC $@;
+ Q_LD = @echo ' ' LD $@;
+ export Q_CC
+ export Q_LD
+endif
+endif
+
+# standard build tools
+CC ?= gcc
+RM ?= rm -f
+INSTALL ?= install
+MKDIR ?= mkdir -p
+COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
+LINK.o = $(Q_LD)$(CC) $(LDFLAGS) $(TARGET_ARCH)
+
+# standard install paths
+PREFIX = /usr/local
+SBINDIR = $(PREFIX)/sbin
+
+# try to generate revision
+REVISION= $(shell if [ -d .git ]; then \
+ echo $$(git describe --always --dirty --match "v*" |sed 's/^v//' 2> /dev/null || echo "[unknown]"); \
+ fi)
+ifneq ($(REVISION),)
+CPPFLAGS += -DSOURCE_VERSION=\"$(REVISION)\"
+endif
+
+# default target
+all: $(BINARY_NAME)
+
+# standard build rules
+.SUFFIXES: .o .c
.c.o:
- gcc $(CFLAGS) -o $@ -c $<
+ $(COMPILE.c) -o $@ $<
+
+$(BINARY_NAME): $(OBJ)
+ $(LINK.o) $^ $(LDLIBS) -o $@
+
clean:
- rm -f $(BIN) $(OBJS)
+ $(RM) $(BINARY_NAME) $(OBJ) $(DEP)
+
+install: $(BINARY_NAME)
+ $(MKDIR) $(DESTDIR)$(SBINDIR)
+ $(INSTALL) -m 0755 $(BINARY_NAME) $(DESTDIR)$(SBINDIR)
+
+# load dependencies
+DEP = $(OBJ:.o=.d)
+-include $(DEP)
+
+.PHONY: all clean install