uname_rs := $(shell uname -rs)
cc_version := $(shell $(CC) --version | head -n 1)
GIT_VERSION := $(shell ./GIT-VERSION-GEN git-version.h)
-COPYRIGHT_YEAR := 2017
+COPYRIGHT_YEAR := 2018
ifeq ("$(origin O)", "command line")
build_dir := $(O)
lls_suite_dir := $(build_dir)/lls
lls_m4_dir := m4/lls
test_dir := t
+yy_src_dir = yy
+yy_build_dir = $(build_dir)/yy
# sort removes duplicate words, which is all we need here
all_objs := $(sort $(recv_objs) $(filter_objs) $(client_objs) $(gui_objs) \
$(audiod_objs) $(audioc_objs) $(mixer_objs) $(server_objs) \
$(write_objs) $(afh_objs) $(play_objs))
deps := $(addprefix $(dep_dir)/, $(all_objs:.o=.d))
+deps += $(addprefix $(dep_dir)/, mp.bison.d mp.flex.d)
afh_objs += afh.lsg.o
audioc_objs += audioc.lsg.o
m4_lls_deps := $(addsuffix .m4d, $(suites))
lsg_h := $(addsuffix .lsg.h, $(suites))
+# flex/bison objects and headers are only needed if para_server is built
+ifeq ("$(findstring server, $(executables))", "server")
+ server_objs += mp.flex.o mp.bison.o
+ yy_h := $(yy_build_dir)/mp.bison.h
+endif
+
# now prefix all objects with object dir
recv_objs := $(addprefix $(object_dir)/, $(recv_objs))
filter_objs := $(addprefix $(object_dir)/, $(filter_objs))
include $(lls_m4_dir)/makefile
include $(test_dir)/makefile.test
+include $(yy_src_dir)/makefile
ifeq ($(findstring clean, $(MAKECMDGOALS)),)
-include $(deps)
-include $(m4_lls_deps)
endif
-$(object_dir) $(man_dir) $(dep_dir) $(m4depdir) $(lls_suite_dir):
+$(object_dir) $(man_dir) $(dep_dir) $(m4depdir) $(lls_suite_dir) \
+ $(yy_build_dir):
$(Q) $(MKDIR_P) $@
CPPFLAGS += -DBINDIR='"$(bindir)"'
CPPFLAGS += -DCC_VERSION='"$(cc_version)"'
CPPFLAGS += -I/usr/local/include
CPPFLAGS += -I$(lls_suite_dir)
+CPPFLAGS += -I$(yy_build_dir)
CPPFLAGS += $(lopsub_cppflags)
STRICT_CFLAGS += -fno-strict-aliasing
)
STRICT_CFLAGS += $(call cc-option, -Wformat-signedness)
+STRICT_CFLAGS += $(call cc-option, -Wdiscarded-qualifiers)
# To put more focus on warnings, be less verbose as default
# Use 'make V=1' to see the full commands
$(object_dir)/compress_filter.o: CFLAGS += -O3
-$(object_dir)/%.o: %.c | $(object_dir) $(dep_dir) $(lsg_h)
+$(object_dir)/%.o: %.c | $(object_dir) $(dep_dir) $(lsg_h) $(yy_h)
@[ -z "$(Q)" ] || echo 'CC $<'
$(Q) $(CC) -c -o $@ -MMD -MF $(dep_dir)/$(*F).d -MT $@ $(CPPFLAGS) \
$(STRICT_CFLAGS) $(CFLAGS) $<