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) ...@@ -1215,7 +1215,8 @@ $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: ${' '.join(proto_to_cc(src2)
% endfor % endfor
</%def> </%def>
<%def name="maketarget(tgt)"> <%def name="maketarget(tgt)"><% has_no_sources = not tgt.src %>
% if not has_no_sources:
${tgt.name.upper()}_SRC = \\ ${tgt.name.upper()}_SRC = \\
% for src in tgt.src: % for src in tgt.src:
...@@ -1224,7 +1225,7 @@ ${tgt.name.upper()}_SRC = \\ ...@@ -1224,7 +1225,7 @@ ${tgt.name.upper()}_SRC = \\
% endfor % endfor
${tgt.name.upper()}_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(${tgt.name.upper()}_SRC)))) ${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': % if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
ifeq ($(NO_SECURE),true) ifeq ($(NO_SECURE),true)
...@@ -1254,9 +1255,15 @@ $(BINDIR)/$(CONFIG)/${tgt.name}: protobuf_dep_error ...@@ -1254,9 +1255,15 @@ $(BINDIR)/$(CONFIG)/${tgt.name}: protobuf_dep_error
else 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: % else:
$(BINDIR)/$(CONFIG)/${tgt.name}: $(${tgt.name.upper()}_OBJS)\ $(BINDIR)/$(CONFIG)/${tgt.name}: \
% if not has_no_sources:
$(${tgt.name.upper()}_OBJS)\
% endif
% endif % endif
% for dep in tgt.deps: % for dep in tgt.deps:
$(LIBDIR)/$(CONFIG)/lib${dep}.a\ $(LIBDIR)/$(CONFIG)/lib${dep}.a\
...@@ -1267,17 +1274,26 @@ $(BINDIR)/$(CONFIG)/${tgt.name}: $(${tgt.name.upper()}_OBJS)\ ...@@ -1267,17 +1274,26 @@ $(BINDIR)/$(CONFIG)/${tgt.name}: $(${tgt.name.upper()}_OBJS)\
% if tgt.build == 'protoc': % if tgt.build == 'protoc':
$(E) "[HOSTLD] Linking $@" $(E) "[HOSTLD] Linking $@"
$(Q) mkdir -p `dirname $@` $(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: % else:
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(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 % endif
% else: % else:
## C-only targets specificities. ## C-only targets specificities.
$(E) "[LD] Linking $@" $(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@` $(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 % endif
% for dep in tgt.deps: % for dep in tgt.deps:
$(LIBDIR)/$(CONFIG)/lib${dep}.a\ $(LIBDIR)/$(CONFIG)/lib${dep}.a\
...@@ -1319,9 +1335,11 @@ $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: \ ...@@ -1319,9 +1335,11 @@ $(OBJDIR)/$(CONFIG)/${os.path.splitext(src)[0]}.o: \
% endfor % endfor
% endfor % endfor
% if not has_no_sources:
deps_${tgt.name}: $(${tgt.name.upper()}_OBJS:.o=.dep) 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': % if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
ifneq ($(NO_SECURE),true) ifneq ($(NO_SECURE),true)
% endif % endif
...@@ -1331,6 +1349,7 @@ endif ...@@ -1331,6 +1349,7 @@ endif
% if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check': % if tgt.get('secure', 'check') == 'yes' or tgt.get('secure', 'check') == 'check':
endif endif
% endif % endif
% endif
</%def> </%def>
ifneq ($(OPENSSL_DEP),) ifneq ($(OPENSSL_DEP),)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment