Skip to content

Instantly share code, notes, and snippets.

@AbigailBuccaneer
Created February 24, 2016 15:16
Show Gist options
  • Save AbigailBuccaneer/ab319aa6190db8df38c8 to your computer and use it in GitHub Desktop.
Save AbigailBuccaneer/ab319aa6190db8df38c8 to your computer and use it in GitHub Desktop.
env = Environment()
program = env.Program('foo', 'foo.c', LIBS=['foo'], LIBPATH='.')
env = Environment()
env.Library('foo', 'libfoo.c')
SConscript('SConscript')
$ scons --tree=all
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o foo.o -c foo.c
gcc -o libfoo.o -c libfoo.c
ar rc libfoo.a libfoo.o
ranlib libfoo.a
gcc -o foo foo.o -L. -lfoo
+-.
+-SConscript
+-SConstruct
+-foo
| +-foo.o
| | +-foo.c
| | +-/usr/bin/gcc
| +-/usr/bin/gcc
| +-libfoo.a
| +-libfoo.o
| | +-libfoo.c
| | +-/usr/bin/gcc
| +-/usr/bin/ar
| +-/usr/bin/ranlib
+-foo.c
+-foo.o
| +-foo.c
| +-/usr/bin/gcc
+-libfoo.a
| +-libfoo.o
| | +-libfoo.c
| | +-/usr/bin/gcc
| +-/usr/bin/ar
| +-/usr/bin/ranlib
+-libfoo.c
+-libfoo.o
+-libfoo.c
+-/usr/bin/gcc
scons: done building targets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment