Avoid creation of outputfile on failure of dependency script + add beri license header
This commit is contained in:
@@ -1,4 +1,31 @@
|
||||
#! /usr/bin/env bluetcl
|
||||
#
|
||||
# Copyright (c) 2020 Alexandre Joannou
|
||||
# All rights reserved.
|
||||
#
|
||||
# This software was developed by SRI International and the University of
|
||||
# Cambridge Computer Laboratory (Department of Computer Science and
|
||||
# Technology) under DARPA contract HR0011-18-C-0016 ("ECATS"), as part of the
|
||||
# DARPA SSITH research programme.
|
||||
#
|
||||
# @BERI_LICENSE_HEADER_START@
|
||||
#
|
||||
# Licensed to BERI Open Systems C.I.C. (BERI) under one or more contributor
|
||||
# license agreements. See the NOTICE file distributed with this work for
|
||||
# additional information regarding copyright ownership. BERI licenses this
|
||||
# file to you under the BERI Hardware-Software License, Version 1.0 (the
|
||||
# "License"); you may not use this file except in compliance with the
|
||||
# License. You may obtain a copy of the License at:
|
||||
#
|
||||
# http://www.beri-open-systems.org/legal/license-1-0.txt
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, Work distributed
|
||||
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
||||
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations under the License.
|
||||
#
|
||||
# @BERI_LICENSE_HEADER_END@
|
||||
#
|
||||
|
||||
namespace import ::Bluetcl::*
|
||||
|
||||
@@ -73,12 +100,19 @@ if { $argc > 0 } { foreach i $argv { flags set $i } }
|
||||
# }
|
||||
# reformating it for make
|
||||
################################################################################
|
||||
|
||||
set fd [open $outputfile w]
|
||||
foreach i [depend make $topfile] {
|
||||
set tgt [lindex $i 0]
|
||||
set deps [join [lindex $i 1]]
|
||||
puts $fd [append tgt ": " $deps]
|
||||
try {
|
||||
set res [depend make $topfile]
|
||||
} finally {
|
||||
if { [info exists res] } {
|
||||
set fd [open $outputfile w]
|
||||
foreach i $res {
|
||||
set tgt [lindex $i 0]
|
||||
set deps [join [lindex $i 1]]
|
||||
puts $fd [append tgt ": " $deps]
|
||||
}
|
||||
close $fd
|
||||
puts "generated make dependency rules for \"$topfile\" in: $outputfile"
|
||||
} else {
|
||||
puts "could not generate make dependency rules for \"$topfile\""
|
||||
}
|
||||
}
|
||||
close $fd
|
||||
puts "generated make dependency rules for \"$topfile\" in: $outputfile"
|
||||
|
||||
Reference in New Issue
Block a user