Skip to content
Snippets Groups Projects
Commit adaa100e authored by Nicolas "Pixel" Noble's avatar Nicolas "Pixel" Noble
Browse files

Trimming down useless variables in the Makefile.

A bunch of autogenerated variables are currently useless, because of tests actually having no source code attached to them. Let's avoid emitting useless code in that case.
parent 5b8c2558
No related branches found
No related tags found
No related merge requests found
This diff is collapsed.
......@@ -1215,7 +1215,8 @@ $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: ${' '.join(proto_to_cc(src2)
% endfor
</%def>
<%def name="maketarget(tgt)">
<%def name="maketarget(tgt)"><% has_no_sources = not tgt.src %>
% if not has_no_sources:
${tgt.name.upper()}_SRC = \\
% for src in tgt.src:
......@@ -1224,7 +1225,7 @@ ${tgt.name.upper()}_SRC = \\
% endfor
${tgt.name.upper()}_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(${tgt.name.upper()}_SRC))))
% endif
% if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
ifeq ($(NO_SECURE),true)
......@@ -1254,9 +1255,15 @@ $(BINDIR)/$(CONFIG)/${tgt.name}: protobuf_dep_error
else
$(BINDIR)/$(CONFIG)/${tgt.name}: $(PROTOBUF_DEP) $(${tgt.name.upper()}_OBJS)\
$(BINDIR)/$(CONFIG)/${tgt.name}: \
% if not has_no_sources:
$(PROTOBUF_DEP) $(${tgt.name.upper()}_OBJS)\
% endif
% else:
$(BINDIR)/$(CONFIG)/${tgt.name}: $(${tgt.name.upper()}_OBJS)\
$(BINDIR)/$(CONFIG)/${tgt.name}: \
% if not has_no_sources:
$(${tgt.name.upper()}_OBJS)\
% endif
% endif
% for dep in tgt.deps:
$(LIBDIR)/$(CONFIG)/lib${dep}.a\
......@@ -1267,17 +1274,26 @@ $(BINDIR)/$(CONFIG)/${tgt.name}: $(${tgt.name.upper()}_OBJS)\
% if tgt.build == 'protoc':
$(E) "[HOSTLD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(HOST_LDXX) $(HOST_LDFLAGS) $(${tgt.name.upper()}_OBJS)\
$(Q) $(HOST_LDXX) $(HOST_LDFLAGS) \
% if not has_no_sources:
$(${tgt.name.upper()}_OBJS)\
% endif
% else:
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LDXX) $(LDFLAGS) $(${tgt.name.upper()}_OBJS)\
$(Q) $(LDXX) $(LDFLAGS) \
% if not has_no_sources:
$(${tgt.name.upper()}_OBJS)\
% endif
% endif
% else:
## C-only targets specificities.
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
$(Q) $(LD) $(LDFLAGS) $(${tgt.name.upper()}_OBJS)\
$(Q) $(LD) $(LDFLAGS) \
% if not has_no_sources:
$(${tgt.name.upper()}_OBJS)\
% endif
% endif
% for dep in tgt.deps:
$(LIBDIR)/$(CONFIG)/lib${dep}.a\
......@@ -1319,9 +1335,11 @@ $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: \
% endfor
% endfor
% if not has_no_sources:
deps_${tgt.name}: $(${tgt.name.upper()}_OBJS:.o=.dep)
% endif
% if not has_no_sources:
% if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
ifneq ($(NO_SECURE),true)
% endif
......@@ -1331,6 +1349,7 @@ endif
% if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
endif
% endif
% endif
</%def>
ifneq ($(OPENSSL_DEP),)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment