1----------------------------------------------------------------------
2-- Copyright (c) 2009-2016, ETH Zurich.
3-- All rights reserved.
4--
5-- This file is distributed under the terms in the attached LICENSE file.
6-- If you do not find this file, copies can be found by writing to:
7-- ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
8--
9-- Hakefile for scheduler simulator
10--
11----------------------------------------------------------------------
12
13let cfgs = find withSuffix ".cfg"
14    runtime = "1000"
15in [ compileNativeC "simulator"
16        [ "simulator.c" ]
17        [ "-std=gnu99", "-g", "-Wall", "-Werror", "-DSCHEDULER_SIMULATOR" ]
18        []
19        []
20    ]
21    ++ [ Phony "schedsim-regen" False
22        [ Dep BuildTree "" (cfg -<.> ".txt") | cfg <- cfgs ]
23    ]
24    ++ [ (Rule [
25            In BuildTree "tools" "/bin/simulator",
26            In SrcTree "src" cfg,
27            Str runtime,
28            Out "" (cfg -<.> ".txt")
29        ]) | cfg <- cfgs
30    ]
31    ++ [ (Phony "schedsim-check" True [
32        In BuildTree "tools" "/bin/simulator",
33        In SrcTree "src" cfg,
34        Str runtime,
35        Str "|",
36        Str "diff -q -",
37        In SrcTree "src" (cfg -<.> ".txt")
38    ]) | cfg <- cfgs ]
39