aos/lib/crt/Hakefile
Daniel Schwyn 6d444bf552 Main handout
Signed-off-by: Daniel Schwyn <daniel.schwyn@inf.ethz.ch>
2022-03-03 14:57:51 +01:00

35 lines
1.3 KiB
Plaintext

--------------------------------------------------------------------------
-- Copyright (c) 2007-2011, ETH Zurich.
-- All rights reserved.
--
-- This file is distributed under the terms in the attached LICENSE file.
-- If you do not find this file, copies can be found by writing to:
-- ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
--
-- Hakefile for lib/crt
--
--------------------------------------------------------------------------
-- Description of crt*.o files generated:
-- crt0.o: startup for all C/C++ programs
-- crtbegin.o .ctors section header (for C++ ABI compatibility)
-- crtend.o .ctors section footer (for C++ ABI compatibility)
[(
let
opts = (options arch) {
extraDependencies = [ Dep BuildTree arch "/include/asmoffsets.h" ],
extraDefines = [ "-Wno-array-bounds" ]
}
adir = "arch" </> archFamily arch
in
Rules [assembleSFile opts (adir </> "crt0.S"),
copy opts (adir </> "crt0.o") "/lib/crt0.o",
compileCFile opts ("crtbegin.c"),
copy opts "crtbegin.o" "/lib/crtbegin.o",
compileCFile opts ("crtend.c"),
-- crtend has to be an object file, otherwise it will not be linked properly
-- staticLibrary opts "crtend" ["crtend.o"] [],
copy opts "crtend.o" "/lib/crtend.o" ]
) | arch <- allArchitectures ]