switch build system to rscons v2.0.0
This commit is contained in:
parent
b4d5de0910
commit
b5e4655f03
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,7 +1,5 @@
|
|||||||
*.dep
|
|
||||||
fart
|
fart
|
||||||
*.bmp
|
*.bmp
|
||||||
*.png
|
*.png
|
||||||
parser/parser.tab.cc
|
/.rscons*
|
||||||
parser/parser.tab.hh
|
/build/
|
||||||
parser/lex.yy.cc
|
|
||||||
|
11
Makefile
11
Makefile
@ -1,10 +1,7 @@
|
|||||||
export SCONSFLAGS := -Q
|
.PHONY: all
|
||||||
|
|
||||||
all:
|
all:
|
||||||
@scons
|
@./rscons
|
||||||
|
|
||||||
install:
|
|
||||||
@scons $@
|
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
@scons -c
|
@./rscons clean
|
||||||
|
24
Rakefile.rb
24
Rakefile.rb
@ -1,24 +0,0 @@
|
|||||||
require "rscons"
|
|
||||||
|
|
||||||
task :default do
|
|
||||||
Rscons::Environment.new do |env|
|
|
||||||
env.build_root = "build"
|
|
||||||
|
|
||||||
lexer_source = "#{env.build_root}/lex.yy.cc"
|
|
||||||
env.CFile(lexer_source, "parser/parser.ll")
|
|
||||||
|
|
||||||
parser_source = "#{env.build_root}/parser.tab.cc"
|
|
||||||
env.CFile(parser_source, "parser/parser.yy")
|
|
||||||
|
|
||||||
sources = Dir["{util,shapes,main,distrib,parser}/**/*.cc"]
|
|
||||||
sources << lexer_source
|
|
||||||
sources << parser_source
|
|
||||||
|
|
||||||
env["CXXFLAGS"] += ["-Wall", "-O2"]
|
|
||||||
env["CPPPATH"] += Dir["{util,shapes,main,distrib,parser}/**/"]
|
|
||||||
env["CPPPATH"] << "."
|
|
||||||
env["LIBS"] += ["fl", "pthread", "freeimage"]
|
|
||||||
|
|
||||||
env.Program("fart", sources)
|
|
||||||
end
|
|
||||||
end
|
|
21
Rsconscript
Normal file
21
Rsconscript
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
configure do
|
||||||
|
check_cxx_compiler
|
||||||
|
check_program "flex"
|
||||||
|
check_program "bison"
|
||||||
|
check_lib ":libfl.a"
|
||||||
|
check_lib "pthread"
|
||||||
|
check_lib "freeimage"
|
||||||
|
end
|
||||||
|
|
||||||
|
build do
|
||||||
|
Environment.new do |env|
|
||||||
|
subdirs = %w[util shapes main distrib parser]
|
||||||
|
env["CCFLAGS"] += %w[-Wall -O2]
|
||||||
|
env["CPPPATH"] += %w[.] + subdirs + ["#{env.build_root}/parser"]
|
||||||
|
sources = glob("{#{subdirs.join(",")}}/*.cc")
|
||||||
|
sources += ["^/parser/lexer.cc", "^/parser/parser.cc"]
|
||||||
|
env.CFile("^/parser/lexer.cc", "parser/parser.ll")
|
||||||
|
env.CFile("^/parser/parser.cc", "parser/parser.yy")
|
||||||
|
env.Program("fart", sources)
|
||||||
|
end
|
||||||
|
end
|
25
SConstruct
25
SConstruct
@ -1,25 +0,0 @@
|
|||||||
# vim:syntax=python
|
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
target = 'fart'
|
|
||||||
subdirs = ['util', 'shapes', 'main', 'distrib']
|
|
||||||
parser_sources = Glob('parser/*.cc')
|
|
||||||
sources = map(lambda x: Glob(x + '/*.cc'), subdirs)
|
|
||||||
lexer_source = 'parser/lex.yy.cc'
|
|
||||||
parser_source = 'parser/parser.tab.cc'
|
|
||||||
for f in parser_sources:
|
|
||||||
if str(f) != lexer_source and str(f) != parser_source:
|
|
||||||
sources.append(f)
|
|
||||||
sources += [lexer_source, parser_source]
|
|
||||||
|
|
||||||
env = Environment(CPPFLAGS = '-I.',
|
|
||||||
CXXFLAGS = '-Wall -O2',
|
|
||||||
YACCFLAGS = '-d',
|
|
||||||
LIBS = ['-lfl', '-lpthread', '-lfreeimage'])
|
|
||||||
|
|
||||||
lexer = env.CXXFile(lexer_source, 'parser/parser.ll')
|
|
||||||
parser = env.CXXFile(parser_source, 'parser/parser.yy')
|
|
||||||
env.Depends(lexer, parser_source)
|
|
||||||
|
|
||||||
env.Program(target, sources)
|
|
2
configure
vendored
Executable file
2
configure
vendored
Executable file
@ -0,0 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
exec ./rscons configure "$@"
|
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#include "nodes.h"
|
#include "nodes.h"
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
#include "parser.tab.hh"
|
#include "parser.hh"
|
||||||
|
|
||||||
#define YY_USER_ACTION yylloc->first_column += yyleng;
|
#define YY_USER_ACTION yylloc->first_column += yyleng;
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#include "util/Scope.h"
|
#include "util/Scope.h"
|
||||||
#include "nodes.h"
|
#include "nodes.h"
|
||||||
#include "parser.h"
|
#include "parser.h"
|
||||||
#include "parser.tab.hh" /* bison-generated header with YY[SL]TYPE */
|
#include "parser.hh" /* bison-generated header with YY[SL]TYPE */
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#define yyerror(msg) errFunc(msg, &yylloc)
|
#define yyerror(msg) errFunc(msg, &yylloc)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user