File: SConstruct

package info (click to toggle)
dtl 1.21-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 440 kB
  • sloc: cpp: 2,285; makefile: 2
file content (43 lines) | stat: -rw-r--r-- 1,987 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import os

# SConstruct for dtl examples

env   = Environment(CPPPATH='..')
debug = ARGUMENTS.get('debug', 'n')
if debug == 'y' or debug == 'yes':
    env.Append(CPPFLAGS = ['-Wall', '-g'])
else:
    env.Append(CPPFLAGS = ['-Wall', '-O2'])

if os.sys.platform != "win32":
    env.Append(CPPDEFINES = ['HAVE_UNISTD_H'])

conf = Configure(env);

if not conf.CheckCXX():
    print("The C++ compiler is not installed!")
    Exit(1)

libs = ['stdc++']
for lib in libs:
    if not conf.CheckLib(lib):
        print("library " + lib + " not installed!")
        Exit(1)

conf.Finish()

targets = { 'strdiff'         : ['strdiff.cpp',         'common.cpp'], # diff between two string sequences
            'intdiff'         : ['intdiff.cpp'],                       # diff between two integer sequences
            'unidiff'         : ['unidiff.cpp',         'common.cpp'], # unified diff between two files
            'unistrdiff'      : ['unistrdiff.cpp',      'common.cpp'], # unified diff between two strings
            'bdiff'           : ['bdiff.cpp',           'common.cpp'], # diff between two byte sequences
            'strdiff3'        : ['strdiff3.cpp',        'common.cpp'], # three-way string diff program using dtl
            'intdiff3'        : ['intdiff3.cpp'],                      # three-way integer diff program using dtl
            'patch'           : ['patch.cpp',           'common.cpp'], # string patch program using dtl
            'fpatch'          : ['fpatch.cpp',          'common.cpp'], # file patch program using dtl
            'st2ses'          : ['st2ses.cpp',          'common.cpp'], # convert SES format file to SES instance
            'strdiff_cp'      : ['strdiff_cp.cpp',      'common.cpp'], # diff between two string sequences with custom printer
            'strdiff_storage' : ['strdiff_storage.cpp', 'common.cpp'], # diff between two string sequences with custom storage
            }

[ env.Program(target, targets[target]) for target in targets ]