mirror of
https://github.com/tailix/mrubyvisor.git
synced 2026-09-26 09:23:39 -04:00
Build vendored dependencies
This commit is contained in:
parent
4c223012a8
commit
22d983f1fe
4 changed files with 63 additions and 0 deletions
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
/build_config.rb.lock
|
||||||
|
|
||||||
|
/dest/*
|
||||||
|
!/dest/.keep
|
||||||
33
Makefile
Normal file
33
Makefile
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
.PHONY: clean
|
||||||
|
|
||||||
|
CCPREFIX = /home/kotovalexarian/repos/global/tailix/cross/root/bin/x86_64-elf-
|
||||||
|
|
||||||
|
AR = $(CCPREFIX)ar
|
||||||
|
AS = $(CCPREFIX)as
|
||||||
|
CC = $(CCPREFIX)gcc
|
||||||
|
LD = $(CCPREFIX)ld
|
||||||
|
RANLIB = $(CCPREFIX)ranlib
|
||||||
|
|
||||||
|
RAKE = rake
|
||||||
|
|
||||||
|
ROOT = $(shell pwd)
|
||||||
|
DEST = $(ROOT)/dest
|
||||||
|
MRUBY_CONFIG = $(ROOT)/build_config.rb
|
||||||
|
|
||||||
|
MRUBY_NAME = mrubyvisor
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(DEST)/*
|
||||||
|
|
||||||
|
dest/lib/libkernaux.a:
|
||||||
|
cd vendor/libkernaux && ./autogen.sh
|
||||||
|
cd vendor/libkernaux && ./configure --host='x86_64-elf' --prefix='$(DEST)' --enable-freestanding --with-drivers --with-libc AR='$(AR)' AS='$(AS)' CC='$(CC)' LD='$(LD)' RANLIB='$(RANLIB)'
|
||||||
|
cd vendor/libkernaux && make
|
||||||
|
cd vendor/libkernaux && make install
|
||||||
|
|
||||||
|
dest/lib/libmruby.a: dest/lib/libkernaux.a
|
||||||
|
cd vendor/mruby && $(RAKE) MRUBY_CONFIG='$(MRUBY_CONFIG)' CROSS_AR='$(AR)' CROSS_CC='$(CC)' CROSS_LD='$(LD)'
|
||||||
|
mkdir -p $(DEST)/include $(DEST)/lib
|
||||||
|
cp vendor/mruby/build/$(MRUBY_NAME)/lib/libmruby.a $(DEST)/lib
|
||||||
|
cp -r vendor/mruby/include/* $(DEST)/include
|
||||||
|
cp -r vendor/mruby/build/$(MRUBY_NAME)/include/* $(DEST)/include
|
||||||
26
build_config.rb
Normal file
26
build_config.rb
Normal file
|
|
@ -0,0 +1,26 @@
|
||||||
|
ROOT_DIR = File.expand_path(__dir__).freeze
|
||||||
|
DEST_DIR = File.join(ROOT_DIR, 'dest').freeze
|
||||||
|
|
||||||
|
MRuby::CrossBuild.new 'mrubyvisor' do |conf|
|
||||||
|
conf.toolchain :gcc
|
||||||
|
|
||||||
|
conf.cc.defines <<
|
||||||
|
'MRB_NO_BOXING' <<
|
||||||
|
'MRB_NO_FLOAT' <<
|
||||||
|
'MRB_NO_STDIO'
|
||||||
|
|
||||||
|
conf.cc.flags <<
|
||||||
|
'-Wall' <<
|
||||||
|
'-Wextra' <<
|
||||||
|
'-ffreestanding' <<
|
||||||
|
'-nostdlib' <<
|
||||||
|
'-fno-pic' <<
|
||||||
|
'-fno-stack-protector'
|
||||||
|
|
||||||
|
conf.cc.include_paths << File.join(DEST_DIR, 'include')
|
||||||
|
conf.linker.library_paths << File.join(DEST_DIR, 'lib')
|
||||||
|
|
||||||
|
conf.archiver.command = ENV['CROSS_AR']
|
||||||
|
conf.cc.command = ENV['CROSS_CC']
|
||||||
|
conf.linker.command = ENV['CROSS_LD']
|
||||||
|
end
|
||||||
0
dest/.keep
Normal file
0
dest/.keep
Normal file
Loading…
Add table
Add a link
Reference in a new issue