Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
dfd1861d7b |
3
.gitignore
vendored
3
.gitignore
vendored
@ -5,3 +5,6 @@ fart
|
||||
parser/parser.tab.cc
|
||||
parser/parser.tab.hh
|
||||
parser/lex.yy.cc
|
||||
/.lock-waf*
|
||||
/.waf-*/
|
||||
/build/
|
||||
|
11
Makefile
11
Makefile
@ -1,10 +1,11 @@
|
||||
export SCONSFLAGS := -Q
|
||||
|
||||
all:
|
||||
@scons
|
||||
@./waf build
|
||||
|
||||
install:
|
||||
@scons $@
|
||||
@./waf install
|
||||
|
||||
distclean:
|
||||
@./waf distclean
|
||||
|
||||
clean:
|
||||
@scons -c
|
||||
@./waf clean
|
||||
|
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)
|
@ -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;
|
||||
|
@ -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
169
waf
vendored
Executable file
File diff suppressed because one or more lines are too long
22
wscript
Normal file
22
wscript
Normal 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"])
|
Loading…
x
Reference in New Issue
Block a user