-
Notifications
You must be signed in to change notification settings - Fork 0
Cu-2zvpafe/create makefile #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| .vscode | ||
| build | ||
| downloads | ||
| install |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like calling this directory |
||
| $(CC-arm) -o ./install/$@ $^ $(CFLAGS) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should work for now, but the typical way to do this is to compile each |
||
|
|
||
| host: $(C_SOURCES) | ||
| $(MKDIR) install | ||
| $(CC) -o ./install/$@ $^ $(CFLAGS) | ||
|
|
||
| clean: | ||
| $(RM) $(@D)/build | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think |
||
| $(RM) $(@D)/downloads | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we consider moving this
downloadsfolder into./build? I'm not sure I like it in the main directory like this.Also, consider making variables defined near the top of the file for these directories. For example:
BUILD_DIR = ./build