diff --git a/BUILD b/BUILD new file mode 100644 index 0000000..38d9931 --- /dev/null +++ b/BUILD @@ -0,0 +1,19 @@ +# Copyright 2023 Bradley D. Nelson +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +Include('posix') +Include('windows') +Include('web') +Include('pico-ice') +Include('esp32') diff --git a/esp32/BUILD b/esp32/BUILD new file mode 100644 index 0000000..a23f11e --- /dev/null +++ b/esp32/BUILD @@ -0,0 +1,37 @@ +# Copyright 2023 Bradley D. Nelson +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +Importation('esp32/ESP32forth/ESP32forth.ino', + '$src/esp32/ESP32forth.ino', + implicit=['gen/esp32_boot.h'], keep=True) +Importation('gen/esp32_boot.h', '$src/esp32/esp32_boot.fs', name='boot') +Importation('esp32/ESP32forth/README.txt', + '$src/esp32/README.txt') +Importation('esp32/ESP32forth/optional/README-optional.txt', + '$src/esp32/optional/README-optional.txt') +Esp32Optional('rmt', '$src/esp32/optional/rmt.h', []) +Esp32Optional('assemblers', '$src/esp32/optional/assemblers/assemblers.h', + [('assembler', '$src/common/assembler.fs'), + ('xtensa-assembler', '$src/esp32/optional/assemblers/xtensa-assembler.fs'), + ('riscv-assembler', '$src/esp32/optional/assemblers/riscv-assembler.fs')]) +Esp32Optional('camera', '$src/esp32/optional/camera/camera.h', + [('camera', '$src/esp32/optional/camera/camera_server.fs')]) +Esp32Optional('interrupts', '$src/esp32/optional/interrupts/interrupts.h', + [('interrupts', '$src/esp32/optional/interrupts/timers.fs')]) +Esp32Optional('oled', '$src/esp32/optional/oled/oled.h', + [('oled', '$src/esp32/optional/oled/oled.fs')]) +Esp32Optional('spi-flash', '$src/esp32/optional/spi-flash/spi-flash.h', + [('spi-flash', '$src/esp32/optional/spi-flash/spi-flash.fs')]) +Esp32Optional('serial-bluetooth', '$src/esp32/optional/serial-bluetooth/serial-bluetooth.h', + [('serial-bluetooth', '$src/esp32/optional/serial-bluetooth/serial-bluetooth.fs')]) diff --git a/pico-ice/BUILD b/pico-ice/BUILD new file mode 100644 index 0000000..8e6d016 --- /dev/null +++ b/pico-ice/BUILD @@ -0,0 +1,15 @@ +# Copyright 2023 Bradley D. Nelson +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +Importation('gen/pico_ice_boot.h', '$src/pico-ice/pico_ice_boot.fs', name='boot') diff --git a/posix/BUILD b/posix/BUILD new file mode 100644 index 0000000..826f8a4 --- /dev/null +++ b/posix/BUILD @@ -0,0 +1,17 @@ +# Copyright 2023 Bradley D. Nelson +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +Importation('gen/posix_boot.h', '$src/posix/posix_boot.fs', name='boot') +Compile('posix/ueforth', '$src/posix/main.c', + implicit=['gen/posix_boot.h']) diff --git a/tools/configure.py b/tools/configure.py index e3388e7..a7d0146 100755 --- a/tools/configure.py +++ b/tools/configure.py @@ -21,6 +21,9 @@ VERSION = '7.0.7.16' STABLE_VERSION = '7.0.6.19' OLD_STABLE_VERSION = '7.0.5.4' +SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) +ROOT_DIR = os.path.dirname(SCRIPT_DIR) + REVISION = 'TODO' #REVISION=$(shell git rev-parse HEAD | head -c 20) #REVSHORT=$(shell echo $(REVISION) | head -c 7) @@ -155,37 +158,10 @@ def Compile(target, source, implicit=[]): output += f'build {target}: compile {source} | {outdir} {implicit}\n' -Importation('esp32/ESP32forth/ESP32forth.ino', - '$src/esp32/ESP32forth.ino', - implicit=['gen/esp32_boot.h'], keep=True) -Importation('gen/esp32_boot.h', '$src/esp32/esp32_boot.fs', name='boot') -Importation('esp32/ESP32forth/README.txt', - '$src/esp32/README.txt') -Importation('esp32/ESP32forth/optional/README-optional.txt', - '$src/esp32/optional/README-optional.txt') -Esp32Optional('rmt', '$src/esp32/optional/rmt.h', []) -Esp32Optional('assemblers', '$src/esp32/optional/assemblers/assemblers.h', - [('assembler', '$src/common/assembler.fs'), - ('xtensa-assembler', '$src/esp32/optional/assemblers/xtensa-assembler.fs'), - ('riscv-assembler', '$src/esp32/optional/assemblers/riscv-assembler.fs')]) -Esp32Optional('camera', '$src/esp32/optional/camera/camera.h', - [('camera', '$src/esp32/optional/camera/camera_server.fs')]) -Esp32Optional('interrupts', '$src/esp32/optional/interrupts/interrupts.h', - [('interrupts', '$src/esp32/optional/interrupts/timers.fs')]) -Esp32Optional('oled', '$src/esp32/optional/oled/oled.h', - [('oled', '$src/esp32/optional/oled/oled.fs')]) -Esp32Optional('spi-flash', '$src/esp32/optional/spi-flash/spi-flash.h', - [('spi-flash', '$src/esp32/optional/spi-flash/spi-flash.fs')]) -Esp32Optional('serial-bluetooth', '$src/esp32/optional/serial-bluetooth/serial-bluetooth.h', - [('serial-bluetooth', '$src/esp32/optional/serial-bluetooth/serial-bluetooth.fs')]) - -Importation('gen/posix_boot.h', '$src/posix/posix_boot.fs', name='boot') -Compile('posix/ueforth', '$src/posix/main.c', - implicit=['gen/posix_boot.h']) - -Importation('gen/window_boot.h', '$src/windows/windows_boot.fs', header_mode='win', name='boot') -Importation('gen/window_boot_extra.h', '$src/windows/windows_boot_extra.fs', header_mode='win', name='boot') -Importation('gen/pico_ice_boot.h', '$src/pico-ice/pico_ice_boot.fs', name='boot') -Importation('gen/web_boot.js', '$src/web/web_boot.fs', header_mode='web', name='boot') +def Include(path): + path = os.path.join(ROOT_DIR, path, 'BUILD') + data = open(path).read() + exec(data) +Include('.') print(output) diff --git a/web/BUILD b/web/BUILD new file mode 100644 index 0000000..b046b58 --- /dev/null +++ b/web/BUILD @@ -0,0 +1,15 @@ +# Copyright 2023 Bradley D. Nelson +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +Importation('gen/web_boot.js', '$src/web/web_boot.fs', header_mode='web', name='boot') diff --git a/windows/BUILD b/windows/BUILD new file mode 100644 index 0000000..f38de89 --- /dev/null +++ b/windows/BUILD @@ -0,0 +1,16 @@ +# Copyright 2023 Bradley D. Nelson +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +Importation('gen/windows_boot.h', '$src/windows/windows_boot.fs', header_mode='win', name='boot') +Importation('gen/windows_boot_extra.h', '$src/windows/windows_boot_extra.fs', header_mode='win', name='boot')