all: avoid includes with relative paths whenever possible
authorFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 14 Apr 2016 19:15:30 +0000 (21:15 +0200)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Thu, 14 Apr 2016 19:41:17 +0000 (21:41 +0200)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
19 files changed:
Makefile.inc
lib/httpinfo/src/olsrd_plugin.h
lib/jsoninfo/src/olsrd_jsoninfo.c
lib/jsoninfo/src/olsrd_plugin.c
lib/jsoninfo/src/olsrd_plugin.h
lib/pud/Makefile
lib/pud/wireformat-java/Makefile
lib/pud/wireformat/Makefile
lib/txtinfo/src/olsrd_plugin.c
lib/txtinfo/src/olsrd_plugin.h
lib/txtinfo/src/olsrd_txtinfo.c
src/bsd/dummy.c
src/bsd/net.c
src/cfgparser/cfgfile_gen.c
src/cfgparser/oparse.y
src/linux/net.c
src/unix/log.c
src/win32/dummy.c
src/win32/log.c

index d61f049..3a0775f 100644 (file)
@@ -125,10 +125,8 @@ SGW_POLICY_SCRIPT ?= sgw_policy_routing_setup.sh
 DOCDIR_OLSRD ?= $(DOCDIR)/$(EXENAME)
 
 
-CPPFLAGS =     -Isrc
-ifneq ($(TOPDIR),.)
-CPPFLAGS +=    -I$(TOPDIR)/src
-endif
+CPPFLAGS  = -Isrc -I$(TOPDIR)/src -I$(TOPDIR)/lib -I$(TOPDIR)/lib/pud/nmealib/include -I$(TOPDIR)/lib/pud/wireformat/include
+CPPFLAGS += -DHTTPINFO_PUD
 
 # include OS specific compiler settings
 -include $(TOPDIR)/make/Makefile.$(OS).compiler
@@ -331,10 +329,6 @@ ifneq ($(NOSTRIP),0)
 CFLAGS +=      -ggdb
 endif
 
-ifeq ($(OS),linux)
-CPPFLAGS+=-DHTTPINFO_PUD -I$(TOPDIR)/lib -I$(TOPDIR)/lib/pud/nmealib/include -I$(TOPDIR)/lib/pud/wireformat/include
-endif
-
 # a make function to quote "/" and "."
 quote = $(subst .,\.,$(subst /,\/,$1))
 
index 8a72f41..eb7aae4 100644 (file)
@@ -61,7 +61,7 @@
 #include <stdbool.h>
 
 #include "olsr_types.h"
-#include "../../../src/olsrd_plugin.h"
+#include "../../../src/olsrd_plugin.h" /* really needed with the ../../../ */
 #include "neighbor_table.h"
 #include "two_hop_neighbor_table.h"
 #include "tc_set.h"
index 262b420..efa2784 100644 (file)
@@ -59,9 +59,9 @@
 #include "gateway.h"
 #include "gateway_costs.h"
 #include "olsrd_plugin.h"
-#include "../../info/info_types.h"
-#include "../../info/http_headers.h"
-#include "../../info/json_helpers.h"
+#include "info/info_types.h"
+#include "info/http_headers.h"
+#include "info/json_helpers.h"
 #include "gateway_default_handler.h"
 #include "egressTypes.h"
 
index dc2a1d3..adea8e3 100644 (file)
@@ -48,7 +48,7 @@
  */
 
 #include "olsrd_plugin.h"
-#include "../../info/olsrd_info.h"
+#include "info/olsrd_info.h"
 #include "olsrd_jsoninfo.h"
 #include "olsr.h"
 #include "builddata.h"
index 8d84822..f3b9b1f 100644 (file)
@@ -51,7 +51,7 @@
 #define LIB_JSONINFO_SRC_OLSRD_PLUGIN_H_
 
 #include "plugin_util.h"
-#include "../../info/info_types.h"
+#include "info/info_types.h"
 
 extern info_plugin_config_t config;
 extern char uuidfile[FILENAME_MAX];
