Compare commits
5 Commits
Author | SHA1 | Date | |
---|---|---|---|
deb16eeef7 | |||
49660f6835 | |||
3b90da8095 | |||
24b4b48555 | |||
b5e4655f03 |
7
.gitignore
vendored
7
.gitignore
vendored
@ -1,10 +1,5 @@
|
||||
*.dep
|
||||
fart
|
||||
*.bmp
|
||||
*.png
|
||||
parser/parser.tab.cc
|
||||
parser/parser.tab.hh
|
||||
parser/lex.yy.cc
|
||||
/.lock-waf*
|
||||
/.waf-*/
|
||||
/.rscons*
|
||||
/build/
|
||||
|
12
Makefile
12
Makefile
@ -1,11 +1,7 @@
|
||||
.PHONY: all
|
||||
all:
|
||||
@./waf build
|
||||
|
||||
install:
|
||||
@./waf install
|
||||
|
||||
distclean:
|
||||
@./waf distclean
|
||||
@./rscons
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@./waf clean
|
||||
@./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
|
||||
|
||||
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
2
configure
vendored
@ -1,2 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec ./waf configure
|
||||
exec ./rscons configure "$@"
|
||||
|
0
main/PointLight.cc → src/main/PointLight.cc
Executable file → Normal file
0
main/PointLight.cc → src/main/PointLight.cc
Executable file → Normal file
@ -8,7 +8,7 @@
|
||||
|
||||
#include "nodes.h"
|
||||
#include "parser.h"
|
||||
#include "parser.tab.h"
|
||||
#include "parser.hh"
|
||||
|
||||
#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.h" /* bison-generated header with YY[SL]TYPE */
|
||||
#include "parser.hh" /* bison-generated header with YY[SL]TYPE */
|
||||
using namespace std;
|
||||
|
||||
#define yyerror(msg) errFunc(msg, &yylloc)
|
||||
@ -29,9 +29,9 @@ refptr<Scope> parser_scope;
|
||||
|
||||
%}
|
||||
|
||||
%pure-parser
|
||||
%define api.pure
|
||||
%locations
|
||||
%error-verbose
|
||||
%define parse.error verbose
|
||||
|
||||
%token PLUS;
|
||||
%token MINUS;
|
0
shapes/Shape.cc → src/shapes/Shape.cc
Executable file → Normal file
0
shapes/Shape.cc → src/shapes/Shape.cc
Executable file → Normal file
22
wscript
22
wscript
@ -1,22 +0,0 @@
|
||||
#!/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