Better C/C++ split in the Makefile targets, to better prepare slicing it into two different Makefiles.

Change on 2014/12/01 by nnoble <nnoble@google.com>
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=81076626
pull/1/merge
nnoble 10 years ago committed by Nicolas Noble
parent b7ebd3b8c6
commit 29e1d295ef
  1. 38
      Makefile
  2. 64
      templates/Makefile.template

File diff suppressed because one or more lines are too long

@ -120,24 +120,53 @@ all: static shared\
% endif
% endfor
static: static_c static_cxx
static: make_dirs dep\
static_c: make_dirs dep\
% for lib in libs:
% if lib.build == 'all':
% if lib.build == 'all' and not lib.get('c++', False):
libs/lib${lib.name}.a\
% endif
% endfor
shared: make_dirs dep\
static_cxx: make_dirs dep\
% for lib in libs:
% if lib.build == 'all':
% if lib.build == 'all' and lib.get('c++', False):
libs/lib${lib.name}.a\
% endif
% endfor
shared: shared_c shared_cxx
shared_c: make_dirs dep\
% for lib in libs:
% if lib.build == 'all' and not lib.get('c++', False):
libs/lib${lib.name}.so.$(VERSION)\
% endif
% endfor
shared_cxx: make_dirs dep\
% for lib in libs:
% if lib.build == 'all' and lib.get('c++', False):
libs/lib${lib.name}.so.$(VERSION)\
% endif
% endfor
privatelibs: make_dirs dep\
privatelibs: privatelibs_c privatelibs_cxx
privatelibs_c: make_dirs dep\
% for lib in libs:
% if lib.build == 'private':
libs/lib${lib.name}.a\
% endif
% endfor
privatelibs_cxx: make_dirs dep\
% for lib in libs:
% if lib.build == 'private':
libs/lib${lib.name}.a\
@ -145,25 +174,38 @@ privatelibs: make_dirs dep\
% endfor
buildtests: privatelibs\
buildtests: buildtests_c buildtests_cxx
buildtests_c: privatelibs_c\
% for tgt in targets:
% if tgt.build == 'test':
% if tgt.build == 'test' and not tgt.get('c++', False):
bins/${tgt.name}\
% endif
% endfor
buildtests_c: privatelibs\
buildtests_cxx: privatelibs_cxx\
% for tgt in targets:
% if tgt.build == 'test' and not tgt.get('c++', False):
% if tgt.build == 'test' and tgt.get('c++', False):
bins/${tgt.name}\
% endif
% endfor
tests: buildtests
tests: tests_c tests_cxx
tests_c: buildtests_c
% for tgt in targets:
% if tgt.build == 'test' and tgt.get('run', True) and not tgt.get('c++', False):
$(E) "[RUN] Testing ${tgt.name}"
$(Q) ./bins/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 )
% endif
% endfor
tests_cxx: buildtests_cxx
% for tgt in targets:
% if tgt.build == 'test' and tgt.get('run', True):
% if tgt.build == 'test' and tgt.get('run', True) and tgt.get('c++', False):
$(E) "[RUN] Testing ${tgt.name}"
$(Q) ./bins/${tgt.name} || ( echo test ${tgt.name} failed ; exit 1 )
% endif

Loading…
Cancel
Save