mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-18 16:27:34 +01:00
Organize the build system
Change-Id: Ib331bae99041b998eb721b44c3b0b44426270b38
This commit is contained in:
17
Makefile
17
Makefile
@@ -1,17 +1,18 @@
|
||||
PLATFORM ?= device
|
||||
DEBUG ?= 1
|
||||
include build/config.mak
|
||||
|
||||
include Makefile.$(PLATFORM)
|
||||
ifndef USE_LIBA
|
||||
$(error Makefile.PLATFORM should define USE_LIBA)
|
||||
$(error platform.mak should define USE_LIBA)
|
||||
endif
|
||||
ifndef EXE
|
||||
$(error Makefile.PLATFORM should define EXE, the extension for executables)
|
||||
$(error platform.mak should define EXE, the extension for executables)
|
||||
endif
|
||||
|
||||
HOSTCC = gcc
|
||||
HOSTCXX = g++
|
||||
|
||||
# Flags - Optimizations
|
||||
SFLAGS += $(OPTIM_SFLAGS)
|
||||
|
||||
# Flags - Header search path
|
||||
SFLAGS += -Ilib -I.
|
||||
|
||||
@@ -21,12 +22,8 @@ SFLAGS += -Wall
|
||||
# Flags - Header dependency tracking
|
||||
SFLAGS += -MD -MP
|
||||
|
||||
# Flags - Optimizations
|
||||
ifeq ($(DEBUG),1)
|
||||
SFLAGS += -ggdb3 -DDEBUG=1 -O0
|
||||
else
|
||||
SFLAGS += -Os -fdata-sections -ffunction-sections
|
||||
LDFLAGS += --gc-sections
|
||||
SFLAGS += -DDEBUG=1
|
||||
endif
|
||||
|
||||
# Language-specific flags
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
CC=clang
|
||||
CXX=clang++
|
||||
LD=clang++
|
||||
SIZE=size
|
||||
|
||||
SFLAGS += -DLIBA_LOG_DYNAMIC_MEMORY
|
||||
|
||||
USE_LIBA=1
|
||||
EXE=elf
|
||||
@@ -1,28 +0,0 @@
|
||||
TOOLCHAIN=arm-none-eabi
|
||||
# FIXME decide which one to use.
|
||||
#COMPILER=llvm
|
||||
|
||||
ifeq ($(COMPILER),llvm)
|
||||
CC=clang
|
||||
CXX=clang++
|
||||
else
|
||||
CC=$(TOOLCHAIN)-gcc
|
||||
CXX=$(TOOLCHAIN)-g++
|
||||
endif
|
||||
|
||||
LD=$(TOOLCHAIN)-ld.bfd
|
||||
GDB=$(TOOLCHAIN)-gdb
|
||||
OBJCOPY=$(TOOLCHAIN)-objcopy
|
||||
SIZE=$(TOOLCHAIN)-size
|
||||
|
||||
# Flags - Arch
|
||||
ifeq ($(COMPILER),llvm)
|
||||
SFLAGS += -target thumbv7em-unknown-eabi
|
||||
else
|
||||
SFLAGS += -mthumb -march=armv7e-m -mfloat-abi=hard
|
||||
endif
|
||||
SFLAGS += -mcpu=cortex-m4 -mfpu=fpv4-sp-d16
|
||||
|
||||
# Platform configuration
|
||||
USE_LIBA=1
|
||||
EXE=elf
|
||||
@@ -1,9 +0,0 @@
|
||||
CC=emcc
|
||||
CXX=emcc
|
||||
LD=emcc
|
||||
LDFLAGS=-s EXPORTED_FUNCTIONS="['_main', '_IonEmscriptenPushEvent']" -Os --shell-file ion/src/emscripten/shell.html
|
||||
SIZE=size
|
||||
DEBUG=0
|
||||
|
||||
USE_LIBA=0
|
||||
EXE=html
|
||||
@@ -1,7 +0,0 @@
|
||||
CC=clang
|
||||
CXX=clang++
|
||||
LD=clang++
|
||||
SIZE=size
|
||||
|
||||
USE_LIBA=0
|
||||
EXE=elf
|
||||
20
build/config.mak
Normal file
20
build/config.mak
Normal file
@@ -0,0 +1,20 @@
|
||||
# You can edit this file to change build settings
|
||||
|
||||
PLATFORM ?= device
|
||||
VERBOSE ?= 0
|
||||
DEBUG ?= 1
|
||||
LIBA_LOG_DYNAMIC_MEMORY ?= 0
|
||||
ESCHER_LOG_EVENTS ?= 0
|
||||
ION_EVENTS ?= keyboard
|
||||
# Possible values : keyboard, stdin, random, replay
|
||||
|
||||
# Do not edit below this
|
||||
|
||||
ifeq ($(DEBUG),1)
|
||||
OPTIM_SFLAGS ?= -O0
|
||||
else
|
||||
OPTIM_SFLAGS ?= -Os
|
||||
endif
|
||||
|
||||
include build/platform.$(PLATFORM).mak
|
||||
include build/toolchain.$(TOOLCHAIN).mak
|
||||
3
build/platform.blackbox.mak
Normal file
3
build/platform.blackbox.mak
Normal file
@@ -0,0 +1,3 @@
|
||||
TOOLCHAIN ?= afl
|
||||
USE_LIBA ?= 1
|
||||
EXE = bin
|
||||
7
build/platform.device.mak
Normal file
7
build/platform.device.mak
Normal file
@@ -0,0 +1,7 @@
|
||||
TOOLCHAIN ?= arm-gcc
|
||||
ifeq ($(COMPILER),llvm)
|
||||
# Compatibility with old build system
|
||||
TOOLCHAIN = arm-llvm
|
||||
endif
|
||||
USE_LIBA = 1
|
||||
EXE = elf
|
||||
3
build/platform.emscripten.mak
Normal file
3
build/platform.emscripten.mak
Normal file
@@ -0,0 +1,3 @@
|
||||
TOOLCHAIN = emscripten
|
||||
USE_LIBA = 0
|
||||
EXE = html
|
||||
3
build/platform.simulator.mak
Normal file
3
build/platform.simulator.mak
Normal file
@@ -0,0 +1,3 @@
|
||||
TOOLCHAIN ?= host-clang
|
||||
USE_LIBA = 0
|
||||
EXE = elf
|
||||
3
build/toolchain.afl.mak
Normal file
3
build/toolchain.afl.mak
Normal file
@@ -0,0 +1,3 @@
|
||||
CC = afl-clang
|
||||
CXX = afl-clang++
|
||||
LD = afl-clang++
|
||||
13
build/toolchain.arm-gcc.mak
Normal file
13
build/toolchain.arm-gcc.mak
Normal file
@@ -0,0 +1,13 @@
|
||||
CC = arm-none-eabi-gcc
|
||||
CXX = arm-none-eabi-g++
|
||||
LD = arm-none-eabi-ld.bfd
|
||||
GDB = arm-none-eabi-gdb
|
||||
OBJCOPY = arm-none-eabi-objcopy
|
||||
SIZE = arm-none-eabi-size
|
||||
ifeq ($(DEBUG),1)
|
||||
OPTIM_SFLAGS += -ggdb3
|
||||
else
|
||||
OPTIM_SFLAGS += -fdata-sections -ffunction-sections
|
||||
LDFLAGS = --gc-sections
|
||||
endif
|
||||
SFLAGS = -mthumb -march=armv7e-m -mfloat-abi=hard -mcpu=cortex-m4 -mfpu=fpv4-sp-d16
|
||||
4
build/toolchain.arm-llvm.mak
Normal file
4
build/toolchain.arm-llvm.mak
Normal file
@@ -0,0 +1,4 @@
|
||||
include build/toolchain.arm-gcc.mak
|
||||
CC = clang
|
||||
CXX = clang++
|
||||
SFLAGS = -target thumbv7em-unknown-eabi -mcpu=cortex-m4 -mfpu=fpv4-sp-d16
|
||||
5
build/toolchain.emscripten.mak
Normal file
5
build/toolchain.emscripten.mak
Normal file
@@ -0,0 +1,5 @@
|
||||
CC = emcc
|
||||
CXX = emcc
|
||||
LD = emcc
|
||||
LDFLAGS = -s EXPORTED_FUNCTIONS="['_main', '_IonEmscriptenPushEvent']" -Os --shell-file ion/src/emscripten/shell.html
|
||||
SIZE = size
|
||||
4
build/toolchain.host-clang.mak
Normal file
4
build/toolchain.host-clang.mak
Normal file
@@ -0,0 +1,4 @@
|
||||
CC = clang
|
||||
CXX = clang++
|
||||
LD = clang++
|
||||
GDB = lldb
|
||||
6
build/toolchain.mingw.mak
Normal file
6
build/toolchain.mingw.mak
Normal file
@@ -0,0 +1,6 @@
|
||||
CC = mingw-w64-x86_64-gcc
|
||||
CXX = mingw-w64-x86_64-g++
|
||||
LD = mingw-w64-x86_64-g++
|
||||
SFLAGS = -D_USE_MATH_DEFINES
|
||||
LDFLAGS = -static -mwindows
|
||||
EXE = exe
|
||||
@@ -1,5 +1,9 @@
|
||||
SFLAGS += -Iescher/include
|
||||
|
||||
ifeq ($(ESCHER_LOG_EVENTS),1)
|
||||
SFLAGS += -DESCHER_LOG_EVENTS=1
|
||||
endif
|
||||
|
||||
objs += $(addprefix escher/src/,\
|
||||
alternate_empty_view_controller.o\
|
||||
app.o\
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
SFLAGS += -Iliba/include
|
||||
|
||||
ifeq ($(LIBA_LOG_DYNAMIC_MEMORY),1)
|
||||
SFLAGS += -DLIBA_LOG_DYNAMIC_MEMORY=1
|
||||
endif
|
||||
|
||||
liba/src/external/sqlite/mem5.o: CFLAGS += -w
|
||||
|
||||
objs += $(addprefix liba/src/, \
|
||||
|
||||
Reference in New Issue
Block a user