index 9ec834c..3fe9ac4 100644 (file)
@@ -60,13 +60,10 @@ CFLAGS += -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
 NMEALIB_LIB_STATIC = $(NMEALIB_LIB)/lib$(NMEALIB_NAME).a
 
-CFLAGS += -I $(NMEALIB_INC) -I $(LIBRARY_INC)
 ifeq ($(PUD_NMEALIB_STATICALLY_LINKED),)
 LIBS += -L $(NMEALIB_LIB) -L $(LIBRARY_LIB) -l$(NMEALIB_NAME) -lm -l$(LIBRARY_NAME)
 else
@@ -111,10 +108,6 @@ endif
 
 default_target: nmealib library $(PLUGIN_FULLNAME)
 
-# repeat from toplevel Makefile.inc, and adjust: we need the library includes
-%.d: %.c
-       $(MAKECMDPREFIX)$(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
 ifeq ($(PUD_NMEALIB_STATICALLY_LINKED),)
 ifeq ($(VERBOSE),0)
index 78ae483..eff67a3 100644 (file)
@@ -127,7 +127,7 @@ endif
 
 SRC_DIR_C = src/main/c
 
-INCLUDES = -I "$(INC_DIR_WIREFORMAT)" -I "$(INC_DIR_JVM)" -I "$(INC_DIR_JVM_OS)"
+INCLUDES = -I "$(INC_DIR_JVM)" -I "$(INC_DIR_JVM_OS)"
 LIBRARIES = -L ../wireformat/lib -l$(WIREFORMAT_PROJECT)
 
 
index 63d0573..d82184d 100644 (file)
@@ -78,14 +78,12 @@ LIBDIR_BUILD = lib
 
 INC_DIR_BASE_C = ./include
 INC_DIR_C = $(INC_DIR_BASE_C)/$(PROJECT)
-INC_DIR_OLSRD = ../../../src
 
 MODULES = nodeIdConversion wireFormat
 
 SRC_DIR_C = src
 OBJECTS_C = $(MODULES:%=$(BUILD_DIR)/%.o)
 
-INCLUDES = -I "$(INC_DIR_BASE_C)" -I "$(INC_DIR_OLSRD)"
 LIBRARIES = -lm
 
 
@@ -109,7 +107,7 @@ $(BUILD_DIR)/%.o: $(SRC_DIR_C)/%.c $(INC_DIR_C)/compiler.h
 ifeq ($(VERBOSE),0)
        @echo "[CC] $<"
 endif
-       $(MAKECMDPREFIX)$(CC) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) -c -o "$@" "$<"
+       $(MAKECMDPREFIX)$(CC) $(CFLAGS) $(CPPFLAGS) -c -o "$@" "$<"
 
 .gitignore:
 ifeq ($(VERBOSE),0)
index 76ce97e..96af55e 100644 (file)
@@ -49,7 +49,7 @@
 
 #include "olsrd_txtinfo.h"
 #include "olsrd_plugin.h"
-#include "../../info/olsrd_info.h"
+#include "info/olsrd_info.h"
 #include "olsr.h"
 #include "builddata.h"
 
index 57fbe64..f2e8693 100644 (file)
@@ -51,7 +51,7 @@
 #define LIB_TXTINFO_SRC_OLSRD_PLUGIN_H_
 
 #include "plugin_util.h"
-#include "../../info/info_types.h"
+#include "info/info_types.h"
 
 extern info_plugin_config_t config;
 extern bool vtime;
index 75be122..4cc10db 100644 (file)
@@ -57,8 +57,8 @@
 #include "gateway.h"
 #include "gateway_costs.h"
 #include "olsrd_plugin.h"
