This repository has been archived by the owner on Jan 4, 2024. It is now read-only.
forked from Solo5/solo5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.common
46 lines (41 loc) · 1.86 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
40
41
42
43
44
45
46
# Copyright (c) 2015-2018 Contributors as noted in the AUTHORS file
#
# This file is part of Solo5, a sandboxed execution environment.
#
# 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 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.
COMMON_LDFLAGS=-nostdlib -z max-page-size=0x1000
LDFLAGS=$(COMMON_LDFLAGS) -static $(HOST_LDFLAGS)
# CFLAGS used for building bindings/ and in-tree tests.
INCDIR=-isystem $(TOP)/include/crt -I$(TOP)/include/solo5
CFLAGS=$(MD_CFLAGS) -std=gnu99 -Wall -Wextra -Werror -O2 -g $(INCDIR)
# Genode linking is a special case
GENODE_COMMON_LDFLAGS = $(COMMON_LDFLAGS) -shared -gc-sections --eh-frame-hdr
GENODE_LIB_LDFLAGS=$(GENODE_COMMON_LDFLAGS) --entry=0x0 -T $(TOP)/bindings/genode/genode_rel.ld
GENODE_APP_LDFLAGS=$(GENODE_COMMON_LDFLAGS) -Ttext=0x01000000 --dynamic-linker=ld.lib.so -rpath-link=.