diff --git a/Rsconscript b/Rsconscript index 068fa23..7fdfeea 100644 --- a/Rsconscript +++ b/Rsconscript @@ -9,13 +9,15 @@ 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") + 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.CFile("^/parser/lexer.cc", "parser/parser.ll") - env.CFile("^/parser/parser.cc", "parser/parser.yy") env.Program("fart", sources) end end diff --git a/distrib/distrib.cc b/src/distrib/distrib.cc similarity index 100% rename from distrib/distrib.cc rename to src/distrib/distrib.cc diff --git a/distrib/distrib.h b/src/distrib/distrib.h similarity index 100% rename from distrib/distrib.h rename to src/distrib/distrib.h diff --git a/main/BMP.cc b/src/main/BMP.cc similarity index 100% rename from main/BMP.cc rename to src/main/BMP.cc diff --git a/main/BMP.h b/src/main/BMP.h similarity index 100% rename from main/BMP.h rename to src/main/BMP.h diff --git a/main/Light.cc b/src/main/Light.cc similarity index 100% rename from main/Light.cc rename to src/main/Light.cc diff --git a/main/Light.h b/src/main/Light.h similarity index 100% rename from main/Light.h rename to src/main/Light.h diff --git a/main/PointLight.cc b/src/main/PointLight.cc old mode 100755 new mode 100644 similarity index 100% rename from main/PointLight.cc rename to src/main/PointLight.cc diff --git a/main/PointLight.h b/src/main/PointLight.h similarity index 100% rename from main/PointLight.h rename to src/main/PointLight.h diff --git a/main/Scene-load.cc b/src/main/Scene-load.cc similarity index 100% rename from main/Scene-load.cc rename to src/main/Scene-load.cc diff --git a/main/Scene.cc b/src/main/Scene.cc similarity index 100% rename from main/Scene.cc rename to src/main/Scene.cc diff --git a/main/Scene.h b/src/main/Scene.h similarity index 100% rename from main/Scene.h rename to src/main/Scene.h diff --git a/main/fart.cc b/src/main/fart.cc similarity index 100% rename from main/fart.cc rename to src/main/fart.cc diff --git a/parser/nodes.cc b/src/parser/nodes.cc similarity index 100% rename from parser/nodes.cc rename to src/parser/nodes.cc diff --git a/parser/nodes.h b/src/parser/nodes.h similarity index 100% rename from parser/nodes.h rename to src/parser/nodes.h diff --git a/parser/parser.h b/src/parser/parser.h similarity index 100% rename from parser/parser.h rename to src/parser/parser.h diff --git a/parser/parser.ll b/src/parser/parser.ll similarity index 100% rename from parser/parser.ll rename to src/parser/parser.ll diff --git a/parser/parser.yy b/src/parser/parser.yy similarity index 100% rename from parser/parser.yy rename to src/parser/parser.yy diff --git a/parser/preparser.cc b/src/parser/preparser.cc similarity index 100% rename from parser/preparser.cc rename to src/parser/preparser.cc diff --git a/shapes/BoolShape.cc b/src/shapes/BoolShape.cc similarity index 100% rename from shapes/BoolShape.cc rename to src/shapes/BoolShape.cc diff --git a/shapes/BoolShape.h b/src/shapes/BoolShape.h similarity index 100% rename from shapes/BoolShape.h rename to src/shapes/BoolShape.h diff --git a/shapes/Box.cc b/src/shapes/Box.cc similarity index 100% rename from shapes/Box.cc rename to src/shapes/Box.cc diff --git a/shapes/Box.h b/src/shapes/Box.h similarity index 100% rename from shapes/Box.h rename to src/shapes/Box.h diff --git a/shapes/Cyl.cc b/src/shapes/Cyl.cc similarity index 100% rename from shapes/Cyl.cc rename to src/shapes/Cyl.cc diff --git a/shapes/Cyl.h b/src/shapes/Cyl.h similarity index 100% rename from shapes/Cyl.h rename to src/shapes/Cyl.h diff --git a/shapes/Extrude.cc b/src/shapes/Extrude.cc similarity index 100% rename from shapes/Extrude.cc rename to src/shapes/Extrude.cc diff --git a/shapes/Extrude.h b/src/shapes/Extrude.h similarity index 100% rename from shapes/Extrude.h rename to src/shapes/Extrude.h diff --git a/shapes/Intersect.cc b/src/shapes/Intersect.cc similarity index 100% rename from shapes/Intersect.cc rename to src/shapes/Intersect.cc diff --git a/shapes/Intersect.h b/src/shapes/Intersect.h similarity index 100% rename from shapes/Intersect.h rename to src/shapes/Intersect.h diff --git a/shapes/Plane.cc b/src/shapes/Plane.cc similarity index 100% rename from shapes/Plane.cc rename to src/shapes/Plane.cc diff --git a/shapes/Plane.h b/src/shapes/Plane.h similarity index 100% rename from shapes/Plane.h rename to src/shapes/Plane.h diff --git a/shapes/Shape.cc b/src/shapes/Shape.cc old mode 100755 new mode 100644 similarity index 100% rename from shapes/Shape.cc rename to src/shapes/Shape.cc diff --git a/shapes/Shape.h b/src/shapes/Shape.h similarity index 100% rename from shapes/Shape.h rename to src/shapes/Shape.h diff --git a/shapes/Sphere.cc b/src/shapes/Sphere.cc similarity index 100% rename from shapes/Sphere.cc rename to src/shapes/Sphere.cc diff --git a/shapes/Sphere.h b/src/shapes/Sphere.h similarity index 100% rename from shapes/Sphere.h rename to src/shapes/Sphere.h diff --git a/shapes/Subtract.cc b/src/shapes/Subtract.cc similarity index 100% rename from shapes/Subtract.cc rename to src/shapes/Subtract.cc diff --git a/shapes/Subtract.h b/src/shapes/Subtract.h similarity index 100% rename from shapes/Subtract.h rename to src/shapes/Subtract.h diff --git a/shapes/Union.cc b/src/shapes/Union.cc similarity index 100% rename from shapes/Union.cc rename to src/shapes/Union.cc diff --git a/shapes/Union.h b/src/shapes/Union.h similarity index 100% rename from shapes/Union.h rename to src/shapes/Union.h diff --git a/shapes/shapes.h b/src/shapes/shapes.h similarity index 100% rename from shapes/shapes.h rename to src/shapes/shapes.h diff --git a/util/AABB.h b/src/util/AABB.h similarity index 100% rename from util/AABB.h rename to src/util/AABB.h diff --git a/util/Color.cc b/src/util/Color.cc similarity index 100% rename from util/Color.cc rename to src/util/Color.cc diff --git a/util/Color.h b/src/util/Color.h similarity index 100% rename from util/Color.h rename to src/util/Color.h diff --git a/util/Material.h b/src/util/Material.h similarity index 100% rename from util/Material.h rename to src/util/Material.h diff --git a/util/Matrix.cc b/src/util/Matrix.cc similarity index 100% rename from util/Matrix.cc rename to src/util/Matrix.cc diff --git a/util/Matrix.h b/src/util/Matrix.h similarity index 100% rename from util/Matrix.h rename to src/util/Matrix.h diff --git a/util/Polygon.cc b/src/util/Polygon.cc similarity index 100% rename from util/Polygon.cc rename to src/util/Polygon.cc diff --git a/util/Polygon.h b/src/util/Polygon.h similarity index 100% rename from util/Polygon.h rename to src/util/Polygon.h diff --git a/util/Ray.cc b/src/util/Ray.cc similarity index 100% rename from util/Ray.cc rename to src/util/Ray.cc diff --git a/util/Ray.h b/src/util/Ray.h similarity index 100% rename from util/Ray.h rename to src/util/Ray.h diff --git a/util/Scope.h b/src/util/Scope.h similarity index 100% rename from util/Scope.h rename to src/util/Scope.h diff --git a/util/Solver.cc b/src/util/Solver.cc similarity index 100% rename from util/Solver.cc rename to src/util/Solver.cc diff --git a/util/Solver.h b/src/util/Solver.h similarity index 100% rename from util/Solver.h rename to src/util/Solver.h diff --git a/util/Transform.cc b/src/util/Transform.cc similarity index 100% rename from util/Transform.cc rename to src/util/Transform.cc diff --git a/util/Transform.h b/src/util/Transform.h similarity index 100% rename from util/Transform.h rename to src/util/Transform.h diff --git a/util/Vector.cc b/src/util/Vector.cc similarity index 100% rename from util/Vector.cc rename to src/util/Vector.cc diff --git a/util/Vector.h b/src/util/Vector.h similarity index 100% rename from util/Vector.h rename to src/util/Vector.h diff --git a/util/refptr.h b/src/util/refptr.h similarity index 100% rename from util/refptr.h rename to src/util/refptr.h