-#include "../../info/info_types.h"
-#include "../../info/http_headers.h"
+#include "info/info_types.h"
+#include "info/http_headers.h"
 #include "gateway_default_handler.h"
 
 unsigned long long get_supported_commands_mask(void) {
index 5789d6f..d12009c 100644 (file)
  *
  */
 
-#include "../defs.h"
-#include "../kernel_routes.h"
-#include "../kernel_tunnel.h"
-#include "../net_os.h"
+#include "defs.h"
+#include "kernel_routes.h"
+#include "kernel_tunnel.h"
+#include "net_os.h"
 
 /* prototypes: have them here or disable the warnings about missing prototypes! */
 int olsr_if_setip(const char *dev __attribute__ ((unused)), union olsr_ip_addr *ip __attribute__ ((unused)), int ipversion __attribute__ ((unused))); 
index b8b7562..1c6b31e 100644 (file)
 /* comment: we need this otherwise it does not include the proper files to find IPv6_PKTINFO */
 #define __APPLE_USE_RFC_2292
 
-#include "../defs.h"
-#include "../net_os.h"
-#include "../ipcalc.h"
-#include "../parser.h"          /* dnc: needed for call to packet_parser() */
-#include "../olsr_protocol.h"
-#include "../olsr_cfg.h"
-#include "../olsr.h"
+#include "defs.h"
+#include "net_os.h"
+#include "ipcalc.h"
+#include "parser.h"          /* dnc: needed for call to packet_parser() */
+#include "olsr_protocol.h"
+#include "olsr_cfg.h"
+#include "olsr.h"
 
 #include <sys/types.h>
 #include <sys/socket.h>
index 5590700..410cb20 100644 (file)
 
 #include "olsrd_conf.h"
 #include "builddata.h"
-#include "../ipcalc.h"
-#include "../net_olsr.h"
-#include "../common/autobuf.h"
-#include "../egressTypes.h"
-#include "../lock_file.h"
+#include "ipcalc.h"
+#include "net_olsr.h"
+#include "common/autobuf.h"
+#include "egressTypes.h"
+#include "lock_file.h"
 
 #include <stdarg.h>
 #include <stdio.h>
index 1843897..7072c52 100644 (file)
  */
 
 #include "olsrd_conf.h"
-#include "../defs.h"
-#include "../ipcalc.h"
-#include "../net_olsr.h"
-#include "../link_set.h"
-#include "../olsr.h"
-#include "../egressTypes.h"
-#include "../gateway.h"
+#include "defs.h"
+#include "ipcalc.h"
+#include "net_olsr.h"
+#include "link_set.h"
+#include "olsr.h"
+#include "egressTypes.h"
+#include "gateway.h"
 
 #include <stddef.h>
 #include <stdio.h>
index 62ac904..75300af 100644 (file)
 #ifdef __linux__
 #define __BSD_SOURCE 1
 
-#include "../net_os.h"
-#include "../ipcalc.h"
-#include "../olsr.h"
-#include "../log.h"
+#include "net_os.h"
+#include "ipcalc.h"
+#include "olsr.h"
+#include "log.h"
 #include "kernel_tunnel.h"
 #include "ifnet.h"
 
index c497e65..73aefef 100644 (file)
@@ -47,8 +47,8 @@
  * System logging interface for GNU/Linux systems
  */
 
-#include "../olsr_cfg.h"
-#include "../log.h"
+#include "olsr_cfg.h"
+#include "log.h"
 #include <syslog.h>
 #include <stdarg.h>
 
index 3f335a4..75d524f 100644 (file)
 
 #ifdef _WIN32
 
-#include "../defs.h"
-#include "../kernel_routes.h"
-#include "../kernel_tunnel.h"
-#include "../net_os.h"
+#include "defs.h"
+#include "kernel_routes.h"
+#include "kernel_tunnel.h"
+#include "net_os.h"
 
 int olsr_os_init_iptunnel(const char * name __attribute__((unused))) {
   return -1;
index 4a812e1..bbaabd7 100644 (file)
@@ -45,7 +45,7 @@
 
 #ifdef _WIN32
 
-#include "../log.h"
+#include "log.h"
 
 void
 olsr_openlog(const char *Id __attribute__ ((unused)))