Skip to content

Commit

Permalink
Restructure SCons build scripts. Introducing new SCons configuration …
Browse files Browse the repository at this point in the history
…in conf/. Replacing Prepare().
  • Loading branch information
nieklinnenbank committed Jan 19, 2015
1 parent c9c59d9 commit 3f7625f
Show file tree
Hide file tree
Showing 59 changed files with 939 additions and 1,152 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ config.log
boot/boot.*
host/
include/FreeNOS
.gdbinit
57 changes: 40 additions & 17 deletions SConstruct
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2009 Niek Linnenbank
#
# Copyright (C) 2010 Niek Linnenbank
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand All @@ -10,31 +10,54 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

import build
import version
import linn
import img
import pci
import iso
import emulate
import dist
from build import *
from version import *
from archive import *
from gdbinit import *

#
# Update versioning header file.
# Target build
#
version.regenerateHeader()
build_env = target
Export('build_env')

# Build programs, libraries and servers.
VariantDir(target['BUILDROOT'] + '/lib', '#lib', duplicate = 0)
VariantDir(target['BUILDROOT'] + '/bin', '#bin', duplicate = 0)
VariantDir(target['BUILDROOT'] + '/server', '#server', duplicate = 0)
VariantDir(target['BUILDROOT'] + '/regress', '#regress', duplicate = 0)
SConscript(target['BUILDROOT'] + '/lib/SConscript')
SConscript(target['BUILDROOT'] + '/bin/SConscript')
SConscript(target['BUILDROOT'] + '/server/SConscript')
SConscript(target['BUILDROOT'] + '/regress/SConscript')

#
# Process subscripts.
# Host build
#
SConscript(dirs = ['lib', 'kernel', 'bin', 'sbin', 'srv'])
build_env = host
Export('build_env')

# Build programs and libraries.
VariantDir(host['BUILDROOT'] + '/lib', '#lib', duplicate = 0)
VariantDir(host['BUILDROOT'] + '/bin', '#bin', duplicate = 0)
VariantDir(host['BUILDROOT'] + '/regress', '#regress', duplicate = 0)
SConscript(host['BUILDROOT'] + '/lib/SConscript')
SConscript(host['BUILDROOT'] + '/bin/SConscript')
SConscript(host['BUILDROOT'] + '/regress/SConscript')

#
# Per default, build libraries, kernel and user programs.
# Kernel build
#
Default(['lib', 'kernel', 'bin', 'sbin', 'srv', 'etc'])
build_env = kernel
Export('build_env')

# Build the kernel.
VariantDir(kernel['BUILDROOT'] + '/kernel',
'#kernel/' + kernel['ARCH'] + '/' + kernel['SYSTEM'], duplicate = 0)
SConscript(kernel['BUILDROOT'] + '/kernel/SConscript')

2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.5
0.1.0
16 changes: 8 additions & 8 deletions bin/bench/SConscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2009 Niek Linnenbank
#
# Copyright (C) 2010 Niek Linnenbank
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand All @@ -10,14 +10,14 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from build import *
Import('build_env')

