1---------------------------------------------------------------------- 2-- Copyright (c) 2009, 2010, 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 /tools/elver 10-- 11---------------------------------------------------------------------- 12 13-- 14-- This has to be rather low-level, since elver is indeed a module for 15-- x86_64, but is built for 32-bits, so it's easiest to do this rather 16-- explicitly. 17-- 18let arch = "x86_64" 19 opts = (options arch) { 20 optFlags = [ Str s | s <- [ "-fno-builtin", 21 "-nostdinc", 22 "-std=gnu99", 23 "-m32", 24 "-mno-red-zone", 25 26 -- avoid SSE instructions, SIMD is disabled 27 "-mno-mmx", 28 "-mno-sse", 29 "-mno-sse2", 30 "-mno-sse3", 31 "-mno-sse4.1", 32 "-mno-sse4.2", 33 "-mno-sse4", 34 "-mno-sse4a", 35 "-mno-3dnow", 36 "-fPIE", 37 "-fno-stack-protector", 38 "-U__linux__", 39 "-Wall", 40 "-Wshadow", 41 "-Wstrict-prototypes", 42 "-Wold-style-definition", 43 "-Wmissing-prototypes", 44 "-Wmissing-declarations", 45 "-Wmissing-field-initializers", 46 "-Wredundant-decls", 47 "-Werror" ] ], 48 optIncludes = [ NoDep SrcTree "src" "/include", 49 NoDep SrcTree "src" "/lib/newlib/newlib/libc/include", 50 NoDep SrcTree "src" "/include/c", 51 NoDep SrcTree "src" "/include/arch/x86_32", 52 NoDep BuildTree arch "/include" ], 53 optDefines = [], 54 optLibs = [], 55 optLdFlags = [ Str s | s <- [ "-m32", 56 "-fno-builtin", 57 "-nostdlib", 58 "-Wl,--fatal-warnings", 59 "-e start", 60 "-Wl,-Ttext,0x100000", 61 "-static", 62 "-Wl,--build-id=none" ]], 63 optSuffix = "_for_elver" 64 } 65 objs = [ objectFilePath opts f | f <- [ "boot.S", "elver.c", "lib.c", 66 "../../lib/elf/elf64.c" ] ] 67in 68 [ compileCFiles opts [ "elver.c", "lib.c", "../../lib/elf/elf64.c" ], 69 assembleSFiles opts [ "boot.S" ], 70 link opts objs [] [] "elver" 71 ] 72