diff options
author | nnoble <nnoble@google.com> | 2014-12-01 10:27:40 -0800 |
---|---|---|
committer | Nicolas Noble <nnoble@google.com> | 2014-12-01 14:37:59 -0800 |
commit | 29e1d295eff43d05af3e3475e911b3f5df2b5522 (patch) | |
tree | e06b0365bc6ee8cb7a372eac9858aa64c2b1372a /templates/Makefile.template | |
parent | b7ebd3b8c6fe39f99c40b10c1b563e4adb607b6c (diff) |
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
Diffstat (limited to 'templates/Makefile.template')
-rw-r--r-- | templates/Makefile.template | 64 |
1 files changed, 53 insertions, 11 deletions
diff --git a/templates/Makefile.template b/templates/Makefile.template index 680941bcd2..801344ec51 100644 --- a/templates/Makefile.template +++ b/templates/Makefile.template @@ -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 |