diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3472a16 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.vscode +build +downloads +install \ No newline at end of file diff --git a/Makefile b/Makefile index e69de29..44555f4 100644 --- a/Makefile +++ b/Makefile @@ -0,0 +1,33 @@ +export PATH := $(PATH):$(PWD)/build/arm-linux-gnueabihf/bin + +CC := gcc +CC-arm := arm-linux-gnueabihf-gcc +CFLAGS := -Wall +C_SOURCES=$(shell find ./src -name '*.c') +CPP_SOURCES :=$(shell find ./src -name '*.cpp') +RM = rm -rf +MKDIR = mkdir -p + +.PHONY: install-toolchain host target clean + +install-toolchain: + $(MKDIR) ./downloads + $(MKDIR) ./build + wget -c -O ./downloads/arm-linux-gnueabihf.tar.xz https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/arm-linux-gnueabihf/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf.tar.xz + if [ ! -d ./build/arm-linux-gnueabihf ]; then \ + tar -xf ./downloads/arm-linux-gnueabihf.tar.xz -C ./build; \ + mv ./build/gcc-linaro-7.3.1-2018.05-x86_64_arm-linux-gnueabihf ./build/arm-linux-gnueabihf; \ + fi + @echo $(PATH) + +target: $(C_SOURCES) + $(MKDIR) install + $(CC-arm) -o ./install/$@ $^ $(CFLAGS) + +host: $(C_SOURCES) + $(MKDIR) install + $(CC) -o ./install/$@ $^ $(CFLAGS) + +clean: + $(RM) $(@D)/build + $(RM) $(@D)/downloads \ No newline at end of file diff --git a/README.md b/README.md index e69de29..42cbb3b 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,8 @@ +# Relay (C++) +The Relay C++ rewrite is currently a WIP. + +# Getting Started +### Clone the Repository +`git clone https://github.com/waterloop/relay-cpp.git` +### Install the RaspberryPi ARM cross-compiler +Navigate to project directory, then run the command `make` to install the toolchain.