Forum Discussion
Altera_Forum
Honored Contributor
21 years agotouch file
I have a file that includes the standard __DATE__ and __TIME__ macros and other information, and prints it to the console. I use this as a quick way of checking the build version of my software. I need to force the file to be recompiled every build, since the code itself never changes and it is easy to forget to open and save the file during a busy debug session. The shell command "touch <file>" wouild do this if made part of the makefile.
Is there a convenient point - script file - in the IDE tool chain where I could insert this command? Or is there a way to include a user script at the start of every build? I want to keep using the IDE and so need to limit the rework whenever it is upgraded.2 Replies
- Altera_Forum
Honored Contributor
There's lots of ways to do this. One possible way is to create a seperate makefile (e.g. touch.mk) which contains something like the following:
Then from the Windows control panel create the environment variable MAKEFILES which has as it's value the path to the makefile you just created, e.g. C:/touch.mk. Alternatively you could just add the above content to app.mk in the Nios II kit. I haven't tested the above, but something like it should work.all: touch_myfile touch_myfile: touch my_file.c .PHONEY: touch_myfile - Altera_Forum
Honored Contributor
Perfect! Thank you for the solution, it works really well. I used MAKEFILES to avoid modifying any NIOS files. This is the script that works for me:
[-c flag to prevent dumping spurious empty .c files as the make traverses directories; ../ as the make executes in the Release or Debug directory below the source file.] http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/smile.gifall: touch_myfile touch_myfile: touch -c ../mybuildinfo.c echo "Touch script running in: " `pwd` .PHONEY: touch_myfile