# Flags for the C(++) preprocessor:
# Prevent a warning about yyinput being defined but not used
-CPPFLAGS := -DYY_NO_INPUT
+CPPFLAGS += -DYY_NO_INPUT
# Flags shared between C and C++
COMPILERFLAGS := -Wall
# Flags for the C compiler.
# std=gnu9x shuts up warnings about long long and variadic macros
-CCFLAGS = $(COMPILERFLAGS) -std=gnu9x
+CCFLAGS += $(COMPILERFLAGS) -std=gnu9x
# Flags for the C++ compiler:
-CXXFLAGS = $(COMPILERFLAGS) -Wno-long-long
+CXXFLAGS += $(COMPILERFLAGS) -Wno-long-long
# The command for maintaining static libraries:
AR := ar
LD = $(CXX) -shared
# Flags for linking binary executables (e.g. for profiling):
-LDFLAGS = $(MINGW)
+LDFLAGS += $(MINGW)
# The command for removing symbol table from the executables:
STRIP := strip
CXXFLAGS += -Werror
-LDFLAGS += -g -L$(ABS_SRC)/../../core -Wl,-soname,$(SHARED_LIB).$(MAJOR) -o $(SHARED_LIB).$(MAJOR).$(MINOR)
-LDFLAGS_RT2 += -g -L$(ABS_SRC)/../../core2 -Wl,-soname,$(SHARED_LIB_RT2).$(MAJOR) -o $(SHARED_LIB_RT2).$(MAJOR).$(MINOR)
-LDFLAGS_PARALLEL += -g -L$(ABS_SRC)/../../core -Wl,-soname,$(SHARED_LIB_PARALLEL).$(MAJOR) -o $(SHARED_LIB_PARALLEL).$(MAJOR).$(MINOR)
-LDFLAGS_PARALLEL_RT2 += -g -L$(ABS_SRC)/../../core2 -Wl,-soname,$(SHARED_LIB_PARALLEL_RT2).$(MAJOR) -o $(SHARED_LIB_PARALLEL_RT2).$(MAJOR).$(MINOR)
+LDFLAGS_ORIG := $(LDFLAGS)
+LDFLAGS += $(LDFLAGS_ORIG) -g -L$(ABS_SRC)/../../core -Wl,-soname,$(SHARED_LIB).$(MAJOR) -o $(SHARED_LIB).$(MAJOR).$(MINOR)
+LDFLAGS_RT2 += $(LDFLAGS_ORIG) -g -L$(ABS_SRC)/../../core2 -Wl,-soname,$(SHARED_LIB_RT2).$(MAJOR) -o $(SHARED_LIB_RT2).$(MAJOR).$(MINOR)
+LDFLAGS_PARALLEL += $(LDFLAGS_ORIG) -g -L$(ABS_SRC)/../../core -Wl,-soname,$(SHARED_LIB_PARALLEL).$(MAJOR) -o $(SHARED_LIB_PARALLEL).$(MAJOR).$(MINOR)
+LDFLAGS_PARALLEL_RT2 += $(LDFLAGS_ORIG) -g -L$(ABS_SRC)/../../core2 -Wl,-soname,$(SHARED_LIB_PARALLEL_RT2).$(MAJOR) -o $(SHARED_LIB_PARALLEL_RT2).$(MAJOR).$(MINOR)
LIBS := -lttcn3-dynamic
LIBS_RT2 := -lttcn3-rt2-dynamic
CXXFLAGS += -Werror
-LDFLAGS += -g -L$(ABS_SRC)/../../core -Wl,-soname,$(SHARED_LIB).$(MAJOR) -o $(SHARED_LIB).$(MAJOR).$(MINOR)
-LDFLAGS_RT2 += -g -L$(ABS_SRC)/../../core2 -Wl,-soname,$(SHARED_LIB_RT2).$(MAJOR) -o $(SHARED_LIB_RT2).$(MAJOR).$(MINOR)
-LDFLAGS_PARALLEL += -g -L$(ABS_SRC)/../../core -Wl,-soname,$(SHARED_LIB_PARALLEL).$(MAJOR) -o $(SHARED_LIB_PARALLEL).$(MAJOR).$(MINOR)
-LDFLAGS_PARALLEL_RT2 += -g -L$(ABS_SRC)/../../core2 -Wl,-soname,$(SHARED_LIB_PARALLEL_RT2).$(MAJOR) -o $(SHARED_LIB_PARALLEL_RT2).$(MAJOR).$(MINOR)
+LDFLAGS_ORIG := $(LDFLAGS)
+LDFLAGS += $(LDFLAGS_ORIG) -g -L$(ABS_SRC)/../../core -Wl,-soname,$(SHARED_LIB).$(MAJOR) -o $(SHARED_LIB).$(MAJOR).$(MINOR)
+LDFLAGS_RT2 += $(LDFLAGS_ORIG) -g -L$(ABS_SRC)/../../core2 -Wl,-soname,$(SHARED_LIB_RT2).$(MAJOR) -o $(SHARED_LIB_RT2).$(MAJOR).$(MINOR)
+LDFLAGS_PARALLEL += $(LDFLAGS_ORIG) -g -L$(ABS_SRC)/../../core -Wl,-soname,$(SHARED_LIB_PARALLEL).$(MAJOR) -o $(SHARED_LIB_PARALLEL).$(MAJOR).$(MINOR)
+LDFLAGS_PARALLEL_RT2 += $(LDFLAGS_ORIG) -g -L$(ABS_SRC)/../../core2 -Wl,-soname,$(SHARED_LIB_PARALLEL_RT2).$(MAJOR) -o $(SHARED_LIB_PARALLEL_RT2).$(MAJOR).$(MINOR)
LIBS := -lttcn3-dynamic
LIBS_RT2 := -lttcn3-rt2-dynamic
CXXFLAGS += -Werror
-LDFLAGS += -g -L$(ABS_SRC)/../../core -Wl,-soname,$(SHARED_LIB).$(MAJOR) -o $(SHARED_LIB).$(MAJOR).$(MINOR)
-LDFLAGS_RT2 += -g -L$(ABS_SRC)/../../core2 -Wl,-soname,$(SHARED_LIB_RT2).$(MAJOR) -o $(SHARED_LIB_RT2).$(MAJOR).$(MINOR)
-LDFLAGS_PARALLEL += -g -L$(ABS_SRC)/../../core -Wl,-soname,$(SHARED_LIB_PARALLEL).$(MAJOR) -o $(SHARED_LIB_PARALLEL).$(MAJOR).$(MINOR)
-LDFLAGS_PARALLEL_RT2 += -g -L$(ABS_SRC)/../../core2 -Wl,-soname,$(SHARED_LIB_PARALLEL_RT2).$(MAJOR) -o $(SHARED_LIB_PARALLEL_RT2).$(MAJOR).$(MINOR)
+LDFLAGS_ORIG := $(LDFLAGS)
+LDFLAGS += $(LDFLAGS_ORIG) -g -L$(ABS_SRC)/../../core -Wl,-soname,$(SHARED_LIB).$(MAJOR) -o $(SHARED_LIB).$(MAJOR).$(MINOR)
+LDFLAGS_RT2 += $(LDFLAGS_ORIG) -g -L$(ABS_SRC)/../../core2 -Wl,-soname,$(SHARED_LIB_RT2).$(MAJOR) -o $(SHARED_LIB_RT2).$(MAJOR).$(MINOR)
+LDFLAGS_PARALLEL += $(LDFLAGS_ORIG) -g -L$(ABS_SRC)/../../core -Wl,-soname,$(SHARED_LIB_PARALLEL).$(MAJOR) -o $(SHARED_LIB_PARALLEL).$(MAJOR).$(MINOR)
+LDFLAGS_PARALLEL_RT2 += $(LDFLAGS_ORIG) -g -L$(ABS_SRC)/../../core2 -Wl,-soname,$(SHARED_LIB_PARALLEL_RT2).$(MAJOR) -o $(SHARED_LIB_PARALLEL_RT2).$(MAJOR).$(MINOR)
LIBS := -lttcn3-dynamic
LIBS_RT2 := -lttcn3-rt2-dynamic