[100f517] | 1 | # |
---|
| 2 | # RTEMS Tools Project (http://www.rtems.org/) |
---|
| 3 | # Copyright 2014 Chris Johns (chrisj@rtems.org) |
---|
| 4 | # All rights reserved. |
---|
| 5 | # |
---|
| 6 | # This file is part of the RTEMS Tools package in 'rtems-tools'. |
---|
| 7 | # |
---|
| 8 | # Redistribution and use in source and binary forms, with or without |
---|
| 9 | # modification, are permitted provided that the following conditions are met: |
---|
| 10 | # |
---|
| 11 | # 1. Redistributions of source code must retain the above copyright notice, |
---|
| 12 | # this list of conditions and the following disclaimer. |
---|
| 13 | # |
---|
| 14 | # 2. Redistributions in binary form must reproduce the above copyright notice, |
---|
| 15 | # this list of conditions and the following disclaimer in the documentation |
---|
| 16 | # and/or other materials provided with the distribution. |
---|
| 17 | # |
---|
| 18 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
| 19 | # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
| 20 | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
---|
| 21 | # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE |
---|
| 22 | # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
---|
| 23 | # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
---|
| 24 | # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
---|
| 25 | # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
---|
| 26 | # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
---|
| 27 | # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
---|
| 28 | # POSSIBILITY OF SUCH DAMAGE. |
---|
| 29 | # |
---|
| 30 | |
---|
| 31 | # |
---|
| 32 | # Build the covoar application. |
---|
| 33 | # |
---|
| 34 | # Taken from the waf C++ demo. |
---|
| 35 | # |
---|
| 36 | |
---|
| 37 | # |
---|
| 38 | # The following two variables are used by the target "waf dist". |
---|
| 39 | # |
---|
| 40 | VERSION='0.0.1' |
---|
| 41 | APPNAME='covoar' |
---|
| 42 | |
---|
| 43 | # |
---|
| 44 | # These variables are mandatory ('/' are converted automatically) |
---|
| 45 | # |
---|
| 46 | top = '.' |
---|
| 47 | out = 'build' |
---|
| 48 | |
---|
[7148cae] | 49 | def init(ctx): |
---|
| 50 | pass |
---|
| 51 | |
---|
[100f517] | 52 | def options(opt): |
---|
| 53 | opt.load('compiler_cxx') |
---|
| 54 | |
---|
| 55 | def configure(conf): |
---|
| 56 | conf.load('compiler_cxx') |
---|
[d7979de] | 57 | conf.check_cc(fragment = ''' |
---|
| 58 | #include <stdlib.h> |
---|
| 59 | int main() { FILE* f = fopen64("name", "r"); } ''', |
---|
| 60 | cflags = '-Wall', define_name = 'HAVE_OPEN64', |
---|
| 61 | msg = 'Checking for fopen64', mandatory = False) |
---|
| 62 | conf.check_cc(fragment = ''' |
---|
| 63 | #include <sys/stat.h> |
---|
| 64 | int main() { struct stat64 sb; int f = 3; int r = stat64(f, &sb); } ''', |
---|
| 65 | cflags = '-Wall', define_name = 'HAVE_STAT64', |
---|
| 66 | msg = 'Checking for stat64', mandatory = False) |
---|
[100f517] | 67 | conf.write_config_header('covoar-config.h') |
---|
| 68 | |
---|
| 69 | def build(bld): |
---|
[cb0677b] | 70 | rtemstoolkit = '../../rtemstoolkit' |
---|
| 71 | rtl_includes = [rtemstoolkit, |
---|
| 72 | rtemstoolkit + '/elftoolchain/libelf', |
---|
[dbb56a8] | 73 | rtemstoolkit + '/elftoolchain/libdwarf', |
---|
[cb0677b] | 74 | rtemstoolkit + '/elftoolchain/common', |
---|
| 75 | rtemstoolkit + '/libiberty'] |
---|
| 76 | if bld.env.DEST_OS == 'win32': |
---|
| 77 | rtl_includes += [rtemstoolkit + '/win32'] |
---|
| 78 | |
---|
[0054585] | 79 | # |
---|
| 80 | # The list of modules. |
---|
| 81 | # |
---|
[fb987e8] | 82 | modules = ['rld', 'dwarf', 'elf', 'iberty'] |
---|
[0054585] | 83 | |
---|
[100f517] | 84 | bld.stlib(target = 'ccovoar', |
---|
| 85 | source = ['app_common.cc', |
---|
| 86 | 'CoverageFactory.cc', |
---|
| 87 | 'CoverageMap.cc', |
---|
| 88 | 'CoverageMapBase.cc', |
---|
| 89 | 'CoverageRanges.cc', |
---|
| 90 | 'CoverageReaderBase.cc', |
---|
| 91 | 'CoverageReaderQEMU.cc', |
---|
| 92 | 'CoverageReaderRTEMS.cc', |
---|
| 93 | 'CoverageReaderSkyeye.cc', |
---|
| 94 | 'CoverageReaderTSIM.cc', |
---|
| 95 | 'CoverageWriterBase.cc', |
---|
| 96 | 'CoverageWriterRTEMS.cc', |
---|
| 97 | 'CoverageWriterSkyeye.cc', |
---|
| 98 | 'CoverageWriterTSIM.cc', |
---|
| 99 | 'DesiredSymbols.cc', |
---|
| 100 | 'ExecutableInfo.cc', |
---|
| 101 | 'Explanations.cc', |
---|
| 102 | 'GcovData.cc', |
---|
| 103 | 'GcovFunctionData.cc', |
---|
| 104 | 'ObjdumpProcessor.cc', |
---|
| 105 | 'ReportsBase.cc', |
---|
| 106 | 'ReportsText.cc', |
---|
| 107 | 'ReportsHtml.cc', |
---|
| 108 | 'SymbolTable.cc', |
---|
| 109 | 'Target_arm.cc', |
---|
| 110 | 'TargetBase.cc', |
---|
| 111 | 'TargetFactory.cc', |
---|
| 112 | 'Target_i386.cc', |
---|
| 113 | 'Target_lm32.cc', |
---|
| 114 | 'Target_m68k.cc', |
---|
| 115 | 'Target_powerpc.cc', |
---|
[4828c19] | 116 | 'Target_sparc.cc', |
---|
| 117 | 'Target_riscv.cc'], |
---|
[99c90b3] | 118 | cflags = ['-O2', '-g', '-Wall'], |
---|
| 119 | cxxflags = ['-std=c++11', '-O2', '-g', '-Wall'], |
---|
[4cee5c3] | 120 | includes = ['.'] + rtl_includes) |
---|
[100f517] | 121 | |
---|
| 122 | bld.program(target = 'trace-converter', |
---|
| 123 | source = ['TraceConverter.cc', |
---|
| 124 | 'TraceList.cc', |
---|
| 125 | 'TraceReaderBase.cc', |
---|
| 126 | 'TraceReaderLogQEMU.cc', |
---|
| 127 | 'TraceWriterBase.cc', |
---|
| 128 | 'TraceWriterQEMU.cc'], |
---|
[0054585] | 129 | use = ['ccovoar'] + modules, |
---|
[100f517] | 130 | cflags = ['-O2', '-g'], |
---|
[3e187ba] | 131 | cxxflags = ['-std=c++11', '-O2', '-g'], |
---|
[4cee5c3] | 132 | includes = ['.'] + rtl_includes) |
---|
[100f517] | 133 | |
---|
| 134 | bld.program(target = 'covoar', |
---|
| 135 | source = ['covoar.cc'], |
---|
[0054585] | 136 | use = ['ccovoar'] + modules, |
---|
[a1498ab] | 137 | install_path = '${PREFIX}/share/rtems/tester/bin', |
---|
[100f517] | 138 | cflags = ['-O2', '-g'], |
---|
[3e187ba] | 139 | cxxflags = ['-std=c++11', '-O2', '-g'], |
---|
[4cee5c3] | 140 | includes = ['.'] + rtl_includes) |
---|