forked from Solo5/solo5
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile.common
39 lines (35 loc) · 1.48 KB
/
Makefile.common
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Copyright (c) 2015-2017 Contributors as noted in the AUTHORS file
#
# This file is part of Solo5, a unikernel base layer.
#
# Permission to use, copy, modify, and/or distribute this software
# for any purpose with or without fee is hereby granted, provided
# that the above copyright notice and this permission notice appear
# in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
# WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
# AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
# CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
# OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
# This Makefile defines global defaults for building Solo5 (kernel/) and the
# in-tree test programs. These can be overriden either on the command line, or
# via Makeconf generated by configure.sh.
include $(TOP)/Makeconf
# Be clear about some common programs we use!
AS?=as
CC?=cc
LD?=ld
OBJCOPY?=objcopy
# Exported to OPAM via pkg-config.
MD_CFLAGS=$(HOST_CFLAGS) -ffreestanding
ifeq ($(TARGET_ARCH), x86_64)
MD_CFLAGS+=-mno-red-zone
endif
# Likewise.
LDFLAGS=-nostdlib -z max-page-size=0x1000 -static $(HOST_LDFLAGS)
# CFLAGS used for building kernel/ and in-tree tests.
CFLAGS=$(MD_CFLAGS) -isystem $(TOP)/include-host -std=gnu99 -Wall -Wextra -Werror -O2 -g