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
8 changed files with 204 additions and 32 deletions

3
.gitignore vendored
View File

@ -5,3 +5,6 @@ fart
parser/parser.tab.cc
parser/parser.tab.hh
parser/lex.yy.cc
/.lock-waf*
/.waf-*/
/build/

View File

@ -1,10 +1,11 @@
export SCONSFLAGS := -Q
all:
@scons
@./waf build
install:
@scons $@
@./waf install
distclean:
@./waf distclean
clean:
@scons -c
@./waf clean

View File

@ -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
View File

@ -0,0 +1,2 @@
#!/bin/sh
exec ./waf configure

View File

@ -8,7 +8,7 @@
#include "nodes.h"
#include "parser.h"
#include "parser.tab.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.tab.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)

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"])