SConscript (6168:ba6fe02228db) SConscript (6286:40b142645016)
1# -*- mode:python -*-
2
3# Copyright (c) 2009 The Hewlett-Packard Development Company
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 36 unchanged lines hidden (view full) ---

45
46slicc_dir = Dir('../slicc')
47protocol_dir = Dir('.')
48html_dir = Dir('html')
49
50#
51# Use SLICC
52#
1# -*- mode:python -*-
2
3# Copyright (c) 2009 The Hewlett-Packard Development Company
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 36 unchanged lines hidden (view full) ---

45
46slicc_dir = Dir('../slicc')
47protocol_dir = Dir('.')
48html_dir = Dir('html')
49
50#
51# Use SLICC
52#
53def slicc_action(target, source, env):
53def slicc_generator(target, source, env, for_signature):
54 slicc_bin = str(source[0])
55 protocol = source[1].get_contents()
56 pdir = str(protocol_dir)
57 hdir = str(html_dir)
58
59 if not isdir(pdir):
60 os.mkdir(pdir)
61 if not isdir(hdir):
62 os.mkdir(hdir)
63
64 do_html = "no_html"
65 cmdline = [ slicc_bin, pdir, hdir, protocol, do_html ]
66 cmdline += [ str(s) for s in source[2:] ]
67 cmdline = ' '.join(cmdline)
54 slicc_bin = str(source[0])
55 protocol = source[1].get_contents()
56 pdir = str(protocol_dir)
57 hdir = str(html_dir)
58
59 if not isdir(pdir):
60 os.mkdir(pdir)
61 if not isdir(hdir):
62 os.mkdir(hdir)
63
64 do_html = "no_html"
65 cmdline = [ slicc_bin, pdir, hdir, protocol, do_html ]
66 cmdline += [ str(s) for s in source[2:] ]
67 cmdline = ' '.join(cmdline)
68 os.system(cmdline)
68 return cmdline
69
69
70slicc_builder = Builder(generator=slicc_generator)
71
70protocol = env['PROTOCOL']
71sources = [ protocol_dir.File("RubySlicc_interfaces.slicc"),
72 protocol_dir.File("%s.slicc" % protocol) ]
73
74sm_files = []
75for s in sources:
76 for sm_file in file(File(s).srcnode().abspath, "r"):
77 sm_file = sm_file.strip()

--- 8 unchanged lines hidden (view full) ---

86sys.path[0:0] = [env['ENV']['M5_PLY']]
87execfile(slicc_dir.File('parser/parser.py').srcnode().abspath)
88
89hh, cc = scan([s.srcnode().abspath for s in sm_files])
90hh = [ protocol_dir.File(f) for f in hh ]
91cc = [ protocol_dir.File(f) for f in cc ]
92
93slicc_bin = slicc_dir.File("slicc")
72protocol = env['PROTOCOL']
73sources = [ protocol_dir.File("RubySlicc_interfaces.slicc"),
74 protocol_dir.File("%s.slicc" % protocol) ]
75
76sm_files = []
77for s in sources:
78 for sm_file in file(File(s).srcnode().abspath, "r"):
79 sm_file = sm_file.strip()

--- 8 unchanged lines hidden (view full) ---

88sys.path[0:0] = [env['ENV']['M5_PLY']]
89execfile(slicc_dir.File('parser/parser.py').srcnode().abspath)
90
91hh, cc = scan([s.srcnode().abspath for s in sm_files])
92hh = [ protocol_dir.File(f) for f in hh ]
93cc = [ protocol_dir.File(f) for f in cc ]
94
95slicc_bin = slicc_dir.File("slicc")
94env.Command(hh + cc, [ slicc_bin, Value(protocol) ] + sm_files, slicc_action)
95
96
97env.Append(BUILDERS={'SLICC' : slicc_builder})
98env.SLICC(hh + cc, [ slicc_bin, Value(protocol) ] + sm_files)
99
96for f in cc:
97 Source(f)
100for f in cc:
101 Source(f)