-
Notifications
You must be signed in to change notification settings - Fork 30
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
Suggestion: accommodate multiple simultaneous toolchain versions #4
Comments
Regardless if you agree to change the Makefile PREFIX, could you change the syntax to do not overwrite previously defined environment variables? PREFIX ?= $(HOME)/avr32-tools/ I did try such a definition, and together with the following lines before calling make, I think I obtained both simplicity in the Makefile and enough configurability of the build process. Liviu Numeric representation of today, like 20110704TODAY= Keep different versions in different foldersTODAY_DIR=$HOME/Developer/Cross/avr32-tools-$TODAY Remove the destination folder, in case it existsif [ -d $TODAY_DIR ] Pass the custom destination folder to the make processexport PREFIX=$TODAY_DIR/ |
This sounds good. I could also do this by git revision for those who have checked out from the repository: This way the generated versions would be particular to the version the repo is at. The only major downside is that they're SHA-1 hashes so they don't really convey any sort of progression through time, but the file creation dates should provide that info. It could also symlink avr32-tools to whatever the latest version is that's been installed with either scheme. I'll need to work out the logic for this a bit maybe. Tarball downloads don't have revision info except in the directory that gets created when unzipping/untarring... |
Could you try the suggested question mark syntax? PREFIX ?= $(HOME)/avr32-tools-$(GIT_REV)/ This would allow to export through the environment any custom folder. Liviu |
I've now adjusted it to use a git revision, falling back to date if there is not .git directory or git is not installed. One can also specify prefix at the command line. It doesn't yet do any symlinking automatically, but I suppose I could add that to the message at the end as a suggestion for the user (a message is displayed on successful build showing the install location and providing a suggested export PATH=.. line) |
In order to be able to maintain older versions of my projects, I sometimes need to keep older versions of the toolchains around.
The way I do this is to append the current date to the folder name of the toolchain.
For example, for the avr32 toolchain I used avr32-tools-20110702 instead of avr32-tools.
I also prefer to organise all my cross compiling toolchains in a folder named Cross.
Since my Cross compiling toolchains are not alone, my development environment also includes multiple Eclipse instances (located in a folder call Eclipses), so I keep everything in $HOME/Developer.
The patch I applied to your Makefile is:
PREFIX = $(HOME)/avr32-tools/
TODAY =$(HOME)/Developer/Cross/avr32-tools-$ (TODAY)/
date "+%Y%m%d"
PREFIX =
If you think such a more structured folder hierarchy is useful, I would be happy to see it used in your Makefile too (same for the ARM build).
Thank you,
Liviu
The text was updated successfully, but these errors were encountered: