#! /usr/bin/python3 # Last edited on 2026-03-15 04:44:10 by stolfi import sys, os, re; from sys import stderr as err from error_funcs import arg_error, prog_error from process_funcs import bash from make_funcs import make_targets from math import fabs import make_077_rules as m77 import make_077_funcs as mrf def main(targets): # TARGETS AND THEIR PRE-REQUISITES: pre = dict() # Maps target filename (sans 'res') to list of prerequisites filenames. mak = dict() # Maps target filename (sans 'res') to commands that build it. tit = dict() # Maps target to progress message for {stderr}. all_targets = m77.add_all_rules(pre, mak, tit) # Include the basic ".ivt" targets in any case: for bsub in "fu", "gd": for utype in "ec", "wp", "wc": for ltype in "lin", "par", "pag": if bsub != "gd" or ltype != "pag": target = f"starps-{bsub}-{utype}-{ltype}.ivt" targets.append(target) for utype in "ch", "ps": target = f"bencao-fu-{utype}-par.ivt" targets.append(target) odir = "res" mrf.cleanup("bencao") mrf.cleanup("starps") if targets == None or len(targets) == 1 and targets[0] == "ALL": targets = all_targets targets = list(set(targets)) targets.sort() err.write("TARGETS TO MAKE\n") for target in targets: err.write(" %s\n" % target) err.write("\n") debug_make = True make_targets(targets, odir, pre, mak, tit, debug_make) err.write("done.\n") return # ---------------------------------------------------------------------- targets = [] assert len(sys.argv) >= 1 # Always {sys.argv[0]} is the command. targets = [ arg for arg in sys.argv[1:] ] main(targets)