From: Enoch <ix...@ho...> - 2012-11-20 03:31:22
|
Hello Matthias, Can you insert the SVN revision no. into Amforth ID message i.e., "amforth r1304..." instead of "amforth 4.9..." (as is fit for a release). Thank you, Enoch. |
From: Matthias T. <mt...@we...> - 2012-11-20 18:14:07
|
Hi Eoch, > Can you insert the SVN revision no. into Amforth ID message i.e., > "amforth r1304..." instead of "amforth 4.9..." (as is fit for a > release). Well, lets have a short look at that task The command svnversion gives the revision number of the last commit. But: Of which file / directory? You can only change the build machine to call svnversion in the top level amforth directory (where the appl/template and the core/ directories are). mt@ayla:~/amforth/trunk$ svnversion -c 494:1304 mt@ayla:~/amforth/trunk$ svnversion 1268:1304 mt@ayla:~/amforth/trunk$ This gives you a number (or two, seems to depend on the version of svnversion itself), which you need to incorporate into your application somehow. e.g. a word like applturnkey that gets modified during the hex file generation: ; ( -- n ) utilities ; R( -- ) VE_SVN_REV: .dw $ff0b .db "svn-version",0 .dw VE_HEAD .set VE_HEAD = VE_SVN_REV XT_SVN_REV: .dw DO_COLON PFA_SVN_REV: .dw XT_DOLITERAL .dw $GLOBALID$ ; <- this is a placeholder for search/modify .dw XT_EXIT Calling this word gives the rev-number on the stack. I very much prefer getting a patchset for that change, I do not want to deal with all this myself ;) But please a patchset, that can deal with (at least some) errors and other oddities as well, failures at this point should not break the build process. IMHO. Matthias |
From: Matthias T. <mt...@we...> - 2012-11-23 18:02:11
|
Hi all, until a full blown solution is available, one may find http://amforth.sourceforge.net/recipes/build-timestamp.html not completely useless. The solution should work for all recent versions of amforth. I'm not too happy with the name of the word, if someone has a better one, I'd appreciate any suggestions. > cold amforth 5.0 ATmega32 16000 kHz Nov 23 2012 19:00:42 > built Nov 23 2012 19:00:42 ok > Matthias |
From: Enoch <ix...@ho...> - 2012-11-23 18:21:51
|
Thanks Mathias, It is a solution but I prefer a word like svnrev. In this context, I recommend having a ChangeLog file at amforth root (as recommended by GNU coding stadard) whose revision number is captured by the a.m. word. True, as you said before, I should roll up my sleeves and get some things done myself :-) Regards, Enoch. Matthias Trute <mt...@we...> writes: > Hi all, > > until a full blown solution is available, > one may find http://amforth.sourceforge.net/recipes/build-timestamp.html > not completely useless. The solution should work > for all recent versions of amforth. I'm not too > happy with the name of the word, if someone has > a better one, I'd appreciate any suggestions. > > > cold > amforth 5.0 ATmega32 16000 kHz > Nov 23 2012 19:00:42 > > built > Nov 23 2012 19:00:42 ok > > > > > Matthias > > > ------------------------------------------------------------------------------ > Monitor your physical, virtual and cloud infrastructure from a single > web console. Get in-depth insight into apps, servers, databases, vmware, > SAP, cloud infrastructure, etc. Download 30-day Free Trial. > Pricing starts from $795 for 25 servers or applications! > http://p.sf.net/sfu/zoho_dev2dev_nov |
From: Matthias T. <mt...@we...> - 2012-11-23 19:19:19
|
Hi, > It is a solution but I prefer a word like svnrev. :=) > > In this context, I recommend having a ChangeLog file at amforth root (as > recommended by GNU coding stadard) whose revision number is captured by > the a.m. word. I try to give every commit a meaningful change message, but I wont do that twice for every commit. Thus "svn log" *should have* given all you need, but on my system it prints only up to rev 1268, dropping anything that happens in trunk since then (4.9 was release around that rev). Strange. Anyway: sourceforge has quite a few tools installed that may give you the information you want: http://amforth.svn.sourceforge.net/viewvc/amforth?revision=1304&view=revision has a navigation feature, the RSS feed tells you all about what happens. Noteworthy changes are documented in the News section and at http://amforth.sf.net/. wrt the GNU coding style I like http://www.kernel.org/doc/Documentation/CodingStyle (2nd paragraph) with modifications ;=) Matthias |
From: Enoch <ix...@ho...> - 2012-11-27 03:34:39
|
Hello Matthias, >> It is a solution but I prefer a word like svnrev. > > :=) My solution was to create a svnversion word through the Makefile: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ AMFORTH := ../amforth/trunk CORE := $(AMFORTH)/core DEVICE := $(CORE)/devices/$(MCU) SVNVERSION := `svnversion -n $(AMFORTH)` $(TARGET).hex: $(TARGET).asm *.inc words/*.asm $(CORE)/*.asm $(CORE)/words/*.asm $(DEVICE)/*.asm $(XASM) -I $(CORE) -o $(TARGET).hex -e $(TARGET).eep -l $(TARGET).lst $(TARGET).asm echo ": svnversion .\" r$(SVNVERSION)\" ;" >svnversion.frt Now in the application: ~~~~~~~~~~~~~~~~~~~~~~~ \ #include svnversion.frt : myturnkey \ snip applturnkey space svnversion ; ' myturnkey is turnkey The result: ~~~~~~~~~~~ amforth 4.9 AT90CAN128 r1306M Thanks, Enoch. P/S M reminds me that you did not accept my amforth-shell.py patch yet :-) |
From: Matthias T. <mt...@we...> - 2012-11-27 18:15:32
|
Hi Enoch, > My solution was to create a svnversion word through the Makefile: Way shorter than I expeced. Smart. I've put into the recipe at http://amforth.sourceforge.net/recipes/build-timestamp.html Thank you Matthias P/S M reminds me that you did not accept my amforth-shell.py patch yet :-) Really? ;) |
From: Enoch <ix...@ho...> - 2012-12-02 04:33:09
|
Hello Matthias, > P/S M reminds me that you did not accept my amforth-shell.py patch yet :-) > Really? ;) Sorry, I forgot that I patched amforth-upload.py as well since it had some indentation errors. Mentioning amforth-shell.py, I think that we should teach it some day to substitute Forth constant-s on the fly as we upload the Flash. Let's say CONSTANT-s get substituted while constant-s don't. This generalization of the current register name substitutions would benefit guys with limited Flash memory. Imagine one day we can use (*): 42 CONSTANT Answer_to_the_ultimate_question_of_life_the_universe_and_everything without paying a Flash penalty :-) Cheers, Enoch. (*) Adams constant. |
From: Matthias T. <mt...@we...> - 2012-12-02 09:44:24
|
Hi Enoch, > Mentioning amforth-shell.py, I think that we should teach it some day to > substitute Forth constant-s on the fly as we upload the Flash. Let's say > CONSTANT-s get substituted while constant-s don't. This generalization > of the current register name substitutions would benefit guys with > limited Flash memory. It would be useful indeed. And another step toward a teathered amforth as well ;) I've just uploaded an extension that changes standard words (and only those!) on the fly to lowercase. The code handles miXed CaSe as well. And since we're on the PC side, there are no restrictions wrt CPU cycles and code space ;) + stdwords = [ + "IF", "ELSE", "WHILE", "UNTIL", "AGAIN", "BEGIN", "REPEAT", ..... + if w.upper() in self.stdwords: + w = w.lower() The list of the standard words ist not yet complete (there are many of them). Matthias |