env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ],
[ 'memory' ])
env.Program('bench', [ 'Main.cpp' ],
LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
env = build_env.Clone()
env.UseLibraries([ 'libposix', 'libc', 'liballoc', 'libcrt', 'libexec' ])
env.UseServers(['memory'])
env.TargetProgram('bench', 'Main.cpp')
13 changes: 7 additions & 6 deletions bin/cat/SConscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2009 Niek Linnenbank
#
# Copyright (C) 2010 Niek Linnenbank
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand All @@ -10,12 +10,13 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from build import *
Import('build_env')

env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ])
env.Program('cat', [ 'Main.cpp' ], LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
env = build_env.Clone()
env.UseLibraries([ 'libcrt', 'libposix', 'libc', 'libexec', 'liballoc' ])
env.TargetProgram('cat', 'Main.cpp')
13 changes: 7 additions & 6 deletions bin/echo/SConscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2009 Niek Linnenbank
#
# Copyright (C) 2010 Niek Linnenbank
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand All @@ -10,12 +10,13 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from build import *
Import('build_env')

env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ])
env.Program('echo', [ 'Main.cpp' ], LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
env = build_env.Clone()
env.UseLibraries([ 'libcrt', 'libposix', 'libc', 'libexec', 'liballoc' ])
env.TargetProgram('echo', 'Main.cpp')
14 changes: 7 additions & 7 deletions bin/hostname/SConscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2009 Niek Linnenbank
#
# Copyright (C) 2010 Niek Linnenbank
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand All @@ -10,13 +10,13 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from build import *
Import('build_env')

env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ])
env.Program('hostname', [ 'Main.cpp' ],
LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
env = build_env.Clone()
env.UseLibraries([ 'libcrt', 'libposix', 'libc', 'libexec', 'liballoc' ])
env.TargetProgram('hostname', 'Main.cpp')
15 changes: 8 additions & 7 deletions bin/ls/SConscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2009 Niek Linnenbank
#
# Copyright (C) 2010 Niek Linnenbank
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand All @@ -10,13 +10,14 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from build import *
Import('build_env')

env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ],
[ 'terminal', 'filesystem' ])
env.Program('ls', [ 'Main.cpp' ], LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
env = build_env.Clone()
env.UseLibraries([ 'libcrt', 'libposix', 'libc', 'libexec', 'liballoc' ])
env.UseServers([ 'terminal', 'filesystem' ])
env.TargetProgram('ls', 'Main.cpp')
16 changes: 8 additions & 8 deletions bin/memstat/SConscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2009 Niek Linnenbank
#
# Copyright (C) 2010 Niek Linnenbank
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand All @@ -10,14 +10,14 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from build import *
Import('build_env')

env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ],
[ 'memory' ])
env.Program('memstat', [ 'Main.cpp' ],
LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
env = build_env.Clone()
env.UseLibraries([ 'libcrt', 'libposix', 'libc', 'libexec', 'liballoc' ])
env.UseServers([ 'memory' ])
env.TargetProgram('memstat', 'Main.cpp')
15 changes: 8 additions & 7 deletions bin/mknod/SConscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2009 Niek Linnenbank
#
# Copyright (C) 2010 Niek Linnenbank
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand All @@ -10,13 +10,14 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from build import *
Import('build_env')

env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ],
[ 'filesystem' ])
env.Program('mknod', [ 'Main.cpp' ], LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
env = build_env.Clone()
env.UseLibraries([ 'libcrt', 'libposix', 'libc', 'libexec', 'liballoc' ])
env.UseServers(['filesystem'])
env.TargetProgram('mknod', 'Main.cpp')
16 changes: 8 additions & 8 deletions bin/mount/SConscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2009 Niek Linnenbank
#
# Copyright (C) 2010 Niek Linnenbank
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand All @@ -10,14 +10,14 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from build import *
Import('build_env')

env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ],
[ 'filesystem', 'filesystem/virtual', 'memory', 'process' ])
env.Program('mount', [ 'Main.cpp' ],
LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
env = build_env.Clone()
env.UseLibraries([ 'libcrt', 'libposix', 'libc', 'libexec', 'liballoc' ])
env.UseServers(['filesystem', 'memory', 'process'])
env.TargetProgram('mount', 'Main.cpp')
26 changes: 7 additions & 19 deletions bin/parse/SConscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2009 Coen Bijlsma
#
# Copyright (C) 2010 Niek Linnenbank
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand All @@ -10,25 +10,13 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from build import *

#
# Target build
#
env = Prepare(target, [ 'libcrt', 'libexec', 'liballoc', 'libc', 'libposix', 'libparse' ] )

env.Program('parse', [ 'Main.cpp' ],
LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])

#
# Host build
#
env = Prepare(host, [ 'libparse' ] )
Import('build_env')

env.Program('host/parse', [ 'host/Main.cpp' ],
LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
env = build_env.Clone()
env.UseLibraries([ 'libcrt', 'libposix', 'libc', 'libexec', 'liballoc', 'libparse' ])
env.TargetProgram('parse', 'Main.cpp')
14 changes: 7 additions & 7 deletions bin/ps/SConscript
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2009 Niek Linnenbank
#
# Copyright (C) 2010 Niek Linnenbank
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
Expand All @@ -10,13 +10,13 @@
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#

from build import *
Import('build_env')

env = Prepare(target, [ 'libcrt', 'liballoc', 'libposix', 'libexec', 'libc' ])
env.Program('ps', [ 'Main.cpp' ],
LIBS = env['LIBS'], LIBPATH = env['LIBPATH'])
env = build_env.Clone()
env.UseLibraries([ 'libcrt', 'libposix', 'libc', 'libexec', 'liballoc' ])
env.TargetProgram('ps', 'Main.cpp')
Loading

0 comments on commit 3f7625f

Please sign in to comment.