CC = gcc
CXX = g++
LD = gcc
OBJCOPY = objcopy
SIZE = size
NM = nm

topdir := $(shell pwd)/

src-to-obj = $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(1)))

LIB_OBJS = $(call src-to-obj,$(LIB_SRCS))
S7GET_OBJS = $(call src-to-obj,$(S7GET_SRCS))
TEST_OBJS = $(call src-to-obj,$(TEST_SRCS))
ANALYSIS_OBJS = $(call src-to-obj,$(ANALYSIS_SRCS))

module = $(<D)
module_includes = $(addprefix -I, $($(_module)_includes))
module_cflags = $($(module)_cflags)
module_ldflags = $($(module)_ldflags)

COMMON_FLAGS = -g -Wall -Werror $(module_includes)

CFLAGS = $(COMMON_FLAGS) -std=gnu99 $(module_cflags)
CPPFLAGS = $(COMMON_FLAGS)
LDFLAGS = $(module_ldflags)

CC = gcc
CXX = g++
LD = gcc
OBJCOPY = objcopy
SIZE = size
NM = nm

topdir := $(shell pwd)/

src-to-obj = $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(1)))

LIB_OBJS = $(call src-to-obj,$(LIB_SRCS))
S7GET_OBJS = $(call src-to-obj,$(S7GET_SRCS))
TEST_OBJS = $(call src-to-obj,$(TEST_SRCS))
ANALYSIS_OBJS = $(call src-to-obj,$(ANALYSIS_SRCS))
OBJS = $(LIB_OBJS) $(S7GET_OBJS) $(TEST_OBJS) $(ANALYSIS_OBJS)

module = $(<D)
module_includes = $(addprefix -I, $($(_module)_includes))
module_cflags = $($(module)_cflags)
module_ldflags = $($(module)_ldflags)

COMMON_FLAGS = -g -Wall -Werror $(module_includes)

CFLAGS = $(COMMON_FLAGS) -std=gnu99 $(module_cflags)
CPPFLAGS = $(COMMON_FLAGS)
LDFLAGS = $(module_ldflags)

Build system: Actually include the generated dependency files
Build system: Actually include the generated dependency files

The generated dependency files were not included because the OBJS
variable was empty. List all object files there so we include the
dependency files.

As a result we will now rebuild object files if a prerequisite header
changes.
