diff --git a/.dockerignore b/.dockerignore index c546efa..5182418 100755 --- a/.dockerignore +++ b/.dockerignore @@ -1,9 +1,8 @@ .vscode/ docker_image/ -udev/ +config/udev/ scripts/docker-scripts/ scripts/wsl-usb-scripts/ *Project_Template/ .gitignore -install.sh nxtOSEK.code-workspace diff --git a/Dockerfile b/Dockerfile index a363287..e637625 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,69 +1,14 @@ -############################################################################################ -# STAGE 1: Compile NXT utilities (and dependencies) for this platform -############################################################################################ -#FROM ubuntu:14.04 AS stage1 -#ARG DEBIAN_FRONTEND=noninteractive - -# Install host compiler and prereqs -#RUN apt-get update \ -# && apt-get -y --no-install-recommends install \ -# apt-transport-https build-essential texinfo unzip \ -# libgmp-dev libmpfr-dev libppl-dev libcloog-ppl-dev \ -# tk-dev ncurses-dev wget gzip tar software-properties-common \ -# xvfb gcc-4.8 gdb gdb-multiarch vim scons python3 \ -# libc-dev make autoconf libtool libusb-dev - -# Copy source code for NXT tools -#ADD src /src -#WORKDIR /src - -# Build LibUSB -#RUN tar xf /src/libusb-0.1.12.tar \ -# && mkdir -p /build/libusb \ -# && cd /build/libusb \ -# && ls /src \ -# && /src/libusb-0.1.12/configure \ -# && make CFLAGS="-Wno-error" CXXFLAGS="-Wno-error" install -# make install - -# Build LibNXT -#RUN tar xf /src/libnxt-0.3.tar \ -# && cd /src/libnxt-0.3 \ -# && scons \ -# && chmod +x ./fwflash \ -# && chmod +x ./fwexec -## cp ./fwflash $TOOLDIR/fwflash -## cp ./fwexec $TOOLDIR/fwexec - -# Build NeXTTOOl -#RUN unzip /src/bricxcc-3.3.8.10.zip \ -# && cd /src/bricxcc-3.3.8.10 \ -# && make -f nexttool.mak \ -# && chmod +x ./nexttool -## cp ./nexttool $TOOLDIR/nexttool - -# Build modified LibNXT from the LeJOS-OSEK source code -#ADD nxtosek /nxtosek -#RUN cd /nxtosek/lejos_nxj/src/libnxt \ -## && scons - -############################################################################################ -# STAGE 2: Install NXTOSEK and dependencies -############################################################################################ -FROM ubuntu:20.04 AS stage2 +FROM ubuntu:20.04 ARG DEBIAN_FRONTEND=noninteractive -ARG USERNAME=nxtosek +ARG USERNAME=nxtuser ARG USER_UID=1000 ARG USER_GID=$USER_UID -ENV NXTOSEK=/home/$USERNAME -ENV NXT_TOOLS_DIR=/usr/local/bin +ARG NXT_TOOLS_DIR=/usr/local/bin +ENV NXTOSEK=/usr/local/src/nxtosek ENV DISPLAY=:0 ENV WINEARCH=win32 ENV WINEDLLOVERRIDES="mscoree,mshtml=" -# Load 3rd-party source code into image -ADD src /src - # Add new nxtosek user with sudo privileges and no password RUN groupadd -f --gid $USER_GID $USERNAME \ && useradd --create-home --uid $USER_UID --gid $USER_GID -m $USERNAME \ @@ -72,27 +17,30 @@ RUN groupadd -f --gid $USER_GID $USERNAME \ && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ && chmod 0440 /etc/sudoers.d/$USERNAME \ # Add user permissions for most USB devices \ - && usermod -aG plugdev nxtosek \ - && usermod -aG dialout nxtosek \ - && usermod -aG users nxtosek \ + && usermod -aG plugdev ${USERNAME} \ + && usermod -aG dialout ${USERNAME} \ + && usermod -aG users ${USERNAME} \ # Packages required to install more packages \ && apt-get -y install --no-install-recommends \ make vim wget gnupg software-properties-common \ -# Software required for building 3rd party tools \ +# Software required for running 3rd party tools \ && apt-get -y install --no-install-recommends \ - gcc g++ build-essential fpc libusb-0.1-4 libusb-dev scons python \ + libusb-0.1-4 \ +# Software required for building 3rd party tools \ +#&& apt-get -y install --no-install-recommends \ +# gcc g++ build-essential fpc libusb-dev scons python \ # Build NeXTTool \ - && cd /src/bricxcc/code \ - && make -f nexttool.mak \ - && chmod +x nexttool \ - && cp nexttool ${NXT_TOOLS_DIR}/nexttool \ +#&& cd /src/bricxcc/code \ +#&& make -f nexttool.mak \ +#&& chmod +x nexttool \ +#&& cp nexttool ${NXT_TOOLS_DIR}/nexttool \ # Build LibNXT \ - && cd /src/libnxt \ - && scons \ - && chmod +x ./fwflash \ - && chmod +x ./fwexec \ - && cp ./fwflash ${NXT_TOOLS_DIR}/fwflash \ - && cp ./fwexec ${NXT_TOOLS_DIR}/fwexec \ +#&& cd /src/libnxt \ +#&& scons \ +#&& chmod +x ./fwflash \ +#&& chmod +x ./fwexec \ +#&& cp ./fwflash ${NXT_TOOLS_DIR}/fwflash \ +#&& cp ./fwexec ${NXT_TOOLS_DIR}/fwexec \ # Install ARM cross-compiler and debuggers \ && apt-get -y install --install-recommends \ usbutils gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib gdb-multiarch openocd \ @@ -111,21 +59,31 @@ RUN groupadd -f --gid $USER_GID $USERNAME \ && apt-get autoremove -y \ && apt-get clean -y \ && rm -rf /var/lib/apt/lists/* \ - && rm -rf /src +# Create projects folder \ + && mkdir -p /home/${USERNAME}/projects -# Install scripts into NXT_TOOLS_DIR -ADD scripts/include ${NXT_TOOLS_DIR} - -# Install NXTOSEK +# Copy nxtOSEK core files ADD nxtosek ${NXTOSEK} COPY VERSION README.md ${NXTOSEK}/ +# Copy NXT tools +ADD config/bricxcc /home/${USERNAME}/bricxcc +COPY src/bricxcc/code/nexttool src/libnxt/out/fwexec src/libnxt/out/fwflash ${NXT_TOOLS_DIR}/ +# Make sure NXT tools always run as root +RUN chown root:root ${NXT_TOOLS_DIR}/nexttool \ + && chown root:root ${NXT_TOOLS_DIR}/fwexec \ + && chown root:root ${NXT_TOOLS_DIR}/fwflash \ + && chmod a+s ${NXT_TOOLS_DIR}/nexttool \ + && chmod a+s ${NXT_TOOLS_DIR}/fwexec \ + && chmod a+s ${NXT_TOOLS_DIR}/fwflash + +# Copy scripts +COPY scripts/wine-headless.sh ${NXT_TOOLS_DIR}/wine-headless + # Switch to NXTOSEK user -WORKDIR ${NXTOSEK} +WORKDIR /home/${USERNAME}/projects USER ${USERNAME} -# Initialize a 32-bit Wine install +# Initialize a 32-bit Wine install \ RUN wine-headless wineboot - - diff --git a/INSTALL.md b/INSTALL.md index 914fbf1..e3823cb 100755 --- a/INSTALL.md +++ b/INSTALL.md @@ -6,52 +6,28 @@ This process has been tested on Ubuntu 20.04 running in VMWare and on Ubuntu 20. --- -## Installation under Ubuntu Desktop 20.04 (Non-WSL) - -### Prerequisites: - -- [Visual Studio Code](https://linuxize.com/post/how-to-install-visual-studio-code-on-ubuntu-20-04/) for Ubuntu Desktop and the [Remote-Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension +### Prerequisites for Ubuntu Desktop 20.04 (Non-WSL): +- [Visual Studio Code](https://linuxize.com/post/how-to-install-visual-studio-code-on-ubuntu-20-04/) for Ubuntu Desktop +- *Optional*: [Remote-Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. - If running in a Virtual Machine (VMWare, Virtualbox, etc) you should set a USB device filter to autoconnect NXTs to your VM. Look up instructions for your particular software. You need to autoattach both NXT and SAM-BA devices (for downloading firmware); the relevant Vendor:Product IDs are 0694:0002 and 03eb:6124, respectively. -### Installation: - -1. Clone this repository: - - ``` - git clone https://github.com/danielk-98/nxtOSEK - ``` - -2. Run install script: - ``` - cd ./nxtOSEK - ./install.sh - ``` - This will download and install Docker using the official Docker install script. - You will also be prompted to download the latest release of the nxtOSEK Docker image (this may take awhile). If you opt out, you can download it later using ./scripts/download_release.sh or download it manually from this repo's Releases page. - -3. See the section "Starting A New nxtOSEK Project" for how to get started! - ---- - -## Installation under Windows 11 (WSL2-Ubuntu) - -### Prerequisites: +### Prerequisites for Windows 11 (WSL2-Ubuntu): - Windows 11 (Likely not working in Windows 10 due to Win11-exclusive features) - [WSL2](https://ubuntu.com/tutorials/install-ubuntu-on-wsl2-on-windows-11-with-gui-support) with Ubuntu 20.04 LTS. -- [Visual Studio Code](https://code.visualstudio.com/download) for Windows, the [Remote-Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension, and the [Remote-WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) extension. +- [Visual Studio Code](https://code.visualstudio.com/download) for Windows and the [Remote-WSL](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl) extension. +- *Optional*: [Remote-Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) extension. - [USB-IP](https://github.com/dorssel/usbipd-win/releases/) server for Windows -### Installation: +--- -1. Open VS Code. In File->Preferences->Settings, search for `remote.containers.executeInWSL` . Check the box to enable the option. - If you have multiple WSL instances, you can also change the `remote.containers.executeInWSLDistro` option and select which distro will contain Docker. +## Installation: -In a new WSL terminal: +1. Install prerequisite software for your system (see above) -2. Clone this repository: +2. Open a new terminal. Clone this repository: ``` git clone https://github.com/danielk-98/nxtOSEK @@ -62,51 +38,87 @@ In a new WSL terminal: cd ./nxtOSEK ./install.sh ``` - This will download and install Docker using the official Docker install script. - You will also be prompted to download the latest release of the nxtOSEK Docker image (this may take awhile). If you opt out, you can download it later using ./scripts/download_release.sh or download it manually from this repo's Releases page. + After some preliminary configuration, the script will ask you to download the nxtOSEK Docker image. -4. See the section "Starting A New nxtOSEK Project" for how to get started! + If Docker is not installed or if you opt-out of the Docker image, the nxtOSEK toolchain can be installed locally instead (recommended). However, this requires installing many new packages (Wine, ARM cross-compiler, etc.) on your system. ---- + The Docker image may take a long time to download but is much less likely to break far in the future due to missing dependencies, since it is already pre-compiled and working. -## Starting A New nxtOSEK Project + **The local installation option is recommended - but if packages are no longer available for your system, download the Docker image instead.** + + +--- - Note: nxtOSEK **can** be used independently of VS-Code. From an Ubuntu or WSL2 terminal, launch `./scripts/bash_release.sh` to spin up a temporary nxtOSEK container and connect to a Bash terminal. +## Starting A New nxtOSEK Project -There are currently project templates available for C and C++ development using the OSEK kernel. -1. Choose OSEK_C_Project_Template or OSEK_C++_Project_Template, then copy the folder to wherever you want to store your new project. Feel free to rename it as desired. +1. Choose `OSEK_C_Project_Template` or `OSEK_C++_Project_Template`, then copy the folder to wherever you want to store your new project. Feel free to rename it as desired. -Then open the project in an nxtOSEK development container: -2. Open Visual Studio Code. +2. Open the project in Visual Studio Code. - 2a. *For Windows 11/WSL2 ONLY*: press F1 to open the command menu and find: `Remote-WSL: New WSL Window Using Distro...` . Select the same WSL distro under which you ran install.sh. + *For Windows 11/WSL2 ONLY*: Press F1 to open the command menu and find: `Remote-WSL: New WSL Window Using Distro...` . Select the same WSL distro under which you ran install.sh. Once WSL is running and connected, open the template.code-workspace file as normal. + + *If developing within Docker image*: Press F1 to open the command menu and find: `Remote-Containers: Open Workspace In Container` . Select the template.code-workspace file located in the project folder. - - The Project workspace will only open if VS Code is already connected to a running WSL2 instance. + *If developing using a local nxtOSEK install (no Docker image)*: Press F1 to open the command menu and find: `File: Open Workspace from File` . Select the template.code-workspace file located in the project folder. -3. Press F1 to open the command menu and find: `Remote-Containers: Open Workspace In Container` . Select the template.code-workspace file located in this folder. - Ignore the warning message regarding relative paths. -Edit the project, or leave as-is (helloworld code is already included). +3. Write code in ./src, define tasks in template.oil, and edit the build options in Makefile. Or leave the project as-is; "helloworld" code is already included. -4. Write code in ./src, define tasks in template.oil, and edit the build options in Makefile. + *If developing using a local nxtOSEK install (no Docker image)*: You can delete `.devcontainer/` and `run-in-container.sh`, as these will not be needed. -5. In a VS Code terminal, run "make all" to compile the project into an NXT executable. If you have the [Tasks extension](https://marketplace.visualstudio.com/items?itemName=actboy168.tasks) installed, you can simply click the "make all" button in the bottom ribbon. +4. In a VS Code terminal, run "make all" to compile the project into an NXT executable. If you have the [Tasks extension](https://marketplace.visualstudio.com/items?itemName=actboy168.tasks) installed, you can simply click the "make all" button in the bottom ribbon. -Finally, download the program to the NXT. +5. Connect an NXT to your computer via the USB cable. -6. Connect an NXT to your computer via the USB cable. - The device should be automatically passed through to the running Docker container. Both `lsusb` and `nexttool -listbricks` should confirm the NXT connection was successful. + *For Windows 11/WSL2 ONLY*: + The USB device should be automatically passed through to WSL within 10 seconds. Both `lsusb` and `nexttool -listbricks` should confirm the NXT connection was successful. -7. If you haven't yet installed the Enhanced Firmware on the NXT, do so by running "./flash-rxe-firmware.sh" +6. If you haven't yet installed the Enhanced Firmware on the NXT, do so by running "./flash-rxe-firmware.sh" The NXT will enter SAM-BA (reset) mode and begin clicking with a blank screen. Re-run the script if the firmware download fails. Once the firmware download is complete the screen will return to the normal menu. -8. In a VS Code terminal, run "./flash-rxe-app.sh" to download the .rxe binary to the NXT. +7. In a VS Code terminal, run "./flash-rxe-app.sh" to download the .rxe binary to the NXT. There are many options for configuring your project. Please see the documentation directory and/or the original website (http://lejos-osek.sourceforge.net/) for more information. + +--- + +## Developing in Docker in WSL + +It is possible to run VS Code inside a Docker container inside WSL. This is currently the most future-proof way to use nxtOSEK on Windows. + +1. Complete the installation as outlined above. While running `install.sh`, choose the options to install Docker and download the nxtOSEK Docker image. + +2. Open VS Code on Windows. In File->Preferences->Settings, search for `remote.containers.executeInWSL` . Check the box to enable the option. + If you have multiple WSL instances, you can also change the `remote.containers.executeInWSLDistro` option and select which distro contains the nxtOSEK Docker image. + +3. Proceed with project setup as normal. Make sure VS Code is open and connected to WSL before running `Remote-Containers: Open Workspace In Container` + +--- + +## Tips for developing nxtOSEK using Docker + +If the nxtOSEK Docker image has been installed, you can use `my_project/run-in-container.sh` to run commands in a Docker container with your project files. For example (Run from the root of your project folder): + +Build your project (Does not need nxtOSEK toolchain installed locally!): + +`./run-in-container.sh make all` + +Clean your project: + +`./run-in-container.sh make clean` + +Open an interactive terminal containing your project workspace and an nxtOSEK development environment: + +`./run-in-container.sh bash` + +Download your program to the NXT over USB (Does not need the NXT tools installed locally!): + +`./run-in-container.sh ./flash-rxe-app.sh` + diff --git a/OSEK_C++_Project_Template/.devcontainer/devcontainer.json b/OSEK_C++_Project_Template/.devcontainer/devcontainer.json index b4032dc..818b6ff 100755 --- a/OSEK_C++_Project_Template/.devcontainer/devcontainer.json +++ b/OSEK_C++_Project_Template/.devcontainer/devcontainer.json @@ -19,8 +19,8 @@ //source=/dev/bus/usb,target=/dev/bus/usb,type=bind", //"source=/var/run/dbus,target=/var/run/dbus,type=bind" ], - "workspaceMount": "source=${localWorkspaceFolder},target=/home/nxtosek/projects/${localWorkspaceFolderBasename},type=bind", - "workspaceFolder": "/home/nxtosek/projects/${localWorkspaceFolderBasename}", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/nxtuser/projects/${localWorkspaceFolderBasename},type=bind", + "workspaceFolder": "/home/nxtuser/projects/${localWorkspaceFolderBasename}", // Add the IDs of extensions you want installed when the container is created. "extensions": [ @@ -32,7 +32,7 @@ // Overrides the user for all operations run as inside the container. // Defaults to either root or the last USER instruction in the related Dockerfile used to create the image. - "containerUser": "nxtosek", + "containerUser": "nxtuser", // A command string or list of command arguments to run on the host machine before the container is created. //"initializeCommand": "sudo sysctl -w vm.mmap_min_addr=0 && sudo killall -9 bluetoothd && sudo cp 70-nxt.rules /etc/udev/rules.d/ && sudo udevadm control --reload-rules", diff --git a/OSEK_C++_Project_Template/.vscode/c_cpp_properties.json b/OSEK_C++_Project_Template/.vscode/c_cpp_properties.json index a1ca17d..db36b09 100755 --- a/OSEK_C++_Project_Template/.vscode/c_cpp_properties.json +++ b/OSEK_C++_Project_Template/.vscode/c_cpp_properties.json @@ -1,14 +1,13 @@ { "configurations": [ { - "name": "OSEK_C++", + "name": "OSEK", "includePath": [ "${workspaceFolder}/**", - "${env:NXTOSEK}/c++/**", - "${env:NXTOSEK}/ecrobot/c/**", - "${env:NXTOSEK}/ecrobot/c++/**", - "${env:NXTOSEK}/toppers_osek/**", - "${env:NXTOSEK}/lejos_nxj/src/nxtvm/**" + "/usr/local/src/nxtosek/ecrobot/c", + "/usr/local/src/nxtosek/ecrobot/c++/**", + "/usr/local/src/nxtosek/toppers_osek/**", + "/usr/local/src/nxtosek/lejos_nxj/src/nxtvm/**" ], "defines": [], "compilerPath": "/usr/bin/arm-none-eabi-gcc", diff --git a/OSEK_C++_Project_Template/Makefile b/OSEK_C++_Project_Template/Makefile index a188f51..1980642 100755 --- a/OSEK_C++_Project_Template/Makefile +++ b/OSEK_C++_Project_Template/Makefile @@ -14,7 +14,7 @@ TARGET_CPP_SOURCES = \ #### OSEK .oil files, which configure the RTOS environment and tasks TOPPERS_OSEK_OIL_SOURCE = \ - ./project.oil + ./template.oil #### External source code to include. Each path on its own line, separate lines by \ character. @@ -63,4 +63,7 @@ TOPPERS_OSEK_OIL_SOURCE = \ #### DO NOT MODIFY O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/OSEK_C_Project_Template/runcmd.sh b/OSEK_C++_Project_Template/run-in-container.sh similarity index 73% rename from OSEK_C_Project_Template/runcmd.sh rename to OSEK_C++_Project_Template/run-in-container.sh index 82b21ff..8c11319 100755 --- a/OSEK_C_Project_Template/runcmd.sh +++ b/OSEK_C++_Project_Template/run-in-container.sh @@ -6,7 +6,7 @@ docker run --rm \ --interactive \ --tty \ --privileged \ - --mount type=bind,source="$PROJECT_LOCAL_PATH",target="/home/nxtosek/projects/$PROJECT_NAME" \ - --workdir "/home/nxtosek/projects/$PROJECT_NAME" \ + --mount type=bind,source="$PROJECT_LOCAL_PATH",target="/home/nxtuser/projects/$PROJECT_NAME" \ + --workdir "/home/nxtuser/projects/$PROJECT_NAME" \ nxtosek:latest \ - "$@" \ No newline at end of file + "$@" \ No newline at end of file diff --git a/OSEK_C++_Project_Template/template.code-workspace b/OSEK_C++_Project_Template/template.code-workspace index 40da772..509b9f9 100755 --- a/OSEK_C++_Project_Template/template.code-workspace +++ b/OSEK_C++_Project_Template/template.code-workspace @@ -4,7 +4,7 @@ "path": "." }, { - "path": "../.." + "path": "/usr/local/src/nxtosek" } ], "settings": { diff --git a/OSEK_C_Project_Template/.devcontainer/devcontainer.json b/OSEK_C_Project_Template/.devcontainer/devcontainer.json index b4032dc..818b6ff 100755 --- a/OSEK_C_Project_Template/.devcontainer/devcontainer.json +++ b/OSEK_C_Project_Template/.devcontainer/devcontainer.json @@ -19,8 +19,8 @@ //source=/dev/bus/usb,target=/dev/bus/usb,type=bind", //"source=/var/run/dbus,target=/var/run/dbus,type=bind" ], - "workspaceMount": "source=${localWorkspaceFolder},target=/home/nxtosek/projects/${localWorkspaceFolderBasename},type=bind", - "workspaceFolder": "/home/nxtosek/projects/${localWorkspaceFolderBasename}", + "workspaceMount": "source=${localWorkspaceFolder},target=/home/nxtuser/projects/${localWorkspaceFolderBasename},type=bind", + "workspaceFolder": "/home/nxtuser/projects/${localWorkspaceFolderBasename}", // Add the IDs of extensions you want installed when the container is created. "extensions": [ @@ -32,7 +32,7 @@ // Overrides the user for all operations run as inside the container. // Defaults to either root or the last USER instruction in the related Dockerfile used to create the image. - "containerUser": "nxtosek", + "containerUser": "nxtuser", // A command string or list of command arguments to run on the host machine before the container is created. //"initializeCommand": "sudo sysctl -w vm.mmap_min_addr=0 && sudo killall -9 bluetoothd && sudo cp 70-nxt.rules /etc/udev/rules.d/ && sudo udevadm control --reload-rules", diff --git a/OSEK_C_Project_Template/.vscode/c_cpp_properties.json b/OSEK_C_Project_Template/.vscode/c_cpp_properties.json index 28ab750..db36b09 100755 --- a/OSEK_C_Project_Template/.vscode/c_cpp_properties.json +++ b/OSEK_C_Project_Template/.vscode/c_cpp_properties.json @@ -1,12 +1,13 @@ { "configurations": [ { - "name": "OSEK_C", + "name": "OSEK", "includePath": [ "${workspaceFolder}/**", - "${env:NXTOSEK}/ecrobot/c", - "${env:NXTOSEK}/toppers_osek/**", - "${env:NXTOSEK}/lejos_nxj/src/nxtvm/**" + "/usr/local/src/nxtosek/ecrobot/c", + "/usr/local/src/nxtosek/ecrobot/c++/**", + "/usr/local/src/nxtosek/toppers_osek/**", + "/usr/local/src/nxtosek/lejos_nxj/src/nxtvm/**" ], "defines": [], "compilerPath": "/usr/bin/arm-none-eabi-gcc", diff --git a/OSEK_C_Project_Template/Makefile b/OSEK_C_Project_Template/Makefile index 2e4ff40..e0f65be 100755 --- a/OSEK_C_Project_Template/Makefile +++ b/OSEK_C_Project_Template/Makefile @@ -3,8 +3,9 @@ TARGET = OSEK_C_Project #### List of all .c files. Each file on its own line, separate lines by \ character. -TARGET_SOURCES = \ - ./src/main.c +TARGET_SOURCES = $(addprefix ./src/, \ + main.c \ +) #### OSEK .oil files, which configure the RTOS environment and tasks @@ -14,8 +15,8 @@ TOPPERS_OSEK_OIL_SOURCE = \ #### External source code to include. Each path on its own line, separate lines by \ character. # USER_INC_PATH = \ -# /usr/lib/libfixmatrix-master \ -# /usr/lib/libfixmath-master/libfixmath +# /usr/local/src/libfixmatrix-master \ +# /usr/local/src/libfixmath-master/libfixmath # VPATH = $(USER_INC_PATH) @@ -57,4 +58,7 @@ TOPPERS_OSEK_OIL_SOURCE = \ #### DO NOT MODIFY O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/OSEK_C_Project_Template/run-in-container.sh b/OSEK_C_Project_Template/run-in-container.sh new file mode 100755 index 0000000..8c11319 --- /dev/null +++ b/OSEK_C_Project_Template/run-in-container.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +PROJECT_LOCAL_PATH=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +PROJECT_NAME="$(basename "$PROJECT_LOCAL_PATH")" + +docker run --rm \ + --interactive \ + --tty \ + --privileged \ + --mount type=bind,source="$PROJECT_LOCAL_PATH",target="/home/nxtuser/projects/$PROJECT_NAME" \ + --workdir "/home/nxtuser/projects/$PROJECT_NAME" \ + nxtosek:latest \ + "$@" \ No newline at end of file diff --git a/OSEK_C_Project_Template/template.code-workspace b/OSEK_C_Project_Template/template.code-workspace index 40da772..509b9f9 100755 --- a/OSEK_C_Project_Template/template.code-workspace +++ b/OSEK_C_Project_Template/template.code-workspace @@ -4,7 +4,7 @@ "path": "." }, { - "path": "../.." + "path": "/usr/local/src/nxtosek" } ], "settings": { diff --git a/README.md b/README.md index 6f5ead5..a04d24a 100755 --- a/README.md +++ b/README.md @@ -12,53 +12,62 @@ NXT-OSEK provides realtime kernels based on an NXT-compatible C/C++ compiler, and device driver APIs for easy access to LEGO hardware. -The original nxtOSEK project has been abandoned by its original authors. +The original nxtOSEK project is no longer being maintained by its original authors. Versions 3.01+ are unofficial releases intended to modernize the NXT-OSEK toolchain with the following goals: - Fix long-standing bugs - Improve support on both Linux and Windows - Provide general usability improvements - Future-proof the setup as much as possible to maintain compatibility for years to come. -## **Installation:** -Please see INSTALL.md for setup and usage instructions. +## **Installation and Usage:** +Please see `INSTALL.md` for setup and usage instructions. ## **New Features:** +- Working install script + + install.sh handles the required system configuration for both local (no-Docker) and Docker installs of the nxtOSEK development environment. + - Fully encapsulated nxtOSEK development environment using Docker - The provided Docker image contains all necessary compilers, scripts, tools, pre-installed and working. - This eliminates most external dependencies and simplifies the deployment process. + An optional Docker image (see Releases page) contains all necessary compilers, scripts, tools, pre-installed and working. -- Support for Debian-based Linux distros, including WSL2 on Windows 11. - -- Included installer automatically configures your system for Docker and USB-passthrough. +- Support for Debian-based Linux distros, including WSL2 on Windows 11 -- Visual Studio Code (VSCode) integration + USB passthrough is automatically configured on WSL2. - VSCode project templates automatically load your code into a Docker container with all the required tools and settings. Preconfigured tasks compile and download your code to the NXT with the click of a button! +- Visual Studio Code (VSCode) integration -- ARM-NONE-EABI cross-compiler + C/C++ linting and Intellisense are now working. Preconfigured tasks let you compile and download your program to the NXT with the click of a button! + +- Build scripts updated for ARM-NONE-EABI cross-compiler - Does not require custom builds or outdated dependencies. + No longer requires custom compilers or outdated dependencies. - Includes all required tools for interfacing with the NXT - Latest versions of John Hansen's NeXTTool and Roman Shaposhnik's LibNXT (fwexec and fwflash) are included in the Docker image. + Latest versions of John Hansen's NeXTTool and Roman Shaposhnik's LibNXT (fwexec and fwflash) are available through the install script, and are included by default in the Docker image. - Quick-start Templates for OSEK C and OSEK C++ VSCode projects + Create a new program, compile it, and download it to the NXT in minutes! + ## **Planned Features:** -- Better support for multiple NXTs (need to set which USB/Bluetooth device is targeted by tool scripts) - Fix broken compile process for nxtOSEK's appflash utility (what deps do we need to have for this?) - VSCode integration with OpenOCD/GDB for real-time NXT debugging (requires an NXT hardware mod!) - Project templates for JSP kernel (OSEK has a few kernel bugs; JSP may work better?) -- Better support for custom kernel and/or tool modifications -- Bluetooth support for WSL ## **Change Log:** -### What's new in 3.01 (May 2022 - Daniel Kennedy) +### What's new in 3.02 (May 2022 - Daniel Kennedy) +- Added option for local nxtOSEK installation (no Docker required!) + + This is currently the recommended way to use nxtOSEK (see `INSTALL.md` for details). + The Docker image release is still available and working, and will likely remain working long after the local install option is broken. + + +### What's new in 3.01 (April 2022 - Daniel Kennedy) - Added Docker image. The provided Docker image contains all necessary compilers, scripts, tools, pre-installed and working. diff --git a/VERSION b/VERSION index 3b819a2..0d94696 100755 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.01 \ No newline at end of file +3.02 \ No newline at end of file diff --git a/nxtosek/bricxcc/bricks.dat b/config/bricxcc/bricks.dat similarity index 80% rename from nxtosek/bricxcc/bricks.dat rename to config/bricxcc/bricks.dat index d948f24..26deb1f 100755 --- a/nxtosek/bricxcc/bricks.dat +++ b/config/bricxcc/bricks.dat @@ -2,4 +2,4 @@ samba=USB0::0X03EB::0X6124::NI-VISA-1::1::RAW nxt1=USB0::0X0694::0X0002::00165318D0AB::RAW nxt2=USB0::0X0694::0X0002::0016530001CA::RAW nxt3=USB0::0X0694::0X0002::0016530174E7::RAW -nxt4=USB0::0X0694::0X0002::0016530C69D5::RAW +nxt4=USB0::0X0694::0X0002::0016530C69D5::RAW \ No newline at end of file diff --git a/udev/70-nxt.rules b/config/udev/70-nxt.rules similarity index 70% rename from udev/70-nxt.rules rename to config/udev/70-nxt.rules index ebd65df..a2f086e 100755 --- a/udev/70-nxt.rules +++ b/config/udev/70-nxt.rules @@ -1,4 +1,4 @@ # NXT in normal mode -SUBSYSTEM=="usb", ATTR{idVendor}=="0694", ATTR{idProduct}=="0002", GROUP="users", MODE="0660", SYMLINK+="nxt-%k", RUN+="/etc/udev/nxt_event_handler.sh '$attr{serial}' '%k' '%M' '%m'" +SUBSYSTEM=="usb", ATTR{idVendor}=="0694", ATTR{idProduct}=="0002", GROUP="users", MODE="0660", SYMLINK+="nxt-%k", RUN+="/etc/udev/nxt_event_handler.sh 'nxt' '$attr{serial}' '%k' '%M' '%m'" # NXT in reset (SAM-BA) mode -SUBSYSTEM=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="6124", GROUP="users", MODE="0660", SYMLINK+="samba-%k" RUN+="/etc/udev/samba_event_handler.sh '$attr{serial}' '%k' '%M' '%m'" +SUBSYSTEM=="usb", ATTR{idVendor}=="03eb", ATTR{idProduct}=="6124", GROUP="users", MODE="0660", SYMLINK+="samba-%k" RUN+="/etc/udev/nxt_event_handler.sh 'samba' '$attr{serial}' '%k' '%M' '%m'" diff --git a/udev/nxt_event_handler.sh b/config/udev/nxt_event_handler.sh similarity index 91% rename from udev/nxt_event_handler.sh rename to config/udev/nxt_event_handler.sh index 5b9fcb1..e73c09e 100755 --- a/udev/nxt_event_handler.sh +++ b/config/udev/nxt_event_handler.sh @@ -1,10 +1,14 @@ #!/usr/bin/env bash -SERIAL=$1 -KERNEL=$2 -MAJOR=$3 -MINOR=$4 -CONTAINER_IDS=$(docker ps -qf ancestor=nxtosek -f status=running) +TYPE=$1 +SERIAL=$2 +KERNEL=$3 +MAJOR=$4 +MINOR=$5 + +if [ -x "$(command -v docker)" ]; then + CONTAINER_IDS=$(docker ps -qf ancestor=nxtosek -f status=running) +fi LOGFILE_DIR="/tmp/nxt" LOGFILE="nxt-events.log" @@ -13,6 +17,7 @@ mkdir -p "$LOGFILE_DIR" echo "USB Event: ACTION: $ACTION DEVTYPE: $DEVTYPE + TYPE: $TYPE KERNEL: $KERNEL SERIAL: $SERIAL DEVNUM: $DEVNUM @@ -24,6 +29,7 @@ echo "USB Event: Docker Containers: $CONTAINER_IDS " >> "$LOGFILE_DIR/$LOGFILE" +# If any NXTOSEK containers are running, add this device to them. if [ $ACTION == "add" ]; then IFS=$'\n' CONTAINER_IDS=($CONTAINER_IDS) diff --git a/install.sh b/install.sh index 0ea5eaf..7e5e3f7 100755 --- a/install.sh +++ b/install.sh @@ -1,73 +1,52 @@ #!/usr/bin/env bash WORKING_DIR=$PWD -PROJECT_ROOT=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -SCRIPT_DIR="$PROJECT_ROOT/scripts" -VERSION=$(cat "$PROJECT_ROOT/VERSION") +ROOT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +CONFIG_DIR="$ROOT_DIR/config" +SCRIPTS_DIR="$ROOT_DIR/scripts" +SRC_DIR="$ROOT_DIR/src" +VERSION=$(cat "$ROOT_DIR/VERSION") WSL=$(if grep -q microsoft /proc/version; then echo 'true'; else echo 'false'; fi) -cd "$PROJECT_ROOT" +if [ -z ${NXTOSEK+x} ]; then + export NXTOSEK="/usr/local/src/nxtosek" +fi # Prerequisites sudo apt-get update -sudo apt-get install wget curl git subversion -cd "$SCRIPT_DIR" +sudo apt-get install wget curl git +cd "$SCRIPTS_DIR" chmod +x *.sh -# Install Docker -echo "Downloading Github repo: danielk-98/docker-scripts" -if [ ! -d "$SCRIPT_DIR/docker-scripts" ]; then - cd "$SCRIPT_DIR" - git clone https://github.com/danielk-98/docker-scripts.git -else - cd "$SCRIPT_DIR/docker-scripts" - git pull origin main -fi - -if [ ! -x "$(command -v docker)" ]; then - echo "Docker not detected. Installing now..." - cd "$SCRIPT_DIR/docker-scripts" - chmod +x *.sh - "./install-docker.sh" -else - echo "It appears Docker has already been installed. Skipping..." -fi - -# Setting required for Wine to run within Docker -# (Wine is needed for OSEK sg.exe during the linking process) -# Technically, wine isn't needed at all on WSL because sg.exe can run natively... -# But the image contains wine anyway so we're gonna use it for this one thing -echo "Setting SYSCTL parameters..." -sudo sysctl -w vm.mmap_min_addr=0 - # UDEV controlls access to hardware devices. # Better user experience if users have full access to NXTs by default # Required for access to NXT devices over USB echo "Adding UDEV rules for NXT devices..." -cd "$PROJECT_ROOT/udev" sudo groupadd -f plugdev sudo groupadd -f dialout +sudo groupadd -f users sudo usermod -aG plugdev $USER sudo usermod -aG dialout $USER -sudo cp -f "70-nxt.rules" "/etc/udev/rules.d/70-nxt.rules" -sudo cp -f "nxt_event_handler.sh" "/etc/udev/nxt_event_handler.sh" && sudo chmod +x "/etc/udev/nxt_event_handler.sh" -sudo cp -f "samba_event_handler.sh" "/etc/udev/samba_event_handler.sh" && sudo chmod +x "/etc/udev/samba_event_handler.sh" +sudo usermod -aG users $USER +cd "$CONFIG_DIR/udev" +sudo cp -f "./70-nxt.rules" "/etc/udev/rules.d/70-nxt.rules" +sudo cp -f "./nxt_event_handler.sh" "/etc/udev/nxt_event_handler.sh" && sudo chmod +x "/etc/udev/nxt_event_handler.sh" sudo udevadm control --reload-rules && sudo udevadm trigger # WSL only: Install USB-IP services for Linux if [ $WSL == 'true' ]; then echo "WSL2 detected." - echo "Downloading Github repo: danielk-98/wsl-usb-scripts" - if [ ! -d "$SCRIPT_DIR/wsl-usb-scripts" ]; then - cd "$SCRIPT_DIR" + echo "Downloading repository: https://github.com/danielk-98/wsl-usb-scripts.git" + if [ ! -d "$SCRIPTS_DIR/wsl-usb-scripts" ]; then + cd "$SCRIPTS_DIR" git clone https://github.com/danielk-98/wsl-usb-scripts.git else - cd "$SCRIPT_DIR/wsl-usb-scripts" + cd "$SCRIPTS_DIR/wsl-usb-scripts" git pull origin main fi if [ ! -f "/etc/default/usbip-automount" ]; then echo "Installing USB-IP for WSL..." - cd "$SCRIPT_DIR/wsl-usb-scripts" + cd "$SCRIPTS_DIR/wsl-usb-scripts" chmod +x *.sh "./install.sh" else @@ -85,17 +64,80 @@ if [ $WSL == 'true' ]; then service usbip-automount start fi -echo " " -echo "Linux Host configuration complete!" -echo " " -read -p "Should we download the latest nxtOSEK image now? (This will take some time) (Y/N): " yn -case $yn in - [Yy]* ) "$SCRIPT_DIR/download_release.sh";; - * ) echo "You can download this release at a later time by running './scripts/download_release.sh'";; -esac +# Download Docker scripts +echo "Downloading repository: https://github.com/danielk-98/docker-scripts.git" +if [ ! -d "$SCRIPTS_DIR/docker-scripts" ]; then + cd "$SCRIPTS_DIR" + git clone https://github.com/danielk-98/docker-scripts.git +else + cd "$SCRIPTS_DIR/docker-scripts" + git pull origin main +fi + +# Install Docker +echo +echo "${bold}Docker${normal}" +echo "Docker is optional (nxtOSEK can be installed locally instead) but without Docker all toolchain components (Wine, ARM cross-compiler, etc. will need to be installed on your system." +echo "Docker is also required to compile LibNXT, without which some nxtOSEK tools will not function." +read -r -p "${bold}Install Docker? (Y/N): ${normal} " +echo +if [[ $REPLY =~ ^[Yy]$ ]]; then + if [ ! -x "$(command -v docker)" ]; then + echo "Docker not detected. Installing now..." + cd "$SCRIPTS_DIR/docker-scripts" + chmod +x *.sh + "./install-docker.sh" + else + echo "It appears Docker has already been installed. Skipping..." + fi + + # This setting is required for Wine to run within Docker + echo "Setting SYSCTL parameters..." + sudo sysctl -w vm.mmap_min_addr=0 +fi + +# NXT Tools +echo +echo "${bold}NXT Tools${normal}" +echo "This will download, build, and install to /usr/local/bin: " +echo " 1. John Hansen's NeXTTool (1.2.1.r5) from BricxCC 3.0" +echo " 2. Roman Shaposhnik's LibNXT (0.3) (requires Docker)" +read -r -p "${bold}Install NXT Tools? (Y/N): ${normal} " +echo +if [[ $REPLY =~ ^[Yy]$ ]]; then + cd "$SCRIPTS_DIR" + "./install_nxt_tools.sh" +fi + +# NXTOSEK and Toolchain +echo +echo "${bold}nxtOSEK Toolchain${normal}" +echo "This will download and install the following software required for nxtOSEK: " +echo " 1. ARM-NONE-EABI (ARM cross compiler)" +echo " 2. Bluetooth services (bluez)" +echo " 3. Wine-stable (required during linking process)" +echo " 4. nxtOSEK development environment (installs to $NXTOSEK)" +echo "If not installed, you can choose to install the Docker image instead." +read -r -p "${bold}Install nxtOSEK? (Y/N): ${normal} " +echo +if [[ $REPLY =~ ^[Yy]$ ]]; then + cd "$SCRIPTS_DIR" + "./install_toolchain.sh" +fi + +echo +echo "${bold}nxtOSEK Docker Image${normal}" +echo "This downloads a precompiled image containing a complete nxtOSEK development environment." +echo "This may take some time." +read -r -p "${bold}Install nxtOSEK Docker Image? (Y/N): ${normal} " +echo +if [[ $REPLY =~ ^[Yy]$ ]]; then + cd "$SCRIPTS_DIR" + "./download_release.sh" +fi cd "$WORKING_DIR" -echo "Script is complete." +echo "nxtOSEK Installer is complete." echo "Please restart your machine before continuing." diff --git a/nxtosek/c++/src/Makefile b/nxtosek/c++/src/Makefile index 7443197..e610247 100755 --- a/nxtosek/c++/src/Makefile +++ b/nxtosek/c++/src/Makefile @@ -2,11 +2,11 @@ ROOT = $(NXTOSEK) -ECROBOT_ROOT = $(ROOT)/ecrobot -ECROBOT_C_ROOT = $(ROOT)/ecrobot/c -LEJOSNXJSRC_ROOT = $(ROOT)/lejos_nxj/src/ -TOPPERS_OSEK_ROOT = $(ROOT)/toppers_osek -CXX_ROOT = $(ROOT)/c++ +ECROBOT_ROOT = $(NXTOSEK)/ecrobot +ECROBOT_C_ROOT = $(NXTOSEK)/ecrobot/c +LEJOSNXJSRC_ROOT = $(NXTOSEK)/lejos_nxj/src/ +TOPPERS_OSEK_ROOT = $(NXTOSEK)/toppers_osek +CXX_ROOT = $(NXTOSEK)/c++ LEJOS_PLATFORM_SOURCES_PATH = nxtvm/platform/nxt LEJOS_VM_SOURCES_PATH = nxtvm/javavm diff --git a/nxtosek/ecrobot/bios/Makefile b/nxtosek/ecrobot/bios/Makefile index a6d2743..07484c6 100755 --- a/nxtosek/ecrobot/bios/Makefile +++ b/nxtosek/ecrobot/bios/Makefile @@ -13,11 +13,11 @@ O_PATH ?= build # ROOT = $(NXTOSEK) -ECROBOT_ROOT = $(ROOT)/ecrobot +ECROBOT_ROOT = $(NXTOSEK)/ecrobot # added to support new directory structure by takshic ECROBOT_C_ROOT = $(ECROBOT_ROOT)/c -LEJOSNXJSRC_ROOT = $(ROOT)/lejos_nxj/src/ +LEJOSNXJSRC_ROOT = $(NXTOSEK)/lejos_nxj/src/ vpath %.c $(LEJOSNXJSRC_ROOT) $(ECROBOT_ROOT)/bios vpath %.S $(LEJOSNXJSRC_ROOT) diff --git a/nxtosek/ecrobot/c++/Makefile b/nxtosek/ecrobot/c++/Makefile index 741e154..ed70c24 100755 --- a/nxtosek/ecrobot/c++/Makefile +++ b/nxtosek/ecrobot/c++/Makefile @@ -1,10 +1,10 @@ # Makefile for ECRobot C++(.cpp) library ROOT = $(NXTOSEK) -ECROBOT_ROOT = $(ROOT)/ecrobot -ECROBOT_C_ROOT = $(ROOT)/ecrobot/c -LEJOSNXJSRC_ROOT = $(ROOT)/lejos_nxj/src/ -TOPPERS_OSEK_ROOT = $(ROOT)/toppers_osek +ECROBOT_ROOT = $(NXTOSEK)/ecrobot +ECROBOT_C_ROOT = $(NXTOSEK)/ecrobot/c +LEJOSNXJSRC_ROOT = $(NXTOSEK)/lejos_nxj/src/ +TOPPERS_OSEK_ROOT = $(NXTOSEK)/toppers_osek ECROBOT_CPP_ROOT = $(ECROBOT_ROOT)/c++ LEJOS_PLATFORM_SOURCES_PATH = nxtvm/platform/nxt diff --git a/nxtosek/ecrobot/c/Makefile b/nxtosek/ecrobot/c/Makefile index b1cf859..75500d0 100755 --- a/nxtosek/ecrobot/c/Makefile +++ b/nxtosek/ecrobot/c/Makefile @@ -2,9 +2,9 @@ # modified to support new directory structure by takashic ROOT = $(NXTOSEK) -ECROBOT_ROOT = $(ROOT)/ecrobot -LEJOSNXJSRC_ROOT = $(ROOT)/lejos_nxj/src/ -TOPPERS_OSEK_ROOT = $(ROOT)/toppers_osek +ECROBOT_ROOT = $(NXTOSEK)/ecrobot +LEJOSNXJSRC_ROOT = $(NXTOSEK)/lejos_nxj/src/ +TOPPERS_OSEK_ROOT = $(NXTOSEK)/toppers_osek LEJOS_PLATFORM_SOURCES_PATH = $(LEJOSNXJSRC_ROOT)/nxtvm/platform/nxt LEJOS_VM_SOURCES_PATH = $(LEJOSNXJSRC_ROOT)/nxtvm/javavm diff --git a/nxtosek/ecrobot/ecrobot++.mak b/nxtosek/ecrobot/ecrobot++.mak index 0f275b8..90501cd 100755 --- a/nxtosek/ecrobot/ecrobot++.mak +++ b/nxtosek/ecrobot/ecrobot++.mak @@ -1,19 +1,16 @@ # Common Makefile for C/CPP(*.cpp) with TOPPERS ATK(OSEK) and JSP(ƒÊITRON) -# -## ROOT path configurations -# -ifndef ROOT -ROOT = $(NXTOSEK) +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek endif -ECROBOT_ROOT = $(ROOT)/ecrobot -LEJOSNXJSRC_ROOT = $(ROOT)/lejos_nxj/src/ +ECROBOT_ROOT = $(NXTOSEK)/ecrobot +LEJOSNXJSRC_ROOT = $(NXTOSEK)/lejos_nxj/src/ ifeq ($(TOPPERS_KERNEL), NXT_JSP) -TOPPERS_ROOT = $(ROOT)/toppers_jsp +TOPPERS_ROOT = $(NXTOSEK)/toppers_jsp else -TOPPERS_ROOT = $(ROOT)/toppers_osek +TOPPERS_ROOT = $(NXTOSEK)/toppers_osek endif # 03/11/2009 added by takashic @@ -76,9 +73,6 @@ ifeq ($(TOPPERS_KERNEL), NXT_JSP) config/armv4/at91sam7s/irq.s else - # if you need to modify the Makefiles to set absolute path, - # TOPPERS_OSEK_ROOT_SG should be defined like... - # TOPPERS_OSEK_ROOT_SG = C:/cygwin/nxtOSEK/toppers_osek ifndef TOPPERS_OSEK_ROOT_SG TOPPERS_OSEK_ROOT_SG = $(TOPPERS_ROOT) endif @@ -290,11 +284,6 @@ $(RXEBIN_TARGET): $(RXE_TARGET) @echo "Generating binary image file: $@" $(OBJCOPY) -O binary $< $@ -# on Linux, use wine to run the windows application -ifndef WINECMD -WINECMD := /usr/local/bin/wine-headless -endif - .PHONY: toppers_cfg toppers_cfg: diff --git a/nxtosek/ecrobot/ecrobot.mak b/nxtosek/ecrobot/ecrobot.mak index 4c0b9a5..6ba79f4 100755 --- a/nxtosek/ecrobot/ecrobot.mak +++ b/nxtosek/ecrobot/ecrobot.mak @@ -1,28 +1,27 @@ # Common Makefile for C/C++(*.cc) with TOPPERS ATK(OSEK) and JSP(ƒÊITRON) -# -## ROOT path configurations -# -ifndef ROOT -ROOT = $(NXTOSEK) +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek endif -ECROBOT_ROOT = $(ROOT)/ecrobot -LEJOSNXJSRC_ROOT = $(ROOT)/lejos_nxj/src/ +ECROBOT_ROOT = $(NXTOSEK)/ecrobot +LEJOSNXJSRC_ROOT = $(NXTOSEK)/lejos_nxj/src/ ifeq ($(TOPPERS_KERNEL), NXT_JSP) -TOPPERS_ROOT = $(ROOT)/toppers_jsp +TOPPERS_ROOT = $(NXTOSEK)/toppers_jsp else -TOPPERS_ROOT = $(ROOT)/toppers_osek +TOPPERS_ROOT = $(NXTOSEK)/toppers_osek endif # 03/11/2009 added by takashic ECROBOT_C_ROOT = $(ECROBOT_ROOT)/c -CXX_ROOT=$(ROOT)/c++ +#ECROBOT_CPP_ROOT = $(ECROBOT_ROOT)/c++ +CXX_ROOT=$(NXTOSEK)/c++ -vpath %.c $(LEJOSNXJSRC_ROOT) $(TOPPERS_ROOT) $(ECROBOT_ROOT) $(ECROBOT_C_ROOT) -vpath %.S $(LEJOSNXJSRC_ROOT) $(TOPPERS_ROOT) -vpath %.s $(LEJOSNXJSRC_ROOT) $(TOPPERS_ROOT) $(ECROBOT_ROOT) $(ECROBOT_C_ROOT) +vpath %.c $(LEJOSNXJSRC_ROOT) $(TOPPERS_ROOT) $(ECROBOT_ROOT) $(ECROBOT_C_ROOT) +#vpath %.cpp $(ECROBOT_CPP_ROOT)/device $(ECROBOT_CPP_ROOT)/util +vpath %.S $(LEJOSNXJSRC_ROOT) $(TOPPERS_ROOT) +vpath %.s $(LEJOSNXJSRC_ROOT) $(TOPPERS_ROOT) $(ECROBOT_ROOT) $(ECROBOT_C_ROOT) ################################################################################ # TOPPERS ATK/JSP specific settings. By default, TOPPERS ATK is configured as @@ -74,9 +73,6 @@ ifeq ($(TOPPERS_KERNEL), NXT_JSP) config/armv4/at91sam7s/irq.s else - # if you need to modify the Makefiles to set absolute path, - # TOPPERS_OSEK_ROOT_SG should be defined like... - # TOPPERS_OSEK_ROOT_SG = C:/cygwin/nxtOSEK/toppers_osek ifndef TOPPERS_OSEK_ROOT_SG TOPPERS_OSEK_ROOT_SG = $(TOPPERS_ROOT) endif @@ -286,10 +282,6 @@ $(RXEBIN_TARGET): $(RXE_TARGET) @echo "Generating binary image file: $@" $(OBJCOPY) -O binary $< $@ -# on Linux, use wine to run the windows application -ifndef WINECMD -WINECMD := /usr/local/bin/wine-headless -endif .PHONY: toppers_cfg toppers_cfg: diff --git a/nxtosek/ecrobot/lejos_osek.tmf b/nxtosek/ecrobot/lejos_osek.tmf index 55a8825..db6cf8f 100755 --- a/nxtosek/ecrobot/lejos_osek.tmf +++ b/nxtosek/ecrobot/lejos_osek.tmf @@ -1,4 +1,7 @@ # This template makefile is needed for backward compatibility +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/ecrobot/nxtway_gs_balancer/Makefile b/nxtosek/ecrobot/nxtway_gs_balancer/Makefile index b2e2344..cff408e 100755 --- a/nxtosek/ecrobot/nxtway_gs_balancer/Makefile +++ b/nxtosek/ecrobot/nxtway_gs_balancer/Makefile @@ -2,11 +2,11 @@ # modified to support new directory structure by takshic ROOT = $(NXTOSEK) -ECROBOT_ROOT = $(ROOT)/ecrobot +ECROBOT_ROOT = $(NXTOSEK)/ecrobot # added to support new directory structure by takshic ECROBOT_C_ROOT = $(ECROBOT_ROOT)/c -LEJOSNXJSRC_ROOT = $(ROOT)/lejos_nxj/src/ +LEJOSNXJSRC_ROOT = $(NXTOSEK)/lejos_nxj/src/ LEJOS_PLATFORM_SOURCES_PATH = $(LEJOSNXJSRC_ROOT)/nxtvm/platform/nxt LEJOS_VM_SOURCES_PATH = $(LEJOSNXJSRC_ROOT)/nxtvm/javavm diff --git a/nxtosek/ecrobot/scripts/flash-bios-app.sh b/nxtosek/ecrobot/scripts/flash-bios-app.sh index 0ca39ac..5e72be5 100755 --- a/nxtosek/ecrobot/scripts/flash-bios-app.sh +++ b/nxtosek/ecrobot/scripts/flash-bios-app.sh @@ -1,8 +1,10 @@ #!/usr/bin/env bash -WORKING_DIR=$PWD -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -WSL=$(if grep -q microsoft /proc/version; then echo 'true'; else echo 'false'; fi) - +if [ -z ${NXT_TOOLS_DIR+x} ]; then + NXT_TOOLS_DIR="/usr/local/bin" +fi +if [ -z ${NXTOSEK+x} ]; then + NXTOSEK="/usr/local/src/nxtosek" +fi echo "Usage: flash-bios-app.sh [ROMBIN [COM]] - ROMBIN is path to NXT-BIOS binary program file @@ -23,16 +25,16 @@ elif (( $# == 2 )); then ROMBIN=$1 COM=$2 else - echo "Error: wrong number of arguments" + echo "Error: file \"$FIRMWARE\" does not exist" exit fi if [ ! -f "$ROMBIN" ]; then - echo "Error: file '$ROMBIN' does not exist" + echo "Error: file \"$ROMBIN\" does not exist" exit fi FSIZE_KB=$(du -k "$ROMBIN" | cut -f1) -echo "Downloading NXT-BIOS App '$ROMBIN' ($FSIZE_KB kB) to COM=$COM..." +echo "Downloading NXT-BIOS App \"$ROMBIN\" ($FSIZE_KB kB) to COM=$COM..." -"$NXT_TOOLS_DIR/appflash" ./$ROMBIN +"$NXT_TOOLS_DIR/appflash" "./$ROMBIN" diff --git a/nxtosek/ecrobot/scripts/flash-bios-firmware.sh b/nxtosek/ecrobot/scripts/flash-bios-firmware.sh index 9953dfa..6b31c65 100755 --- a/nxtosek/ecrobot/scripts/flash-bios-firmware.sh +++ b/nxtosek/ecrobot/scripts/flash-bios-firmware.sh @@ -1,12 +1,16 @@ #!/usr/bin/env bash -WORKING_DIR=$PWD -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +if [ -z ${NXT_TOOLS_DIR+x} ]; then + NXT_TOOLS_DIR="/usr/local/bin" +fi +if [ -z ${NXTOSEK+x} ]; then + NXTOSEK="/usr/local/src/nxtosek" +fi +FIRMWARE="$NXTOSEK/firmware/nxt_bios_rom_1.04.rfw" echo "Usage: flash-bios-firmware.sh [COM] - COM is either 'usb' (default) or another valid nexttool alias " -FIRMWARE="$NXTOSEK/firmware/nxt_bios_rom_1.04.rfw" if (( $# == 0 )); then COM=usb elif (( $# == 1 )); then @@ -17,10 +21,10 @@ else fi if [ ! -f "$FIRMWARE" ]; then - echo "Error: file '$FIRMWARE' does not exist" + echo "Error: file \"$FIRMWARE\" does not exist" exit fi -echo "Flashing NXT-BIOS firmware '$FIRMWARE' to COM=$COM..." +echo "Flashing NXT-BIOS firmware \"$FIRMWARE\" to COM=$COM..." -"$NXT_TOOLS_DIR/nexttool" $NXT_TOOLS_DIR/nexttool /COM=$COM -firmware="$FIRMWARE" +"$NXT_TOOLS_DIR/nexttool" /COM=$COM -firmware="$FIRMWARE" diff --git a/nxtosek/ecrobot/scripts/flash-rxe-app.sh b/nxtosek/ecrobot/scripts/flash-rxe-app.sh index 41b4f74..29757d9 100755 --- a/nxtosek/ecrobot/scripts/flash-rxe-app.sh +++ b/nxtosek/ecrobot/scripts/flash-rxe-app.sh @@ -1,7 +1,10 @@ #!/usr/bin/env bash -WORKING_DIR=$PWD -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -WSL=$(if grep -q microsoft /proc/version; then echo 'true'; else echo 'false'; fi) +if [ -z ${NXT_TOOLS_DIR+x} ]; then + NXT_TOOLS_DIR="/usr/local/bin" +fi +if [ -z ${NXTOSEK+x} ]; then + NXTOSEK="/usr/local/src/nxtosek" +fi echo "Usage: flash-rxe-app.sh [RXEBIN [COM]] @@ -28,14 +31,14 @@ else fi if [ ! -f "$RXEBIN" ]; then - echo "Error: file '$RXEBIN' does not exist" + echo "Error: file \"$RXEBIN\" does not exist" exit fi FSIZE_KB=$(du -k "$RXEBIN" | cut -f1) -echo "Downloading NXC-Firmware App '$RXEBIN' ($FSIZE_KB kB) to COM=$COM..." +echo "Downloading NXC-Firmware App \"$RXEBIN\" ($FSIZE_KB kB) to COM=$COM..." -"$NXT_TOOLS_DIR/nexttool" /COM=$COM -download=$RXEBIN +"$NXT_TOOLS_DIR/nexttool" /COM=$COM -download="$RXEBIN" echo "Listing programs on $COM..." diff --git a/nxtosek/ecrobot/scripts/flash-rxe-firmware.sh b/nxtosek/ecrobot/scripts/flash-rxe-firmware.sh index 6c77332..e29d6b1 100755 --- a/nxtosek/ecrobot/scripts/flash-rxe-firmware.sh +++ b/nxtosek/ecrobot/scripts/flash-rxe-firmware.sh @@ -1,13 +1,17 @@ #!/usr/bin/env bash -WORKING_DIR=$PWD -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -WSL=$(if grep -q microsoft /proc/version; then echo 'true'; else echo 'false'; fi) +if [ -z ${NXT_TOOLS_DIR+x} ]; then + NXT_TOOLS_DIR="/usr/local/bin" +fi +if [ -z ${NXTOSEK+x} ]; then + NXTOSEK="/usr/local/src/nxtosek" +fi +FIRMWARE="$NXTOSEK/firmware/lms_arm_nbcnxc_132_20130303_2051.rfw" echo "Usage: flash-rxe-firmware.sh [COM] - COM is either 'usb' (default) or another valid nexttool alias " -FIRMWARE="$NXTOSEK/firmware/lms_arm_nbcnxc_132_20130303_2051.rfw" + if (( $# == 0 )); then COM=usb elif (( $# == 1 )); then @@ -22,6 +26,6 @@ if [ ! -f "$FIRMWARE" ]; then exit fi -echo "Flashing NXC/NBC Enhanced Firmware '$FIRMWARE' to COM=$COM..." +echo "Flashing NXC/NBC Enhanced Firmware \"$FIRMWARE\" to COM=$COM..." -"$NXT_TOOLS_DIR/nexttool" $NXT_TOOLS_DIR/nexttool /COM=$COM -firmware="$FIRMWARE" +"$NXT_TOOLS_DIR/nexttool" /COM=$COM -firmware="$FIRMWARE" diff --git a/nxtosek/ecrobot/scripts/ramboot-app.sh b/nxtosek/ecrobot/scripts/ramboot-app.sh index 8e54789..a79c68c 100755 --- a/nxtosek/ecrobot/scripts/ramboot-app.sh +++ b/nxtosek/ecrobot/scripts/ramboot-app.sh @@ -1,7 +1,10 @@ #!/usr/bin/env bash -WORKING_DIR=$PWD -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -WSL=$(if grep -q microsoft /proc/version; then echo 'true'; else echo 'false'; fi) +if [ -z ${NXT_TOOLS_DIR+x} ]; then + NXT_TOOLS_DIR="/usr/local/bin" +fi +if [ -z ${NXTOSEK+x} ]; then + NXTOSEK="/usr/local/src/nxtosek" +fi echo "Usage: ramboot-app.sh [RAMBIN [COM]] - RAMBIN is path to NXT-BIOS binary program file @@ -34,4 +37,4 @@ fi FSIZE_KB=$(du -k "$RAMBIN" | cut -f1) echo "Executing '$RAMBIN' ($FSIZE_KB kB) from RAM on COM=$COM..." -"$NXT_TOOLS_DIR/fwexec" ./$RAMBIN +"$NXT_TOOLS_DIR/fwexec" "./$RAMBIN" diff --git a/nxtosek/ecrobot/tool_gcc.mak b/nxtosek/ecrobot/tool_gcc.mak index bec913c..0f6fdec 100755 --- a/nxtosek/ecrobot/tool_gcc.mak +++ b/nxtosek/ecrobot/tool_gcc.mak @@ -1,15 +1,18 @@ $(VERBOSE).SILENT: -TARGET_PREFIX := arm-none-eabi +ifndef COMPILER_PREFIX +COMPILER_PREFIX := arm-none-eabi +endif + +ifdef COMPILER_ROOT +CROSS := $(COMPILER_ROOT)/$(COMPILER_PREFIX)- +else +CROSS := $(COMPILER_PREFIX)- +endif MKDIR = mkdir -p TOUCH = touch -CROSS = $(TARGET_PREFIX)- -ifdef GNUARM_ROOT -CROSS = $(GNUARM_ROOT)/bin/$(TARGET_PREFIX)- -endif - CC = "$(CROSS)gcc" CXX = "$(CROSS)g++" AS = "$(CROSS)as" @@ -17,6 +20,13 @@ AR = "$(CROSS)ar" LD = "$(CROSS)g++" -nostartfiles OBJCOPY = "$(CROSS)objcopy" +# Need Wine to run OSEK System Generator (sg.exe) on Linux +# (Technically wine is not necessary on WSL; may offer wine-less WSL option in the future to save space?) +ifndef WINECMD +WINECMD := /usr/local/bin/wine-headless +endif + +# Names of utility scripts BIOSFLASH = flash-bios-firmware.sh APPFLASH = flash-bios-app.sh RXEFWFLASH = flash-rxe-firmware.sh @@ -42,7 +52,6 @@ CFLAGS = -c -ffreestanding -fsigned-char -mcpu=arm7tdmi \ ## for C++ (.cc and .cpp) ## Note that C++ RTTI is disabled by -fno-rtti option # - ifdef ECROBOT_CPP_ROOT # for .cpp CXX_PATH = $(addprefix -I ,$(ECROBOT_CPP_ROOT)/device) $(addprefix -I ,$(ECROBOT_CPP_ROOT)/util) diff --git a/nxtosek/samples_jsp_c++/Clock/Makefile b/nxtosek/samples_jsp_c++/Clock/Makefile index f3e32d3..3872df4 100755 --- a/nxtosek/samples_jsp_c++/Clock/Makefile +++ b/nxtosek/samples_jsp_c++/Clock/Makefile @@ -10,4 +10,7 @@ TOPPERS_JSP_CFG_SOURCE = ./sample.cfg O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_jsp_c++/Helloworld/Makefile b/nxtosek/samples_jsp_c++/Helloworld/Makefile index 928b4a7..8772531 100755 --- a/nxtosek/samples_jsp_c++/Helloworld/Makefile +++ b/nxtosek/samples_jsp_c++/Helloworld/Makefile @@ -12,4 +12,7 @@ TOPPERS_JSP_CFG_SOURCE = ./sample.cfg O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_jsp_c++/Sensors/Makefile b/nxtosek/samples_jsp_c++/Sensors/Makefile index 678f915..cc51022 100755 --- a/nxtosek/samples_jsp_c++/Sensors/Makefile +++ b/nxtosek/samples_jsp_c++/Sensors/Makefile @@ -10,4 +10,7 @@ TOPPERS_JSP_CFG_SOURCE = ./sample.cfg O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_jsp_c/helloworld/Makefile b/nxtosek/samples_jsp_c/helloworld/Makefile index 23889b3..516a02a 100755 --- a/nxtosek/samples_jsp_c/helloworld/Makefile +++ b/nxtosek/samples_jsp_c/helloworld/Makefile @@ -9,4 +9,7 @@ TOPPERS_JSP_CFG_SOURCE = ./helloworld.cfg # Don't modify below part O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_jsp_c/nxtway_gs/Makefile b/nxtosek/samples_jsp_c/nxtway_gs/Makefile index 9118aea..97a612a 100755 --- a/nxtosek/samples_jsp_c/nxtway_gs/Makefile +++ b/nxtosek/samples_jsp_c/nxtway_gs/Makefile @@ -21,4 +21,7 @@ TOPPERS_JSP_CFG_SOURCE = ./nxtway_gs.cfg # below part should not be modified O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c++/cc/PSPNxTest/Makefile b/nxtosek/samples_osek_c++/cc/PSPNxTest/Makefile index caf202a..118c105 100755 --- a/nxtosek/samples_osek_c++/cc/PSPNxTest/Makefile +++ b/nxtosek/samples_osek_c++/cc/PSPNxTest/Makefile @@ -30,4 +30,7 @@ C_OPTIMISATION_FLAGS = -Os O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c++/cc/cpptest/Makefile b/nxtosek/samples_osek_c++/cc/cpptest/Makefile index ae9720d..3e6275a 100755 --- a/nxtosek/samples_osek_c++/cc/cpptest/Makefile +++ b/nxtosek/samples_osek_c++/cc/cpptest/Makefile @@ -30,4 +30,7 @@ C_OPTIMISATION_FLAGS = -Os O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c++/cc/cpptest1/Makefile b/nxtosek/samples_osek_c++/cc/cpptest1/Makefile index 3f87ba6..bc3efa5 100755 --- a/nxtosek/samples_osek_c++/cc/cpptest1/Makefile +++ b/nxtosek/samples_osek_c++/cc/cpptest1/Makefile @@ -27,4 +27,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./cpptest1.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c++/cc/smartPtrTest/Makefile b/nxtosek/samples_osek_c++/cc/smartPtrTest/Makefile index a1225f0..6d0ae24 100755 --- a/nxtosek/samples_osek_c++/cc/smartPtrTest/Makefile +++ b/nxtosek/samples_osek_c++/cc/smartPtrTest/Makefile @@ -34,4 +34,7 @@ BUILD_MODE = ROM_ONLY O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c++/cc/sprite_anime/Makefile b/nxtosek/samples_osek_c++/cc/sprite_anime/Makefile index c45a22c..8e62468 100755 --- a/nxtosek/samples_osek_c++/cc/sprite_anime/Makefile +++ b/nxtosek/samples_osek_c++/cc/sprite_anime/Makefile @@ -14,4 +14,7 @@ SPR_SOURCES = \ ./sprites/shiki_breathe.spr O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c++/cc/sprite_devl/Makefile b/nxtosek/samples_osek_c++/cc/sprite_devl/Makefile index 7a7dddd..228d73e 100755 --- a/nxtosek/samples_osek_c++/cc/sprite_devl/Makefile +++ b/nxtosek/samples_osek_c++/cc/sprite_devl/Makefile @@ -21,4 +21,7 @@ SPR_SOURCES = \ C_OPTIMISATION_FLAGS = -Os O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c++/cc/sprite_text/Makefile b/nxtosek/samples_osek_c++/cc/sprite_text/Makefile index 5924601..b1e70e1 100755 --- a/nxtosek/samples_osek_c++/cc/sprite_text/Makefile +++ b/nxtosek/samples_osek_c++/cc/sprite_text/Makefile @@ -11,4 +11,7 @@ SPR_SOURCES = \ ./sprites/rocks.spr \ O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c++/cc/turtlebot/Makefile b/nxtosek/samples_osek_c++/cc/turtlebot/Makefile index a98816d..9efb120 100755 --- a/nxtosek/samples_osek_c++/cc/turtlebot/Makefile +++ b/nxtosek/samples_osek_c++/cc/turtlebot/Makefile @@ -27,4 +27,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./avoid.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c++/cpp/BTConnection/Makefile b/nxtosek/samples_osek_c++/cpp/BTConnection/Makefile index b13ea1b..c838eb7 100755 --- a/nxtosek/samples_osek_c++/cpp/BTConnection/Makefile +++ b/nxtosek/samples_osek_c++/cpp/BTConnection/Makefile @@ -12,4 +12,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/BluetoothDaq/Makefile b/nxtosek/samples_osek_c++/cpp/BluetoothDaq/Makefile index b9d1460..6ab2107 100755 --- a/nxtosek/samples_osek_c++/cpp/BluetoothDaq/Makefile +++ b/nxtosek/samples_osek_c++/cpp/BluetoothDaq/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/BluetoothEcho/Makefile b/nxtosek/samples_osek_c++/cpp/BluetoothEcho/Makefile index 2c5032e..628bbb3 100755 --- a/nxtosek/samples_osek_c++/cpp/BluetoothEcho/Makefile +++ b/nxtosek/samples_osek_c++/cpp/BluetoothEcho/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/BluetoothGamePad/Makefile b/nxtosek/samples_osek_c++/cpp/BluetoothGamePad/Makefile index 985ae92..da759b1 100755 --- a/nxtosek/samples_osek_c++/cpp/BluetoothGamePad/Makefile +++ b/nxtosek/samples_osek_c++/cpp/BluetoothGamePad/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/BluetoothInformation/Makefile b/nxtosek/samples_osek_c++/cpp/BluetoothInformation/Makefile index 18e2d3a..20fa66d 100755 --- a/nxtosek/samples_osek_c++/cpp/BluetoothInformation/Makefile +++ b/nxtosek/samples_osek_c++/cpp/BluetoothInformation/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/BluetoothSetFactorySettings/Makefile b/nxtosek/samples_osek_c++/cpp/BluetoothSetFactorySettings/Makefile index f130dbf..64e2301 100755 --- a/nxtosek/samples_osek_c++/cpp/BluetoothSetFactorySettings/Makefile +++ b/nxtosek/samples_osek_c++/cpp/BluetoothSetFactorySettings/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/BmpFileDraw/Makefile b/nxtosek/samples_osek_c++/cpp/BmpFileDraw/Makefile index 209b630..63ee542 100755 --- a/nxtosek/samples_osek_c++/cpp/BmpFileDraw/Makefile +++ b/nxtosek/samples_osek_c++/cpp/BmpFileDraw/Makefile @@ -29,4 +29,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/Camera/Makefile b/nxtosek/samples_osek_c++/cpp/Camera/Makefile index ad96743..87c012c 100755 --- a/nxtosek/samples_osek_c++/cpp/Camera/Makefile +++ b/nxtosek/samples_osek_c++/cpp/Camera/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/Clock/Makefile b/nxtosek/samples_osek_c++/cpp/Clock/Makefile index 8da87e8..7406f84 100755 --- a/nxtosek/samples_osek_c++/cpp/Clock/Makefile +++ b/nxtosek/samples_osek_c++/cpp/Clock/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/ConstDevice/Makefile b/nxtosek/samples_osek_c++/cpp/ConstDevice/Makefile index 96d3997..13b292f 100755 --- a/nxtosek/samples_osek_c++/cpp/ConstDevice/Makefile +++ b/nxtosek/samples_osek_c++/cpp/ConstDevice/Makefile @@ -11,4 +11,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/DeviceAssert/Makefile b/nxtosek/samples_osek_c++/cpp/DeviceAssert/Makefile index 7db7ffb..6370e68 100755 --- a/nxtosek/samples_osek_c++/cpp/DeviceAssert/Makefile +++ b/nxtosek/samples_osek_c++/cpp/DeviceAssert/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/ExecNXTBIOS/Makefile b/nxtosek/samples_osek_c++/cpp/ExecNXTBIOS/Makefile index fd6b617..5626fe9 100755 --- a/nxtosek/samples_osek_c++/cpp/ExecNXTBIOS/Makefile +++ b/nxtosek/samples_osek_c++/cpp/ExecNXTBIOS/Makefile @@ -13,4 +13,7 @@ USER_DEF = NO_RUN_ENTER_STOP_EXIT O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/Helloworld/Makefile b/nxtosek/samples_osek_c++/cpp/Helloworld/Makefile index fca61da..9e339c1 100755 --- a/nxtosek/samples_osek_c++/cpp/Helloworld/Makefile +++ b/nxtosek/samples_osek_c++/cpp/Helloworld/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/HiTechnicSensors/Makefile b/nxtosek/samples_osek_c++/cpp/HiTechnicSensors/Makefile index e9a7d1a..2827553 100755 --- a/nxtosek/samples_osek_c++/cpp/HiTechnicSensors/Makefile +++ b/nxtosek/samples_osek_c++/cpp/HiTechnicSensors/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/LCD/Makefile b/nxtosek/samples_osek_c++/cpp/LCD/Makefile index 40e9cdf..b2b8195 100755 --- a/nxtosek/samples_osek_c++/cpp/LCD/Makefile +++ b/nxtosek/samples_osek_c++/cpp/LCD/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/MiscDevices/Makefile b/nxtosek/samples_osek_c++/cpp/MiscDevices/Makefile index 68fd642..b0660fe 100755 --- a/nxtosek/samples_osek_c++/cpp/MiscDevices/Makefile +++ b/nxtosek/samples_osek_c++/cpp/MiscDevices/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/Motor/Makefile b/nxtosek/samples_osek_c++/cpp/Motor/Makefile index 3595e50..3d9b35a 100755 --- a/nxtosek/samples_osek_c++/cpp/Motor/Makefile +++ b/nxtosek/samples_osek_c++/cpp/Motor/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/NXTway_GS++/Makefile b/nxtosek/samples_osek_c++/cpp/NXTway_GS++/Makefile index c5fba77..16a3a99 100755 --- a/nxtosek/samples_osek_c++/cpp/NXTway_GS++/Makefile +++ b/nxtosek/samples_osek_c++/cpp/NXTway_GS++/Makefile @@ -27,4 +27,7 @@ TOPPERS_OSEK_OIL_SOURCE = sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/NXTway_LT/Makefile b/nxtosek/samples_osek_c++/cpp/NXTway_LT/Makefile index 105a589..06e04b1 100755 --- a/nxtosek/samples_osek_c++/cpp/NXTway_LT/Makefile +++ b/nxtosek/samples_osek_c++/cpp/NXTway_LT/Makefile @@ -30,4 +30,7 @@ O_PATH ?= build USER_O_PATH = ./$(NXTWAY_GS_DIR) # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/New/Makefile b/nxtosek/samples_osek_c++/cpp/New/Makefile index 59ed3d0..3efcf2b 100755 --- a/nxtosek/samples_osek_c++/cpp/New/Makefile +++ b/nxtosek/samples_osek_c++/cpp/New/Makefile @@ -10,4 +10,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/Nxt/Makefile b/nxtosek/samples_osek_c++/cpp/Nxt/Makefile index 58ff86b..d0d973b 100755 --- a/nxtosek/samples_osek_c++/cpp/Nxt/Makefile +++ b/nxtosek/samples_osek_c++/cpp/Nxt/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/Nxt2/Makefile b/nxtosek/samples_osek_c++/cpp/Nxt2/Makefile index 41646a5..d908c9f 100755 --- a/nxtosek/samples_osek_c++/cpp/Nxt2/Makefile +++ b/nxtosek/samples_osek_c++/cpp/Nxt2/Makefile @@ -13,4 +13,7 @@ USER_DEF = NO_RUN_ENTER_STOP_EXIT O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/NxtColorSensor/Makefile b/nxtosek/samples_osek_c++/cpp/NxtColorSensor/Makefile index 8c8ed37..5f7ace0 100755 --- a/nxtosek/samples_osek_c++/cpp/NxtColorSensor/Makefile +++ b/nxtosek/samples_osek_c++/cpp/NxtColorSensor/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/NxtSensors/Makefile b/nxtosek/samples_osek_c++/cpp/NxtSensors/Makefile index 7c0f47a..1641c95 100755 --- a/nxtosek/samples_osek_c++/cpp/NxtSensors/Makefile +++ b/nxtosek/samples_osek_c++/cpp/NxtSensors/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/OsekCom/Makefile b/nxtosek/samples_osek_c++/cpp/OsekCom/Makefile index ec6125e..ae2dbaf 100755 --- a/nxtosek/samples_osek_c++/cpp/OsekCom/Makefile +++ b/nxtosek/samples_osek_c++/cpp/OsekCom/Makefile @@ -11,4 +11,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/PSPNx/Makefile b/nxtosek/samples_osek_c++/cpp/PSPNx/Makefile index 270e6cc..1acf200 100755 --- a/nxtosek/samples_osek_c++/cpp/PSPNx/Makefile +++ b/nxtosek/samples_osek_c++/cpp/PSPNx/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/RS485/Makefile b/nxtosek/samples_osek_c++/cpp/RS485/Makefile index 1d77d2a..6d806a4 100755 --- a/nxtosek/samples_osek_c++/cpp/RS485/Makefile +++ b/nxtosek/samples_osek_c++/cpp/RS485/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/SmartPointer/Makefile b/nxtosek/samples_osek_c++/cpp/SmartPointer/Makefile index 558e296..a2740f2 100755 --- a/nxtosek/samples_osek_c++/cpp/SmartPointer/Makefile +++ b/nxtosek/samples_osek_c++/cpp/SmartPointer/Makefile @@ -28,4 +28,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/Speaker/Makefile b/nxtosek/samples_osek_c++/cpp/Speaker/Makefile index 7976f91..4fc9e4a 100755 --- a/nxtosek/samples_osek_c++/cpp/Speaker/Makefile +++ b/nxtosek/samples_osek_c++/cpp/Speaker/Makefile @@ -14,4 +14,7 @@ TOPPERS_OSEK_OIL_SOURCE = sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/SpeedTest/Makefile b/nxtosek/samples_osek_c++/cpp/SpeedTest/Makefile index 9706d13..326c58a 100755 --- a/nxtosek/samples_osek_c++/cpp/SpeedTest/Makefile +++ b/nxtosek/samples_osek_c++/cpp/SpeedTest/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/TribotRC/Makefile b/nxtosek/samples_osek_c++/cpp/TribotRC/Makefile index 5f6b04d..c2ff137 100755 --- a/nxtosek/samples_osek_c++/cpp/TribotRC/Makefile +++ b/nxtosek/samples_osek_c++/cpp/TribotRC/Makefile @@ -23,4 +23,7 @@ O_PATH ?= build USER_O_PATH = ./$(NXTWAY_GS_DIR) # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c++/cpp/USB/Makefile b/nxtosek/samples_osek_c++/cpp/USB/Makefile index 4755d68..31d6d95 100755 --- a/nxtosek/samples_osek_c++/cpp/USB/Makefile +++ b/nxtosek/samples_osek_c++/cpp/USB/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build # makefile for C++(.cpp) build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot++.mak diff --git a/nxtosek/samples_osek_c/alarmManualTest/Makefile b/nxtosek/samples_osek_c/alarmManualTest/Makefile index 56efa16..41770a5 100755 --- a/nxtosek/samples_osek_c/alarmManualTest/Makefile +++ b/nxtosek/samples_osek_c/alarmManualTest/Makefile @@ -5,5 +5,8 @@ TARGET_SOURCES = \ TOPPERS_OSEK_OIL_SOURCE = ./AlarmManualTest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/alarmtest/Makefile b/nxtosek/samples_osek_c/alarmtest/Makefile index 8abab4f..d759922 100755 --- a/nxtosek/samples_osek_c/alarmtest/Makefile +++ b/nxtosek/samples_osek_c/alarmtest/Makefile @@ -6,5 +6,8 @@ TOPPERS_OSEK_OIL_SOURCE := ./AlarmTest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/anime/Makefile b/nxtosek/samples_osek_c/anime/Makefile index 28fcd34..1db94b2 100755 --- a/nxtosek/samples_osek_c/anime/Makefile +++ b/nxtosek/samples_osek_c/anime/Makefile @@ -126,4 +126,7 @@ BUILD_MODE = ROM_ONLY O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/biped_robot/Makefile b/nxtosek/samples_osek_c/biped_robot/Makefile index f012f4c..75a5fd4 100755 --- a/nxtosek/samples_osek_c/biped_robot/Makefile +++ b/nxtosek/samples_osek_c/biped_robot/Makefile @@ -13,4 +13,7 @@ USER_INC_PATH = $(NXTe_ROOT) O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/bmptest/Makefile b/nxtosek/samples_osek_c/bmptest/Makefile index be29c17..93533d6 100755 --- a/nxtosek/samples_osek_c/bmptest/Makefile +++ b/nxtosek/samples_osek_c/bmptest/Makefile @@ -23,4 +23,7 @@ BMP_SOURCES := \ O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/btecho/Makefile b/nxtosek/samples_osek_c/btecho/Makefile index 936a4a5..d3d3d6f 100755 --- a/nxtosek/samples_osek_c/btecho/Makefile +++ b/nxtosek/samples_osek_c/btecho/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./btecho.oil # Don't modify below part O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/btinfo/Makefile b/nxtosek/samples_osek_c/btinfo/Makefile index dc4c9ab..c095b09 100755 --- a/nxtosek/samples_osek_c/btinfo/Makefile +++ b/nxtosek/samples_osek_c/btinfo/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./btinfo.oil # Don't modify below part O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/btmaster/Makefile b/nxtosek/samples_osek_c/btmaster/Makefile index 7accb0b..e55e8a8 100755 --- a/nxtosek/samples_osek_c/btmaster/Makefile +++ b/nxtosek/samples_osek_c/btmaster/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./btmaster.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/btslave/Makefile b/nxtosek/samples_osek_c/btslave/Makefile index bf90bcf..3b3a1de 100755 --- a/nxtosek/samples_osek_c/btslave/Makefile +++ b/nxtosek/samples_osek_c/btslave/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./btslave.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/cal_hitechcolor/Makefile b/nxtosek/samples_osek_c/cal_hitechcolor/Makefile index 43812c1..212e6b8 100755 --- a/nxtosek/samples_osek_c/cal_hitechcolor/Makefile +++ b/nxtosek/samples_osek_c/cal_hitechcolor/Makefile @@ -4,4 +4,7 @@ TARGET_SOURCES = ./cal_hitechcolor.c TOPPERS_OSEK_OIL_SOURCE = ./cal_hitechcolor.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/comtest/Makefile b/nxtosek/samples_osek_c/comtest/Makefile index 94267fc..67111b5 100755 --- a/nxtosek/samples_osek_c/comtest/Makefile +++ b/nxtosek/samples_osek_c/comtest/Makefile @@ -7,4 +7,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./comtest.oil # Don't modify below part O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/datalogging/Makefile b/nxtosek/samples_osek_c/datalogging/Makefile index 6a29f3f..a176af7 100755 --- a/nxtosek/samples_osek_c/datalogging/Makefile +++ b/nxtosek/samples_osek_c/datalogging/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./datalogging.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/dynamicMemoryTest/Makefile b/nxtosek/samples_osek_c/dynamicMemoryTest/Makefile index 8125222..e92834a 100755 --- a/nxtosek/samples_osek_c/dynamicMemoryTest/Makefile +++ b/nxtosek/samples_osek_c/dynamicMemoryTest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./dynamicMemoryTest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/eds/Makefile b/nxtosek/samples_osek_c/eds/Makefile index 73c4bb9..1ae8328 100755 --- a/nxtosek/samples_osek_c/eds/Makefile +++ b/nxtosek/samples_osek_c/eds/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./eds.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/eventtest/Makefile b/nxtosek/samples_osek_c/eventtest/Makefile index f067297..1b9a755 100755 --- a/nxtosek/samples_osek_c/eventtest/Makefile +++ b/nxtosek/samples_osek_c/eventtest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./EventTest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/executeNXTBIOS/Makefile b/nxtosek/samples_osek_c/executeNXTBIOS/Makefile index d34d166..e18b07e 100755 --- a/nxtosek/samples_osek_c/executeNXTBIOS/Makefile +++ b/nxtosek/samples_osek_c/executeNXTBIOS/Makefile @@ -10,4 +10,7 @@ USER_DEF = NO_RUN_ENTER_STOP_EXIT # Don't modify below part O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/generici2ctest/Makefile b/nxtosek/samples_osek_c/generici2ctest/Makefile index f52f858..81665a0 100755 --- a/nxtosek/samples_osek_c/generici2ctest/Makefile +++ b/nxtosek/samples_osek_c/generici2ctest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./genericI2Ctest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/helloworld/Makefile b/nxtosek/samples_osek_c/helloworld/Makefile index 6a0adc9..fe3b483 100755 --- a/nxtosek/samples_osek_c/helloworld/Makefile +++ b/nxtosek/samples_osek_c/helloworld/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./helloworld.oil # Don't modify below part O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/hitechtest/Makefile b/nxtosek/samples_osek_c/hitechtest/Makefile index adf7549..b82f589 100755 --- a/nxtosek/samples_osek_c/hitechtest/Makefile +++ b/nxtosek/samples_osek_c/hitechtest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./hitechtest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/hitechtest2/Makefile b/nxtosek/samples_osek_c/hitechtest2/Makefile index bff6455..18e17e2 100755 --- a/nxtosek/samples_osek_c/hitechtest2/Makefile +++ b/nxtosek/samples_osek_c/hitechtest2/Makefile @@ -10,4 +10,7 @@ TARGET_SOURCES = ./hitechtest.c TOPPERS_OSEK_OIL_SOURCE = ./hitechtest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/hitechtest3/Makefile b/nxtosek/samples_osek_c/hitechtest3/Makefile index 8c57ff7..51de75a 100755 --- a/nxtosek/samples_osek_c/hitechtest3/Makefile +++ b/nxtosek/samples_osek_c/hitechtest3/Makefile @@ -10,4 +10,7 @@ TARGET_SOURCES = ./hitechtest.c TOPPERS_OSEK_OIL_SOURCE = ./hitechtest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/i2cwritetest/Makefile b/nxtosek/samples_osek_c/i2cwritetest/Makefile index 29a520e..67ae11f 100755 --- a/nxtosek/samples_osek_c/i2cwritetest/Makefile +++ b/nxtosek/samples_osek_c/i2cwritetest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./i2cwritetest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/largeprgtest/Makefile b/nxtosek/samples_osek_c/largeprgtest/Makefile index 0539982..eb5d5a8 100755 --- a/nxtosek/samples_osek_c/largeprgtest/Makefile +++ b/nxtosek/samples_osek_c/largeprgtest/Makefile @@ -12,4 +12,7 @@ BUILD_MODE = ROM_ONLY O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/mathtest/Makefile b/nxtosek/samples_osek_c/mathtest/Makefile index 70b53af..f02f6e1 100755 --- a/nxtosek/samples_osek_c/mathtest/Makefile +++ b/nxtosek/samples_osek_c/mathtest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./mathtest.oil # Don't modify below part O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/multipleI2Ctest/Makefile b/nxtosek/samples_osek_c/multipleI2Ctest/Makefile index a9760be..ab188ea 100755 --- a/nxtosek/samples_osek_c/multipleI2Ctest/Makefile +++ b/nxtosek/samples_osek_c/multipleI2Ctest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./sample.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/noRunEnterStopExit/Makefile b/nxtosek/samples_osek_c/noRunEnterStopExit/Makefile index 3547841..a56ddf5 100755 --- a/nxtosek/samples_osek_c/noRunEnterStopExit/Makefile +++ b/nxtosek/samples_osek_c/noRunEnterStopExit/Makefile @@ -10,4 +10,7 @@ USER_DEF = NO_RUN_ENTER_STOP_EXIT # Don't modify below part O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/noRunEnterStopExitAndBluetooth/Makefile b/nxtosek/samples_osek_c/noRunEnterStopExitAndBluetooth/Makefile index 9d2a318..4939baf 100755 --- a/nxtosek/samples_osek_c/noRunEnterStopExitAndBluetooth/Makefile +++ b/nxtosek/samples_osek_c/noRunEnterStopExitAndBluetooth/Makefile @@ -10,4 +10,7 @@ USER_DEF = NO_RUN_ENTER_STOP_EXIT # Don't modify below part O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/nxtbiostest/Makefile b/nxtosek/samples_osek_c/nxtbiostest/Makefile index c5cc4cf..1a3cfb5 100755 --- a/nxtosek/samples_osek_c/nxtbiostest/Makefile +++ b/nxtosek/samples_osek_c/nxtbiostest/Makefile @@ -12,4 +12,7 @@ BUILD_MODE = ROM_ONLY # Don't modify below part O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/nxtcolorsensortest/Makefile b/nxtosek/samples_osek_c/nxtcolorsensortest/Makefile index 19c8dc6..0db1fd5 100755 --- a/nxtosek/samples_osek_c/nxtcolorsensortest/Makefile +++ b/nxtosek/samples_osek_c/nxtcolorsensortest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./nxtcolorsensortest.oil # Don't modify below part O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/nxte/Makefile b/nxtosek/samples_osek_c/nxte/Makefile index 18705b6..14ab2fd 100755 --- a/nxtosek/samples_osek_c/nxte/Makefile +++ b/nxtosek/samples_osek_c/nxte/Makefile @@ -7,4 +7,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./nxte_test.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/nxte22/Makefile b/nxtosek/samples_osek_c/nxte22/Makefile index 21a1a4a..e13a8ac 100755 --- a/nxtosek/samples_osek_c/nxte22/Makefile +++ b/nxtosek/samples_osek_c/nxte22/Makefile @@ -7,4 +7,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./nxte22_test.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/nxtgt/Makefile b/nxtosek/samples_osek_c/nxtgt/Makefile index 20ed127..455a728 100755 --- a/nxtosek/samples_osek_c/nxtgt/Makefile +++ b/nxtosek/samples_osek_c/nxtgt/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./nxtgt.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/nxtmmxtest/Makefile b/nxtosek/samples_osek_c/nxtmmxtest/Makefile index eb64e0d..766878f 100755 --- a/nxtosek/samples_osek_c/nxtmmxtest/Makefile +++ b/nxtosek/samples_osek_c/nxtmmxtest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./nxtmmx.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/nxtremocon/Makefile b/nxtosek/samples_osek_c/nxtremocon/Makefile index 8db482c..5044e4c 100755 --- a/nxtosek/samples_osek_c/nxtremocon/Makefile +++ b/nxtosek/samples_osek_c/nxtremocon/Makefile @@ -9,4 +9,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./ecrobot.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/nxtway_gs/Makefile b/nxtosek/samples_osek_c/nxtway_gs/Makefile index 2787cbb..e776d20 100755 --- a/nxtosek/samples_osek_c/nxtway_gs/Makefile +++ b/nxtosek/samples_osek_c/nxtway_gs/Makefile @@ -18,4 +18,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./nxtway_gs.oil # below part should not be modified O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/petest/Makefile b/nxtosek/samples_osek_c/petest/Makefile index 3af0b99..c2349fb 100755 --- a/nxtosek/samples_osek_c/petest/Makefile +++ b/nxtosek/samples_osek_c/petest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./PETest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/rcxtest/Makefile b/nxtosek/samples_osek_c/rcxtest/Makefile index 2950346..9f0e366 100755 --- a/nxtosek/samples_osek_c/rcxtest/Makefile +++ b/nxtosek/samples_osek_c/rcxtest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./rcxtest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/resourcetest/Makefile b/nxtosek/samples_osek_c/resourcetest/Makefile index 03f076f..39adf05 100755 --- a/nxtosek/samples_osek_c/resourcetest/Makefile +++ b/nxtosek/samples_osek_c/resourcetest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./ResourceTest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/rms/Makefile b/nxtosek/samples_osek_c/rms/Makefile index 202fa78..fb5b84c 100755 --- a/nxtosek/samples_osek_c/rms/Makefile +++ b/nxtosek/samples_osek_c/rms/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./rms.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/rs485test/Makefile b/nxtosek/samples_osek_c/rs485test/Makefile index dac7451..cd8ab97 100755 --- a/nxtosek/samples_osek_c/rs485test/Makefile +++ b/nxtosek/samples_osek_c/rs485test/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./rs485test.oil # Don't modify below part O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/sonartest/Makefile b/nxtosek/samples_osek_c/sonartest/Makefile index f86016d..27edc52 100755 --- a/nxtosek/samples_osek_c/sonartest/Makefile +++ b/nxtosek/samples_osek_c/sonartest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./sonartest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/soundtest/Makefile b/nxtosek/samples_osek_c/soundtest/Makefile index 883601e..35ac04b 100755 --- a/nxtosek/samples_osek_c/soundtest/Makefile +++ b/nxtosek/samples_osek_c/soundtest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./soundtest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/speedtest/Makefile b/nxtosek/samples_osek_c/speedtest/Makefile index e68f26d..b92578e 100755 --- a/nxtosek/samples_osek_c/speedtest/Makefile +++ b/nxtosek/samples_osek_c/speedtest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./speedtest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/test/Makefile b/nxtosek/samples_osek_c/test/Makefile index 6a0adc9..fe3b483 100755 --- a/nxtosek/samples_osek_c/test/Makefile +++ b/nxtosek/samples_osek_c/test/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE = ./helloworld.oil # Don't modify below part O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/tetrix/Makefile b/nxtosek/samples_osek_c/tetrix/Makefile index f621c16..d25cc01 100755 --- a/nxtosek/samples_osek_c/tetrix/Makefile +++ b/nxtosek/samples_osek_c/tetrix/Makefile @@ -5,4 +5,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./tetrix.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/tttest/Makefile b/nxtosek/samples_osek_c/tttest/Makefile index 40d84ed..d94f0e2 100755 --- a/nxtosek/samples_osek_c/tttest/Makefile +++ b/nxtosek/samples_osek_c/tttest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./TTTest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/usbtest/Makefile b/nxtosek/samples_osek_c/usbtest/Makefile index 5547062..aa7953a 100755 --- a/nxtosek/samples_osek_c/usbtest/Makefile +++ b/nxtosek/samples_osek_c/usbtest/Makefile @@ -6,4 +6,7 @@ TOPPERS_OSEK_OIL_SOURCE := ./usbtest.oil O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/wavlooptest/Makefile b/nxtosek/samples_osek_c/wavlooptest/Makefile index cffb384..2189b56 100755 --- a/nxtosek/samples_osek_c/wavlooptest/Makefile +++ b/nxtosek/samples_osek_c/wavlooptest/Makefile @@ -7,4 +7,7 @@ WAV_SOURCES := \ lego_mindstorms_nxt.wav O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/nxtosek/samples_osek_c/wavtest/Makefile b/nxtosek/samples_osek_c/wavtest/Makefile index 14e8035..1c54186 100755 --- a/nxtosek/samples_osek_c/wavtest/Makefile +++ b/nxtosek/samples_osek_c/wavtest/Makefile @@ -8,4 +8,7 @@ WAV_SOURCES := \ BUILD_MODE = ROM_ONLY O_PATH ?= build +ifndef NXTOSEK + NXTOSEK = /usr/local/src/nxtosek +endif include $(NXTOSEK)/ecrobot/ecrobot.mak diff --git a/old_dockerfile b/old_dockerfile new file mode 100755 index 0000000..a363287 --- /dev/null +++ b/old_dockerfile @@ -0,0 +1,131 @@ +############################################################################################ +# STAGE 1: Compile NXT utilities (and dependencies) for this platform +############################################################################################ +#FROM ubuntu:14.04 AS stage1 +#ARG DEBIAN_FRONTEND=noninteractive + +# Install host compiler and prereqs +#RUN apt-get update \ +# && apt-get -y --no-install-recommends install \ +# apt-transport-https build-essential texinfo unzip \ +# libgmp-dev libmpfr-dev libppl-dev libcloog-ppl-dev \ +# tk-dev ncurses-dev wget gzip tar software-properties-common \ +# xvfb gcc-4.8 gdb gdb-multiarch vim scons python3 \ +# libc-dev make autoconf libtool libusb-dev + +# Copy source code for NXT tools +#ADD src /src +#WORKDIR /src + +# Build LibUSB +#RUN tar xf /src/libusb-0.1.12.tar \ +# && mkdir -p /build/libusb \ +# && cd /build/libusb \ +# && ls /src \ +# && /src/libusb-0.1.12/configure \ +# && make CFLAGS="-Wno-error" CXXFLAGS="-Wno-error" install +# make install + +# Build LibNXT +#RUN tar xf /src/libnxt-0.3.tar \ +# && cd /src/libnxt-0.3 \ +# && scons \ +# && chmod +x ./fwflash \ +# && chmod +x ./fwexec +## cp ./fwflash $TOOLDIR/fwflash +## cp ./fwexec $TOOLDIR/fwexec + +# Build NeXTTOOl +#RUN unzip /src/bricxcc-3.3.8.10.zip \ +# && cd /src/bricxcc-3.3.8.10 \ +# && make -f nexttool.mak \ +# && chmod +x ./nexttool +## cp ./nexttool $TOOLDIR/nexttool + +# Build modified LibNXT from the LeJOS-OSEK source code +#ADD nxtosek /nxtosek +#RUN cd /nxtosek/lejos_nxj/src/libnxt \ +## && scons + +############################################################################################ +# STAGE 2: Install NXTOSEK and dependencies +############################################################################################ +FROM ubuntu:20.04 AS stage2 +ARG DEBIAN_FRONTEND=noninteractive +ARG USERNAME=nxtosek +ARG USER_UID=1000 +ARG USER_GID=$USER_UID +ENV NXTOSEK=/home/$USERNAME +ENV NXT_TOOLS_DIR=/usr/local/bin +ENV DISPLAY=:0 +ENV WINEARCH=win32 +ENV WINEDLLOVERRIDES="mscoree,mshtml=" + +# Load 3rd-party source code into image +ADD src /src + +# Add new nxtosek user with sudo privileges and no password +RUN groupadd -f --gid $USER_GID $USERNAME \ + && useradd --create-home --uid $USER_UID --gid $USER_GID -m $USERNAME \ + && apt-get update \ + && apt-get install -y --no-install-recommends sudo \ + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME \ +# Add user permissions for most USB devices \ + && usermod -aG plugdev nxtosek \ + && usermod -aG dialout nxtosek \ + && usermod -aG users nxtosek \ +# Packages required to install more packages \ + && apt-get -y install --no-install-recommends \ + make vim wget gnupg software-properties-common \ +# Software required for building 3rd party tools \ + && apt-get -y install --no-install-recommends \ + gcc g++ build-essential fpc libusb-0.1-4 libusb-dev scons python \ +# Build NeXTTool \ + && cd /src/bricxcc/code \ + && make -f nexttool.mak \ + && chmod +x nexttool \ + && cp nexttool ${NXT_TOOLS_DIR}/nexttool \ +# Build LibNXT \ + && cd /src/libnxt \ + && scons \ + && chmod +x ./fwflash \ + && chmod +x ./fwexec \ + && cp ./fwflash ${NXT_TOOLS_DIR}/fwflash \ + && cp ./fwexec ${NXT_TOOLS_DIR}/fwexec \ +# Install ARM cross-compiler and debuggers \ + && apt-get -y install --install-recommends \ + usbutils gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib gdb-multiarch openocd \ +# Add bluetooth support \ + && apt-get install -y --no-install-recommends \ + bluez bluetooth \ +# Install wine and Xvfb virtual frame buffer (required for wine-headless) \ + && dpkg --add-architecture i386 \ + && wget -nc https://dl.winehq.org/wine-builds/winehq.key \ + && apt-key add winehq.key \ + && rm winehq.key \ + && apt-add-repository https://dl.winehq.org/wine-builds/ubuntu \ + && apt-get update \ + && apt-get -y --no-install-recommends install xvfb winehq-stable \ +# Clean up to save space in image \ + && apt-get autoremove -y \ + && apt-get clean -y \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /src + +# Install scripts into NXT_TOOLS_DIR +ADD scripts/include ${NXT_TOOLS_DIR} + +# Install NXTOSEK +ADD nxtosek ${NXTOSEK} +COPY VERSION README.md ${NXTOSEK}/ + +# Switch to NXTOSEK user +WORKDIR ${NXTOSEK} +USER ${USERNAME} + +# Initialize a 32-bit Wine install +RUN wine-headless wineboot + + + diff --git a/scripts/bash_release.sh b/scripts/bash_release.sh deleted file mode 100755 index 880a209..0000000 --- a/scripts/bash_release.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -WORKING_DIR="$PWD" -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -PROJECT_ROOT="$SCRIPT_DIR/.." -VERSION=$(cat "$PROJECT_ROOT/VERSION") -WSL=$(if grep -q microsoft /proc/version; then echo 'true'; else echo 'false'; fi) - - -docker run --rm -it --privileged --entrypoint bash nxtosek:latest -#docker run --rm -it -v /dev/bus/usb:/dev/bus/usb -v /run/udev:/run/udev:ro --device=/dev/bus/usb --entrypoint bash nxtosek:latest -#docker run --rm -it -v /dev/bus/usb:/dev/bus/usb -v /run/udev:/run/udev:ro --entrypoint bash nxtosek:latest diff --git a/scripts/build_nxt_tools.sh b/scripts/build_nxt_tools.sh deleted file mode 100755 index 7675245..0000000 --- a/scripts/build_nxt_tools.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -WORKING_DIR="$PWD" -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -PROJECT_ROOT="$SCRIPT_DIR/.." -VERSION=$(cat "$PROJECT_ROOT/VERSION") -WSL=$(if grep -q microsoft /proc/version; then echo 'true'; else echo 'false'; fi) -INSTALL_DIR="/usr/local/bin" - -sudo apt-get install --no-install-recommends git subversion gcc g++ build-essential fpc libusb-0.1-4 libusb-dev scons python - -# Download BricxCC, build NeXTTool, install -mkdir -p "/tmp/bricxcc" -cd "/tmp/bricxcc" -svn checkout http://svn.code.sf.net/p/bricxcc/code/ -cd "/tmp/bricxcc/code" -make -f nexttool.mak -chmod +x nexttool -cp nexttool ${INSTALL_DIR}/nexttool -rm -rf "/tmp/bricxcc" - - -# Download LibNXT, build fwflash and fwexec, install -cd "/tmp" -git clone https://github.com/rvs/libnxt.git -cd "/tmp/libnxt" -scons -chmod +x ./fwflash -chmod +x ./fwexec -cp ./fwflash ${INSTALL_DIR}/fwflash -cp ./fwexec ${INSTALL_DIR}/fwexec -rm -rf "/tmp/libnxt" - - -cd "$WORKING_DIR" - - -echo "Script complete." -echo "Please check if nexttool, fwflash, fwexec exist in $INSTALL_DIR" -echo "and also if they work properly!" diff --git a/scripts/build_release.sh b/scripts/build_release.sh index 40d3337..3d421fd 100755 --- a/scripts/build_release.sh +++ b/scripts/build_release.sh @@ -1,33 +1,27 @@ #!/usr/bin/env bash -WORKING_DIR="$PWD" -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -PROJECT_ROOT="$SCRIPT_DIR/.." -VERSION=$(cat "$PROJECT_ROOT/VERSION") +WORKING_DIR=$PWD +SCRIPTS_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +ROOT_DIR="$(dirname "$SCRIPTS_DIR")" +CONFIG_DIR="$ROOT_DIR/config" +SRC_DIR="$ROOT_DIR/src" +VERSION=$(cat "$ROOT_DIR/VERSION") WSL=$(if grep -q microsoft /proc/version; then echo 'true'; else echo 'false'; fi) - -# Download LibNXT -cd "$PROJECT_ROOT/src" -if [ ! -d "./libnxt" ]; then - git clone https://github.com/rvs/libnxt.git -else - git pull origin master -fi -#tar -cvf libnxt.tar "libnxt" - -# Download BricxCC -mkdir -p "$PROJECT_ROOT/src/bricxcc" -cd "$PROJECT_ROOT/src/bricxcc" -svn checkout http://svn.code.sf.net/p/bricxcc/code/ -#cd "$PROJECT_ROOT/src" -#tar -cvf bricxcc.tar "bricxcc" +# Build the NXT tools locally first +echo "Building NXT tools..." +cd "$SCRIPTS_DIR" +"./install_nxt_tools.sh" # Build and save docker image -cd "$PROJECT_ROOT" -"$SCRIPT_DIR/docker-scripts/build-image-fresh.sh" nxtosek:latest -mkdir -p "$PROJECT_ROOT/docker_image" -cd "$PROJECT_ROOT/docker_image" -"$SCRIPT_DIR/docker-scripts/save-image.sh" nxtosek:latest 1G +echo "Building Docker image..." +cd "$ROOT_DIR" +#"$SCRIPTS_DIR/docker-scripts/build-image-fresh.sh" nxtosek:latest + +echo "Saving Docker image to $ROOT_DIR/docker_image..." +rm -rf "$ROOT_DIR/docker_image" +mkdir -p "$ROOT_DIR/docker_image" +cd "$ROOT_DIR/docker_image" +"$SCRIPTS_DIR/docker-scripts/save-image.sh" nxtosek:latest 1G cd "$WORKING_DIR" \ No newline at end of file diff --git a/scripts/download_release.sh b/scripts/download_release.sh index 5740dc8..b829d86 100755 --- a/scripts/download_release.sh +++ b/scripts/download_release.sh @@ -1,12 +1,15 @@ #!/usr/bin/env bash -WORKING_DIR="$PWD" -SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -PROJECT_ROOT="$SCRIPT_DIR/.." -VERSION=$(cat "$PROJECT_ROOT/VERSION") +WORKING_DIR=$PWD +SCRIPTS_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +ROOT_DIR="$(dirname "$SCRIPTS_DIR")" +CONFIG_DIR="$ROOT_DIR/config" +SRC_DIR="$ROOT_DIR/src" +VERSION=$(cat "$ROOT_DIR/VERSION") WSL=$(if grep -q microsoft /proc/version; then echo 'true'; else echo 'false'; fi) # Download the latest Docker image from github releases page -cd "$PROJECT_ROOT/docker_image" +cd "$ROOT_DIR/docker_image" +rm "nxtosek-latest.tar.part-*" wget -O "nxtosek-latest.tar.part-aa" "https://github.com/danielk-98/nxtOSEK/releases/download/v$VERSION/nxtosek-latest.tar.part-aa" wget -O "nxtosek-latest.tar.part-ab" "https://github.com/danielk-98/nxtOSEK/releases/download/v$VERSION/nxtosek-latest.tar.part-ab" wget -O "nxtosek-latest.tar.part-ac" "https://github.com/danielk-98/nxtOSEK/releases/download/v$VERSION/nxtosek-latest.tar.part-ac" @@ -16,6 +19,6 @@ wget -O "nxtosek-latest.tar.part-af" "https://github.com/danielk-98/nxtOSEK/rele # Install the image -"$SCRIPT_DIR/docker-scripts/load-image.sh" nxtosek:latest +"$SCRIPTS_DIR/docker-scripts/load-image.sh" nxtosek:latest -cd "$WORKING_DIR" \ No newline at end of file +cd "$WORKING_DIR" diff --git a/scripts/install_nxt_tools.sh b/scripts/install_nxt_tools.sh new file mode 100755 index 0000000..8befe89 --- /dev/null +++ b/scripts/install_nxt_tools.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash +WORKING_DIR=$PWD +SCRIPTS_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +ROOT_DIR="$(dirname "$SCRIPTS_DIR")" +CONFIG_DIR="$ROOT_DIR/config" +SRC_DIR="$ROOT_DIR/src" +VERSION=$(cat "$ROOT_DIR/VERSION") +WSL=$(if grep -q microsoft /proc/version; then echo 'true'; else echo 'false'; fi) + +INSTALL_DIR="/usr/local/bin" + +sudo apt-get update +sudo apt-get install --no-install-recommends git subversion gcc g++ build-essential fpc libusb-0.1-4 libusb-dev + + +# Download BricxCC, build NeXTTool, install +echo "Downloading repository: http://svn.code.sf.net/p/bricxcc/code/" +mkdir -p "$SRC_DIR/bricxcc" +cd "$SRC_DIR/bricxcc" +svn checkout http://svn.code.sf.net/p/bricxcc/code/ + +echo "Building nexttool..." +cd "$SRC_DIR/bricxcc/code" +make -f nexttool.mak +sudo cp -f "./nexttool" "$INSTALL_DIR/nexttool" + +echo "Installing nexttool to $INSTALL_DIR..." +cd "$INSTALL_DIR" +sudo chown root:root "./nexttool" +sudo chmod a+s "./nexttool" + +if [ ! -d "/home/$USER/bricxcc" ]; then + cp -r "$CONFIG_DIR/bricxcc" "/home/$USER/bricxcc" +fi + +# Download LibNXT, build fwflash and fwexec, install +if [ -x "$(command -v docker)" ]; then + echo "Downloading repository: https://github.com/rvs/libnxt.git" + cd "$SRC_DIR" + if [ ! -d "./libnxt" ]; then + git clone https://github.com/rvs/libnxt.git + else + cd "./libnxt" + git pull origin master + fi + + echo "Building libnxt..." + cd "$SRC_DIR/libnxt" + make + sudo cp -f "./out/fwflash" "$INSTALL_DIR/fwflash" + sudo cp -f "./out/fwexec" "$INSTALL_DIR/fwexec" + + echo "Installing fwexec and fwflash to $INSTALL_DIR..." + cd "$INSTALL_DIR" + sudo chown root:root "./fwflash" + sudo chmod a+s "./fwflash" + sudo chown root:root "./fwexec" + sudo chmod a+s "./fwexec" +else + echo "Could not install LibNXT (Docker not installed)." +fi + +cd "$WORKING_DIR" + diff --git a/scripts/install_toolchain.sh b/scripts/install_toolchain.sh new file mode 100755 index 0000000..57cdb68 --- /dev/null +++ b/scripts/install_toolchain.sh @@ -0,0 +1,55 @@ +#!/usr/bin/env bash +WORKING_DIR=$PWD +SCRIPTS_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +ROOT_DIR="$(dirname "$SCRIPTS_DIR")" +CONFIG_DIR="$ROOT_DIR/config" +SRC_DIR="$ROOT_DIR/src" +VERSION=$(cat "$ROOT_DIR/VERSION") +WSL=$(if grep -q microsoft /proc/version; then echo 'true'; else echo 'false'; fi) + +sudo apt-get update + +# Packages required to install more packages +sudo apt-get -y install --no-install-recommends \ + wget gnupg software-properties-common + +# Install ARM cross-compiler and debuggers +sudo apt-get -y install --install-recommends \ + make usbutils gcc-arm-none-eabi binutils-arm-none-eabi libnewlib-arm-none-eabi libstdc++-arm-none-eabi-newlib gdb-multiarch openocd + +# Add bluetooth support +sudo apt-get install -y --no-install-recommends \ + bluez bluetooth + +# Install wine-headless script +sudo cp -f "$SCRIPTS_DIR/wine-headless.sh" "/usr/local/bin/wine-headless" +sudo chmod +x "/usr/local/bin/wine-headless" + +# Install wine and Xvfb virtual frame buffer (required for wine-headless) +if [ ! -x "$(command -v wine)" ]; then + echo "Installing Wine..." + sudo dpkg --add-architecture i386 + wget -nc https://dl.winehq.org/wine-builds/winehq.key + sudo apt-key add winehq.key + rm winehq.key + sudo apt-add-repository https://dl.winehq.org/wine-builds/ubuntu + sudo apt-get update + sudo apt-get -y --no-install-recommends install xvfb winehq-stable + + # Initialize a wine install + export WINEDLLOVERRIDES="mscoree,mshtml=" + wine-headless wineboot +else + echo "It appears Wine is already installed, skipping..." +fi + +# Install nxtOSEK core files +if [ -z ${NXTOSEK+x} ]; then + NXTOSEK="/usr/local/src/nxtosek" +fi +INSTALL_DIR="$(dirname "$NXTOSEK")" + +echo "Installing nxtOSEK to $NXTOSEK..." +sudo rm -rf "$NXTOSEK" +sudo mkdir -p "$INSTALL_DIR" +sudo cp -rf "$ROOT_DIR/nxtosek" "$INSTALL_DIR" diff --git a/scripts/include/wine-headless b/scripts/wine-headless.sh similarity index 100% rename from scripts/include/wine-headless rename to scripts/wine-headless.sh diff --git a/udev/samba_event_handler.sh b/udev/samba_event_handler.sh deleted file mode 100755 index 95edf01..0000000 --- a/udev/samba_event_handler.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/env bash - -SERIAL=$1 -KERNEL=$2 -MAJOR=$3 -MINOR=$4 -CONTAINER_IDS=$(docker ps -qf ancestor=nxtosek -f status=running) - -LOGFILE_DIR="/tmp/nxt" -LOGFILE="samba-events.log" - -mkdir -p "$LOGFILE_DIR" -echo "USB Event: - ACTION: $ACTION - DEVTYPE: $DEVTYPE - KERNEL: $KERNEL - SERIAL: $SERIAL - DEVNUM: $DEVNUM - DEVNAME: $DEVNAME - DEVLINKS: $DEVLINKS - DEVPATH: $DEVPATH - MAJOR: $MAJOR - MINOR: $MINOR - Docker Containers: $CONTAINER_IDS -" >> "$LOGFILE_DIR/$LOGFILE" - -if [ $ACTION == "add" ]; then - IFS=$'\n' - CONTAINER_IDS=($CONTAINER_IDS) - for CONTAINER in ${CONTAINER_IDS[@]}; do - docker exec -u 0 $CONTAINER mknod $DEVNAME c $MAJOR $MINOR - docker exec -u 0 $CONTAINER chmod -R 777 $DEVNAME - done -fi