Permalink
Browse files

Clean up build instructions, add a simple 'make' script

  • Loading branch information...
paulhodge committed Dec 23, 2011
1 parent 8ddc460 commit ed3a3f4c2ebd1ad767e323038947d7daacafe826
Showing with 106 additions and 104 deletions.
  1. +35 −10 README
  2. +12 −24 SConstruct
  3. +0 −10 build.config
  4. +40 −47 docs/building.md
  5. +4 −2 looseleaf/README
  6. +9 −0 make
  7. +0 −7 my_test_script.ca
  8. +0 −4 plastic/ABOUT
  9. +6 −0 plastic/README
View
45 README
@@ -1,23 +1,25 @@
-Circa is a programming language designed for live coding. Most programming languages try
-to improve *what* you can express, with Circa we instead try to improve the process by
-which code is created.
+Introduction
+============
-Some features of Circa are:
+Circa is a programming language designed for live coding. Most programming languages try to
+improve *what* you can express, with Circa we instead try to improve *how* you create code.
+
+Features
+========
- Live coding. Has a rich API for examining or modifying code at runtime.
- State is preserved across most code changes.
- - Supports live code changes made by external tools (such as separate text editors), as
- well as changes made within the system.
+ - Supports live code changes made by external tools (such as separate text editors), as well
+ as changes made within the system.
- Code is stored in a (relatively) simple format, allowing for easy introspection and
static reasoning.
- Visual programming is supported.
- Compiled code can be unparsed back to text, with all comments and formatting preserved.
This allows for a hybrid approach of textual and visual code editing.
-This project is currently alpha-level. Curious people, or people interested in hacking along,
-are welcome to try it out. People who want to use it for serious projects, or people who don't
-like bugs, are recommended to wait for a beta release.
+Implementation
+==============
Some implementation details:
@@ -28,7 +30,30 @@ Some implementation details:
- Interpreted execution. (an LLVM backend is planned for the future)
- Currently supported on XP and OSX. A Linux port would probably not be hard.
-For more information, see the /docs folder.
+Current status
+==============
+
+This project is currently alpha-level. Curious people, or people interested in hacking along,
+are welcome to try it out. People who want to use it for serious projects, or people who don't
+like bugs, are recommended to wait for a beta release.
+
+Building
+========
+
+Instructions for building on a Unixy system. For building on Windows, see docs/building.md .
+
+Make sure you have Python, Scons, and a C++ compiler installed.
+
+From the project's root directory, run:
+
+./make
+
+which will produce a binary at build/circa
+
+Documentation
+=============
+
+Refer to the /docs folder.
Unless otherwise specified, the contents of this project are freely available to the
public under the MIT licence. See the LICENSE file for more information.
View
@@ -9,10 +9,6 @@ def fatal(msg):
print "fatal:",msg
exit(1)
-# Load build.config
-config = ConfigParser.ConfigParser()
-config.read('build.config')
-
POSIX = os.name == 'posix'
WINDOWS = os.name == 'nt'
@@ -24,23 +20,17 @@ OSX = os.path.exists('/Library/Frameworks')
DEBUG = Environment(tools = ["default"], toolpath=".",
variant_name = 'debug', variant_suffix='_d')
RELEASE = Environment(tools = ["default"], toolpath=".",
- variant_name = 'release', variant_suffix='_r')
+ variant_name = 'release', variant_suffix='')
TEST = Environment(tools = ["default"], toolpath=".",
variant_name = 'test', variant_suffix='_t')
all_envs = [DEBUG, RELEASE, TEST]
-SHARED_LIBRARY = config.get('circa', 'shared_library') == 'true'
-
# Build flags
if POSIX:
for env in all_envs:
env.Append(CPPFLAGS=['-ggdb', '-Wall'])
env.Append(LINKFLAGS=['-ldl'])
- if config.get('circa', 'gprof_support') == 'true':
- env.Append(CPPFLAGS=['-pg'])
- env.Append(LINKFLAGS=['-pg'])
-
env.SetOption('num_jobs', 2)
for env in [DEBUG,TEST]:
@@ -98,15 +88,13 @@ for env in all_envs:
fullPath = 'build/'+baseName
sources = ['build/'+variant_name+'/src/'+filename for filename in source_files]
- buildStep = env.SharedLibrary if SHARED_LIBRARY else env.StaticLibrary
-
- result = buildStep(fullPath, sources)
+ result = env.StaticLibrary(fullPath, sources)
circa_libs[variant_name] = result[0]
- if OSX and SHARED_LIBRARY:
- actualFile = 'lib'+baseName+'.dylib'
- env.AddPostAction(result, 'install_name_tool -id @executable_path/'+actualFile
- + ' build/'+actualFile)
+ #if OSX and SHARED_LIBRARY:
+ # actualFile = 'lib'+baseName+'.dylib'
+ # env.AddPostAction(result, 'install_name_tool -id @executable_path/'+actualFile
+ # + ' build/'+actualFile)
# Define command-line app builds at build/circa_x
circa_cl_apps = {}
@@ -122,12 +110,12 @@ for env in all_envs:
LIBS=libs)
circa_cl_apps[variant_name] = result
- if OSX and SHARED_LIBRARY:
- env.AddPostAction(result, 'install_name_tool -change build/libcirca_d.dylib '
- + '@executable_path/libcirca_d.dylib '+binaryFile)
-
-# Default build target is command-line binary that supports unit tests.
-Default(circa_cl_apps['test'])
+ #if OSX and SHARED_LIBRARY:
+ # env.AddPostAction(result, 'install_name_tool -change build/libcirca_d.dylib '
+ # + '@executable_path/libcirca_d.dylib '+binaryFile)
+
+# Default build target is release mode command-line app
+Default(circa_cl_apps['release'])
########################### Plastic ###############################
View
@@ -1,10 +0,0 @@
-[circa]
-# If shared_library is enabled, the Circa lib will be compiled as a shared object (an .so
-# or a .dll). This will allow other shared objects to use Circa functions and it might
-# have other effects too.
-shared_library = false
-
-# If gprof_support is enabled, we'll build and link with the -pg flags, which makes the
-# resulting binary spit out output for analysis by GNU grpof. This flag only has an
-# effect on linux and mac builds.
-gprof_support = false
View
@@ -1,48 +1,41 @@
-This project has two primary build targets:
-
-1. Circa command-line app
- - This tool can run scripts from a file or from an interactive REPL. It does not create
- a window and doesn't have support for graphics or sound. Has very few 3rd party dependencies.
-2. Plastic
- - This application creates a window, and supports graphics and sound and other fancy things.
- Has many 3rd party dependencies.
-
-# Building the command-line app #
-
- - First, install a C++ compiler as well as Python and SCons
- - Open a command prompt (sometimes called a Terminal) in the Circa directory, and then run the following commands:
- - python tools/prebuild.py
- - scons build/circa_t
- - build/circa_t (this will run Circa's unit tests)
-
- - This build has been tested on the following platforms:
- - Windows Vista (using Visual Studio 2005)
- - OSX 10.6 (with Xcode 3.2)
- - Ubuntu 10.04
-
-# Building Plastic #
-
- - Install the following dependencies with your package manager. (Windows instructions are coming soon)
- - box2d
- - liblo
- - SDL-devel
- - SDL_gfx
- - SDL_image
- - SDL_ttf
- - Follow the above instructions to build the command-line app
- - Open a command prompt and run:
- - scons build/plas_r
-
- - This build has only been tested on OSX 10.6 (with Xcode 3.2)
-
-# Build variants #
-
-Each target has three build variants:
- - 'Test' build (ends in _t). Has every assertion enabled, including checks that have a major performance penalty. Runs slowly, but is good for checking for correctness.
- - 'Debug' build (ends in _d). Has some assertions enabled, and includes debugging symbols. Faster than a 'test' build, and can be used in a debugger.
- - 'Release' build (ends in _r). Assertions are disabled. This is the fastest build.
-
-## Platform-specific instructions ##
-
-Instructions are coming sooner or later.
+Here are instructions for building circa.lib and 'circa' the command-line tool.
+
+(There are other binaries in this repo (such as "plastic" and "looseleaf"); instructions
+for building those can be found in their respective folders.)
+
+# Requirements #
+
+You'll need:
+ - A C++ compiler. Tested on GCC on Mac/Linux, and Visual Studio 2008 on Windows.
+ - Python
+ - Scons
+
+# Building #
+
+Open a command prompt in the project's root directory.
+
+For the first build, and every time a source file is added or removed, you'll need to run
+the prebuild.py script. Example:
+
+ python tools/prebuild.py
+
+Then, use "scons" to build the target that you want. For example, to build the command-line tool
+in test mode, run:
+
+ scons build/circa_t
+
+Available targets are:
+
+ - Command line tool (release variant): build/circa
+ - Command line tool (debug variant): build/circa_d
+ - Command line tool (test variant): build/circa_t
+ - Static library (releaase variant): build/circa.lib
+ - Static library (debug variant): build/circa_d.lib
+ - Static library (test variant): build/circa_t.lib
+
+# Variants #
+
+ - Test (ends in _t). Every assertion in the world is enabled. Unit tests are also included. The slowest option, but is good for checking for correctness.
+ - Debug (ends in _d). Some assertions enabled, and optimizations disabled. No unit tests.
+ - Release (no suffix). Assertions are disabled and optimizations enabled.
View
@@ -1,4 +1,6 @@
-looseleaf is a graphical app for running Circa scripts.
+Looseleaf is a graphical app for running Circa scripts.
-One distinguishing trait is that it uses Qt for all GUI widgets. (compared to Plastic which uses pure SDL). It's also newer than Plastic, so some of its habits are more up-to-date.
+It is build against Qt, and is built as a Qt project.
+
+Build instructions are not yet available.
View
9 make
@@ -0,0 +1,9 @@
+
+# A simple make script, good for one-time building of a release-mode tool.
+#
+# For repeated builds, you can omit the "prebuild.py" step.
+#
+# To build a debug variant, read docs/building.md
+
+python tools/prebuild.py
+scons
View
@@ -1,7 +0,0 @@
-
-def my_function(int a, int b) -> int
- print("adding " a " and " b)
- return a + b
-
-a = 2
-my_function(a, 3)
View
@@ -1,4 +0,0 @@
-
-Plastic is a game engine and prototyping tool that uses SDL.
-We load scripts written in Circa, expose SDL bindings to them, and
-take advantage of the Circa library for live manipulation of code.
View
@@ -0,0 +1,6 @@
+
+Plastic is a game engine and prototyping tool that runs Circa scripts using
+SDL.
+
+This was the first shell for Circa but it's currently deprecated, and being
+replaced by the Looseleaf tool.

0 comments on commit ed3a3f4

Please sign in to comment.