Compare commits

..

1 Commits
master ... waf

Author SHA1 Message Date
dfd1861d7b change build system from SCons to Waf 2015-09-26 10:26:14 -04:00
65 changed files with 234 additions and 77 deletions

7
.gitignore vendored
View File

@ -1,5 +1,10 @@
*.dep
fart
*.bmp
*.png
/.rscons*
parser/parser.tab.cc
parser/parser.tab.hh
parser/lex.yy.cc
/.lock-waf*
/.waf-*/
/build/

View File

@ -1,7 +1,11 @@
.PHONY: all
all:
@./rscons
@./waf build
install:
@./waf install
distclean:
@./waf distclean
.PHONY: clean
clean:
@./rscons clean
@./waf clean

24
Rakefile.rb Normal file
View File

@ -0,0 +1,24 @@
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

View File

@ -1,21 +0,0 @@
configure do
check_cxx_compiler
check_program "flex"
check_program "bison"
check_lib ":libfl.a"
check_lib "pthread"
check_lib "freeimage"
end
env do |env|
env["CCFLAGS"] += %w[-Wall -O2]
env["CPPPATH"] += glob("src/**")
env.CFile("^/parser/lexer.cc", "src/parser/parser.ll")
env.CFile("^/parser/parser.cc", "src/parser/parser.yy")
env["CPPPATH"] += ["#{env.build_root}/parser"]
sources = glob("src/**/*.cc")
sources += ["^/parser/lexer.cc", "^/parser/parser.cc"]
env.Program("fart", sources)
end

2
configure vendored
View File

@ -1,2 +1,2 @@
#!/bin/sh
exec ./rscons configure "$@"
exec ./waf configure

0
src/main/PointLight.cc → main/PointLight.cc Normal file → Executable file
View File

View File

@ -8,7 +8,7 @@
#include "nodes.h"
#include "parser.h"
#include "parser.hh"
#include "parser.tab.h"
#define YY_USER_ACTION yylloc->first_column += yyleng;

View File

@ -8,7 +8,7 @@
#include "util/Scope.h"
#include "nodes.h"
#include "parser.h"
#include "parser.hh" /* bison-generated header with YY[SL]TYPE */
#include "parser.tab.h" /* bison-generated header with YY[SL]TYPE */
using namespace std;
#define yyerror(msg) errFunc(msg, &yylloc)
@ -29,9 +29,9 @@ refptr<Scope> parser_scope;
%}
%define api.pure
%pure-parser
%locations
%define parse.error verbose
%error-verbose
%token PLUS;
%token MINUS;

46
rscons

File diff suppressed because one or more lines are too long

0
src/shapes/Shape.cc → shapes/Shape.cc Normal file → Executable file
View File

169
waf vendored Executable file

File diff suppressed because one or more lines are too long

22
wscript Normal file
View File

@ -0,0 +1,22 @@
#!/usr/bin/env python
def options(opt):
opt.load("compiler_cxx")
def configure(conf):
conf.load("compiler_cxx flex bison")
def build(bld):
subdirs = ["util", "shapes", "main", "distrib", "parser"]
sources = []
for s in subdirs:
sources += bld.path.ant_glob("%s/*.cc" % s)
lexer_source = "parser/parser.l"
parser_source = "parser/parser.yy"
sources += [lexer_source, parser_source]
bld.program(
source = sources,
cxxflags = ["-Wall", "-O2"],
target = "fart",
includes = subdirs + ["."],
lib = ["fl", "pthread", "freeimage"])