# you need a recent enough gcc and the libmudflap installed
MUDFLAP ?= 0
+# shows full compiler/linker calls if activated
+VERBOSE ?= 0
+
+ifeq ($(VERBOSE),0)
+MAKECMDPREFIX = @
+else
+MAKECMDPREFIX =
+endif
+
# OS detection
ifeq ($(OS),Windows_NT)
OS := win32
EXENAME ?= olsrd
CFGNAME ?= $(EXENAME).conf
CFGFILE ?= $(ETCDIR)/$(CFGNAME)
+SGW_POLICY_SCRIPT ?= sgw_policy_routing_setup.sh
DOCDIR_OLSRD ?= $(DOCDIR)/$(EXENAME)
CFLAGS += $(OPTIMIZE)
CFLAGS += $(EXTRA_CFLAGS)
-# Must be specified along with -lpthread on linux
-CPPFLAGS += $(OS_CFLAG_PTHREAD)
endif
ifneq ($(MUDFLAP),0)
CFLAGS += -fmudflapth
ifneq ($(MUDFLAP),0)
LIBS += -lmudflapth
endif
-LIBS += $(OS_LIB_PTHREAD)
# extra options from the outside
CPPFLAGS += $(EXTRA_CPPFLAGS)
+
+# 32/64 cross compilation
+ifdef M32
+CFLAGS += -m32
+LDFLAGS += -m32
+endif
+ifdef M64
+CFLAGS += -m64
+LDFLAGS += -m64
+endif
+
+
###################################
#
# options to save space on small systems
# fully automatic and working dependency generation
%.d: %.c
- @$(filter-out $(CCACHE),$(CC)) -M $(strip $(CPPFLAGS)) "$<" | sed -e '1s/\($(call quote,$(*F))\.o\)[ :]*/$(call quote,$(*D)/\1 $@: Makefile $(TOPDIR)$(if $(TOPDIR),/)Makefile.inc) /g' >"$@"
+ $(MAKECMDPREFIX)$(filter-out $(CCACHE),$(CC)) -M $(strip $(CPPFLAGS)) "$<" | sed -e '1s/\($(call quote,$(*F))\.o\)[ :]*/$(call quote,$(*D)/\1 $@: Makefile $(TOPDIR)$(if $(TOPDIR),/)Makefile.inc) /g' >"$@"
%.o: %.c
+ifeq ($(VERBOSE),0)
@echo "[CC] $<"
- @$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+endif
+ $(MAKECMDPREFIX)$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
# we always need the includes and defines
# for legacy since now