CVS: packaging LICENSE-msp430-bsl.txt,NONE,1.1 LICENSE-msp430-jtag.txt,NONE,1.1 README-msp430-bsl.txt,NONE,1.1 README-msp430-jtag.txt,NONE,1.1 filediff.py,NONE,1.1 filelist.py,NONE,1.1 files_to_nsh.py,NONE,1.1 mspgcc-base.nsh,NONE,1.1 mspgcc-full-install.nsi,NONE,1.1 makefile,1.1,1.2
Chris Liechti <[email protected]>
| Newsgroups | gmane.comp.hardware.texas-instruments.msp430.gcc.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/mspgcc/packaging In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5187/packaging Modified Files: makefile Added Files: LICENSE-msp430-bsl.txt LICENSE-msp430-jtag.txt README-msp430-bsl.txt README-msp430-jtag.txt filediff.py filelist.py files_to_nsh.py mspgcc-base.nsh mspgcc-full-install.nsi Log Message: - update makefile for the windows installer - build in separate directory - default to CVS checkout on level up - add support files for the windows installer - file list handling python scripts - readme and license files - NSIS scripts --- NEW FILE: LICENSE-msp430-bsl.txt --- Copyright (c) 2001-2003 Chris Liechti <[email protected]> All Rights Reserved. This is the Python license. In short, you can use this product in commercial and non-commercial applications, modify it, redistribute it. A notification to the author when you use and/or modify it is welcome. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING THIS SOFTWARE ============================================ LICENSE AGREEMENT ----------------- 1. This LICENSE AGREEMENT is between the copyright holder of this product, and the Individual or Organization ("Licensee") accessing and otherwise using this product in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, the copyright holder hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use this product alone or in any derivative version, provided, however, that copyright holders License Agreement and copyright holders notice of copyright are retained in this product alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates this product or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to this product. 4. The copyright holder is making this product available to Licensee on an "AS IS" basis. THE COPYRIGHT HOLDER MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, THE COPYRIGHT HOLDER MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THIS PRODUCT WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. THE COPYRIGHT HOLDER SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THIS PRODUCT FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING THIS PRODUCT, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between the copyright holder and Licensee. This License Agreement does not grant permission to use trademarks or trade names from the copyright holder in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using this product, Licensee agrees to be bound by the terms and conditions of this License Agreement. --- NEW FILE: LICENSE-msp430-jtag.txt --- Copyright (c) 2001-2003 Chris Liechti <[email protected]> All Rights Reserved. This is the Python license. In short, you can use this product in commercial and non-commercial applications, modify it, redistribute it. A notification to the author when you use and/or modify it is welcome. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING THIS SOFTWARE ============================================ LICENSE AGREEMENT ----------------- 1. This LICENSE AGREEMENT is between the copyright holder of this product, and the Individual or Organization ("Licensee") accessing and otherwise using this product in source or binary form and its associated documentation. 2. Subject to the terms and conditions of this License Agreement, the copyright holder hereby grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, analyze, test, perform and/or display publicly, prepare derivative works, distribute, and otherwise use this product alone or in any derivative version, provided, however, that copyright holders License Agreement and copyright holders notice of copyright are retained in this product alone or in any derivative version prepared by Licensee. 3. In the event Licensee prepares a derivative work that is based on or incorporates this product or any part thereof, and wants to make the derivative work available to others as provided herein, then Licensee hereby agrees to include in any such work a brief summary of the changes made to this product. 4. The copyright holder is making this product available to Licensee on an "AS IS" basis. THE COPYRIGHT HOLDER MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, THE COPYRIGHT HOLDER MAKES NO AND DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THIS PRODUCT WILL NOT INFRINGE ANY THIRD PARTY RIGHTS. 5. THE COPYRIGHT HOLDER SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THIS PRODUCT FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING THIS PRODUCT, OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. 6. This License Agreement will automatically terminate upon a material breach of its terms and conditions. 7. Nothing in this License Agreement shall be deemed to create any relationship of agency, partnership, or joint venture between the copyright holder and Licensee. This License Agreement does not grant permission to use trademarks or trade names from the copyright holder in a trademark sense to endorse or promote products or services of Licensee, or any third party. 8. By copying, installing or otherwise using this product, Licensee agrees to be bound by the terms and conditions of this License Agreement. --- NEW FILE: README-msp430-bsl.txt --- pyBSL ---- BootStrapLoader software for the flash devices MSP430F1xx (maybe F4xx too, but its not tested). Based on the example provided by TI but with more features. It is released under a free software license, see license.txt for more details. (C) 2001-2003 Chris Liechti <[email protected]> Features -------- - understands TI-Text and Intel-hex - download to Flash and/or RAM, erase, verify - reset and wait for keypress (to run a device directly from the port power) - load addres into R0/PC and run - password file can be any data file, e.g. the one used to program the device in an earlier session - upload a memory block MSP->PC (output as binary data or hex dump) - written in Python, runs on Win32, Linux, BSD (other unices have other device names but should be faisible), Jython (Python in Java) - use per command line, or in a Python script - download a program, execute it, resynchronize and upload results. (for testing and callibration) - downladable BSL for larger devices - baudrate change for newer MSP430-BSLs - test and reset lines can be inverted for non standard BSL hardware Requirements ------------ - Linux, BSD, Un*x or Windows PC - Python 2.0 or newer (1.5.2 untested), 2.2 recomeded - win32all extensions to Python on Windows - BSL hardware with an MSP430 device connected to a serial port Installation ------------ Python installations are available from www.python.org. On Windows simply use the installer. The win32all package has an installer too. These installations should run fine with the deafults. On Linux just Python is needed. On many distributions is Python 1.5.2 incuded. I suggest that an upgrade to 2.2 or newer. There are rpm and deb binary packages and a source tarball availabe through the Python homepage. The pybsl archive can simply be unpacked to a directory, Windows users can use WinZip or WinRar among others to extract the gzipped tar file. If you want to run it from everywhere the directory where the file bsl.py is, should be added to the PATH. Look at "/etc/profile" on Linux, "autoexec.bat" on Win9x/ME, System Properties/Environment in Win2000/NT/XP. For Jython you need to have installed the "Java Communications API" (JavaComm). Short introduction ------------------ First the MSP430 BSL hardware is needed. An example schematics can be found in the application note "slaa96b" from TI (see references). Then this programm can be used to communicate between the PC and the MSP430 device. The program can be started by typing "python bsl.py" in a console. Often it works also with just "bsl.py" or "./bsl.py". USAGE: bsl.py [options] [file] If "-" is specified as file the data is read from the stdinput. A file ending with ".txt" is considered to be in TIText format, '.a43' and '.hex' as IntelHex and all other filenames are considered as ELF files. General options: -h, --help Show this help screen. -c, --comport=port Specify the communication port to be used. (Default is 0) 0->COM1 / ttyS0 1->COM2 / ttyS1 etc. -P, --password=file Specify a file with the interrupt vectors that are used as password. This can be any file that has previously been used to program the device. (e.g. -P INT_VECT.TXT). -f, --framesize=num Max. number of data bytes within one transmitted frame (16 to 240 in steps of 16) (e.g. -f 240). -m, --erasecycles=num Number of mass erase cycles (default is 1). Some old F149 devices need additional erase cycles. On newer devices it is no longer needed. (e.g. for an old F149: -m20) -U, --unpatched Do not download the BSL patch, even when it is needed. This is used when a program is downloaded into RAM and executed from there (and where flash programming is not needed.) -D, --debug Increase level of debug messages. This won't be very useful for the average user... -I, --intelhex Force fileformat to IntelHex -T, --titext Force fileformat to be TIText -N, --notimeout Don't use timeout on serial port (use with care) -B, --bsl=bsl.txt Load and use new BSL from the TI Text file -S, --speed=baud Reconfigure speed, only possible with newer MSP403-BSL versions (>1.5, read slaa089a.pdf for details). If the --bsl option is not used, an internal BSL replacement will be loaded. Needs a target with at least 2kB RAM! Possible values are 9600, 19200, 38400 (default 9600) -1, --f1x Specify CPU family, in case autodetect fails -4, --f4x Specify CPU family, in case autodetect fails --F1x and --f2x are only needed when the "change baudrate" feature is used and the autodetect feature fails. If the device ID that is uploaded is known, it has precedence to the command line option. --invert-reset Invert signal on RST pin (used for some BSL hardware) --invert-test Invert signal on TEST/TCK pin (used for some BSL hardware) Program Flow Specifiers: -e, --masserase Mass Erase (clear all flash memory) -E, --erasecheck Erase Check by file -p, --program Program file -v, --verify Verify by file The order of the above options matters! The table is ordered by normal execution order. For the options "Epv" a file must be specified. Program flow specifiers default to "pvr" if a file is given. Don't forget to specify "e" or "eE" when programming flash! Data retreiving: -u, --upload=addr Upload a datablock (see also: -s). -s, --size=num Size of the data block do upload. (Default is 2) -x, --hex Show a hexadecimal display of the uploaded data. (Default) -b, --bin Get binary uploaded data. This can be used to redirect the output into a file. Do before exit: -g, --go=address Start programm execution at specified address. This implies option --wait. -r, --reset Reset connected MSP430. Starts application. This is a normal device reset and will start the programm that is specified in the reset vector. (see also -g) -w, --wait Wait for <ENTER> before closing serial port. If it says "NAK received" it's probably because you specified no or a wrong password. Examples -------- These exaples assume that you have added the installation directory to the PATH. type the full path to bsl.py otherwise and maybe use "python bsl.py". bsl.py -e Only erase flash. bsl.py -eErw 6port.a43 Erase flash, erase check, download an executable, run it (reset) and wait. Old F149 devices need addidional erase cycles! Use the -m option in this case (-m20 will be OK is most cases): "python bsl.py -eErwm20 6port.a43" bsl.py 6port.a43 Download of an executable to en empty (new or erased) device. (Note that in new devices some of the first bytes in the information memory are random data. If data should be downloaded there, specify -eE.) bsl.py -erwB BL_150S_14x.txt -S 38400 6port.a43 Erase device, change baudrate and download a new BSL, then download the specified file. After that, reset the device and wait for user input. bsl.py --go=0x220 ramtest.a43 Download a program into RAM and run it (on an erased device) bsl.py --go=0x200 -P 6port.a43 ramtest.a43 Download a program into RAM and run it (on a device that was previously programmed with 6port.a43 and therefore needs a specific password). For old devices that use the patch the above command gives a conflict with the patch. But as the patch is only needed to programm flash, it can be left out when running a program solely from RAM: "python bsl.py --go=0x200 -u -P 6port.a43 ramtest.a43" bsl.py -u 0x0c00 -s 1024 -P 6port.a43 Get a memory dump in HEX, from the bootstrap loader (on a device that was previously programmed with 6port.a43 and therefore needs a specific password): or on unix with the use of "hexdump": "python bsl.py -u 0x0c00 -s 1024 -P 6port.a43 -b | hexdump" or save the binary in a file: "python bsl.py -u 0x0c00 -s 1024 -P 6port.a43 -b >dump.bin" bsl.py --go=0x220 --upload=0x200 --size=256 ramtest.a43 Download the file ramtest.a43 to an empty device, execute its main function at 0x0220. The BSL then tries to reconnect to the device. This does only work when the program on the MSP430 does enter the BSL by jumping at address 0x0c00. It is not forced to enter the BSL by a reset as this would stop the program excution. When the reconnection was successful, the data, specified with the --upload and --size parameters, is loaded and printed. This configuration can be useful for software tests, getting callibration data, etc. PS: dont specify -r when using -g. A reset starts the user program which possibly destroys a program that was downloaded to RAM. bsl.py -rw Just start the user program (with a reset) and wait. bsl.py -rwc1 Reset the device on the second serial/COM port and wait. cat 6port.a43|bsl.py -eE - Pipe the data from "cat" to the BSL to erase and program the flash. (un*x example, don't forget the dash at the end of the line) bsl.py -e -S 38400 6port.a43 First download the internal replacement BSL and then use it to program at 38400 baud. Only works with targets with more than 1kB of RAM. bsl.py -e -B BL_150S_14x.txt -S 38400 6port.a43 First download the given replacement BSL and then use it to program at 38400 baud. Only works with targets with more than 1kB of RAM. History ------- V1.4 uses improved serial library support for BSL download to MSP support for higher baudrates (up to 38400) V1.5 ELF file support replacement BSLs are now internal References ---------- - Python: http://www.python.org - Jython: http://www.jython.org - Serial Extension for Python: http://pyserial.sourceforge.net - win32all: http://starship.python.net/crew/mhammond/ and http://www.activestate.com/Products/ActivePython/win32all.html - slaa89.pdf: "Features of the MSP430 Bootstrap Loader in the MSP430F1121", TI - slaa96b.pdf: "Application of Bootstrap Loader in MSP430 With Flash Hardware and Software Proposal", TI - Texas Instruments MSP430 Homepage, links to Datasheets and Application Notes: http://www.ti.com/sc/docs/products/micro/msp430/msp430.htm --- NEW FILE: README-msp430-jtag.txt --- pyJTAG ------ Software to talk to the parallel port JTAG PCB as seen with the FET kits. It is released under a free software license, see license.txt for more details. (C) 2002-2003 Chris Liechti <[email protected]> Features -------- - understands TI-Text and Intel-hex - download to Flash and/or RAM, erase, verify - reset device - load addres into R0/PC and run - upload a memory block MSP->PC (output as binary data or hex dump) - written in Python, runs on Win32, Linux, BSD - use per command line, or in a Python script Requirements ------------ - Linux, BSD, Un*x or Windows PC - Python 2.0 or newer, 2.2 recomeded - Parallel JTAG hardware with an MSP430 device connected Installation ------------ Python installations are available from www.python.org. On Windows simply use the installer. The win32all package has an installer too. These installations should run fine with the deafults. On Linux just Python is needed. On some distributions is Python 1.5.2 installed per default. You may meed to change the first line in the script from "python" to "python2". Maybe Python 2.x is in a separate package that has to be installed. There are rpm and deb binary packages and a source tarball available through the Python homepage. The pyjtag archive can simply be unpacked to a directory, Windows users can use WinZip or WinRar among others to extract the gzipped tar file. If you want to run it from everywhere the directory where the file jtag.py is, should be added to the PATH. Look at "~/.profile", "/etc/profile" on Linux, "autoexec.bat" on Win9x/ME, System Properties/Environment in Win2000/NT/XP. _parjtag.so/dll from the jtag archive must be copied to the same directory as jtag.py. On Windows also MSP430mspgcc.dll and HIL.dll must be located in the same dir or somewhere in the PATH. Short introduction ------------------ This software uses the JTAG hardware that comes with the FET kits. It is connected to the parallel port. The program can be started by typing "python jtag.py" in a console. Often it works also with just "jtag.py" or "./jtag.py". USAGE: jtag.py [options] [file] If "-" is specified as file the data is read from the stdinput. A file ending with ".txt" is considered to be in TIText format all other filenames are considered IntelHex. General options: -h, --help Show this help screen. -l, --lpt=name Specify an other parallel port. (defaults to LPT1 (/dev/parport0 on unix) -D, --debug Increase level of debug messages. This won't be very useful for the average user... -I, --intelhex Force fileformat to IntelHex -T, --titext Force fileformat to be TIText -f, --funclet The given file is a funclet (a small program to be run in RAM) -R, --ramsize Specify the amont of RAM to be used to program flash (default 256). Program Flow Specifiers: -e, --masserase Mass Erase (clear all flash memory) -m, --mainerase Erase main flash memory only --eraseinfo Erase info flash memory only (0x1000-0x10ff) --erase=address Selectively erase segment at the specified address -E, --erasecheck Erase Check by file -p, --program Program file -v, --verify Verify by file The order of the above options matters! The table is ordered by normal execution order. For the options "Epv" a file must be specified. Program flow specifiers default to "p" if a file is given. Don't forget to specify "e" or "eE" when programming flash! "p" already verifies the programmed data, "v" adds an additional verification though uploading the written data for a 1:1 compare. No default action is taken if "p" and/or "v" is given, say specifying only "v" does a check by file of a programmed device. Data retreiving: -u, --upload=addr Upload a datablock (see also: -s). -s, --size=num Size of the data block do upload. (Default is 2) -x, --hex Show a hexadecimal display of the uploaded data. (Default) -b, --bin Get binary uploaded data. This can be used to redirect the output into a file. -i, --ihex Uploaded data is output in Intel HEX format. This can be used to clone a device. Do before exit: -g, --go=address Start programm execution at specified address. This implies option "w" (wait) -r, --reset Reset connected MSP430. Starts application. This is a normal device reset and will start the programm that is specified in the reset interrupt vector. (see also -g) -w, --wait Wait for <ENTER> before closing parallel port. Examples -------- These examples assume that you have added the installation directory to the PATH. Type the full path to jtag.py otherwise and maybe use "python jtag.py". Depending on installation it may also appear under the name "msp430-jtag". jtag.py -e Only erase flash. jtag.py -eErw 6port.a43 Erase flash, erase check, download an executable, run it (reset) and wait. jtag.py -mS -R 2048 6port.a43 Use ramsize option on a device with 2k RAM to speed up download. Of course any value from 128B up to the maximum a device has is allowed. The progress and mainerase options are also activated. Only erasing the main memory is useful to keep calibration data in the information memory. jtag.py 6port.a43 Download of an executable to en empty (new or erased) device. (Note that in new devices some of the first bytes in the information memory are random data. If data should be downloaded there, specify -eE.) jtag.py --go=0x220 ramtest.a43 Download a program into RAM and run it, may not work with all devices. jtag.py -f blinking.a43 Download a program into RAM and run it. It must be a special format with "startadr", "entrypoint", "exitpoint" as the first three words in the data and it must end on "jmp $". See MSP430debug sources for more info. jtag.py -u 0x0c00 -s 1024 Get a memory dump in HEX, from the bootstrap loader. or save the binary in a file: "python jtag.py -u 0x0c00 -s 1024 -b >dump.bin" or as an intel-hex file: "python jtag.py -u 0x0c00 -s 1024 -i >dump.a43" jtag.py -r Just start the user program (with a reset). cat 6port.a43|jtag.py -e - Pipe the data from "cat" to jtag.py to erase and program the flash. (un*x example, don't forget the dash at the end of the line) History ------- 1.0 public release 1.1 fix of verify error 1.2 use the verification during programming 1.3 meinerase, progress options, ihex output References ---------- - Python: http://www.python.org - Texas Instruments MSP430 Homepage, links to Datasheets and Application Notes: http://www.ti.com/sc/msp430 --- NEW FILE: filediff.py --- import os, sys before = file(sys.argv[1]).readlines() after = file(sys.argv[2]).readlines() new = [path for path in after if path not in before] for path in new: print path.strip() --- NEW FILE: filelist.py --- """ use the given path and creat a list of files. output is one file path per line. CVS dirs are ignored. """ import os, sys path = sys.argv[1] if sys.platform == 'win32': if path.startswith('/'): #cygwin path specs? path = os.popen('cygpath -w "%s"' % path).read().strip() def visitor(arg, dirname, filenames): if not dirname.endswith('CVS'): for filename in filenames: path = os.path.join(dirname, filename) if os.path.isfile(path): included.append(path) included = [] os.path.walk(path, visitor, None) for path in included: print path --- NEW FILE: files_to_nsh.py --- import os, sys, time, fnmatch included = [path.strip() for path in file(sys.argv[1])] mspgccpart = sys.argv[2] sourcepath = sys.argv[3] if sourcepath.startswith('/'): #cygwin path specs? sourcepath = os.popen('cygpath -w "%s"' % sourcepath).read().strip() EXCLUDES = [ "*/info/*", "*/man/*", "*/share/locale/*", "*/cvs*" ] def isIncluded(path): for match in EXCLUDES: if fnmatch.fnmatch(path.lower(), match): return False return True #filter valid paths included = [path for path in included if isIncluded(path)] dirs = [] lastdir = None output_install = file('msp430-%s-install.nsh' % mspgccpart, 'w') for path in included: inst_relpath = os.path.abspath(path)[len(sourcepath):] if inst_relpath[:1] in ('/', '\\'): inst_relpath = inst_relpath[1:] instdir = os.path.dirname(inst_relpath) if instdir not in dirs: output_install.write(' SetOutPath "$INSTDIR\%s"\n' % instdir) dirs.append(instdir) output_install.write(' File "%s"\n' % path) included.reverse() lastdir = None output_uninstall = file('msp430-%s-uninstall.nsh' % mspgccpart, 'w') for path in included: inst_relpath = os.path.abspath(path)[len(sourcepath):] if inst_relpath[:1] in ('/', '\\'): inst_relpath = inst_relpath[1:] instdir = os.path.dirname(inst_relpath) if lastdir != instdir and lastdir is not None: output_uninstall.write(' RMDir "$INSTDIR\%s"\n' % lastdir) head, tail = os.path.split(lastdir) while head and head != os.path.split(instdir)[0] and head != instdir: print head, instdir output_uninstall.write(' RMDir "$INSTDIR\%s"\n' % head) head, tail = os.path.split(head) output_uninstall.write(' Delete "$INSTDIR\%s"\n' % inst_relpath) lastdir = instdir if lastdir: output_uninstall.write(' RMDir "$INSTDIR\%s"\n' % lastdir) --- NEW FILE: mspgcc-base.nsh --- # mspgcc-base-nsh # # This file is for NSIS V2.0 beta 3 # !include "MUI.nsh" SetCompressor lzma ShowInstDetails show ShowUninstDetails show SetDateSave on !define MUI_NAME "MSPGCC Installer ${VERSION}" !define MUI_ICON "mspgcc.ico" !define MUI_UNICON "mspgcc.ico" ;-------------------------------- ;Interface Settings !define MUI_ABORTWARNING !define MUI_HEADERIMAGE !define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\docs\${README}" !define MUI_FINISHPAGE_NOREBOOTSUPPORT !define MUI_WELCOMEFINISHPAGE_BITMAP "msp430-image.bmp" !define MUI_HEADERIMAGE_BITMAP "msp430-header.bmp" ;-------------------------------- ;Pages !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "licence.txt" !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_WELCOME !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_UNPAGE_FINISH ;-------------------------------- ;Languages !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of MSPGCC.\r\n\r\n\ MSPGCC is a port of the GNU tools for the Texas Instruments MSP430 family of ultra-low power MCUs. It \ provides a full development and debugging environment for assembly and C language programming. \r\n\r\n\ This software is free and unrestricted for use in the development of any kind of software for \ the MSP430 processors. All current processor models are supported. \ \r\n\r\n\r\n" !insertmacro MUI_LANGUAGE "English" ;-------------------------------- ;Reserve Files ;~ !insertmacro MUI_RESERVEFILE_INSTALLOPTIONS ;~ !insertmacro MUI_RESERVEFILE_SPECIALINI ;~ !insertmacro MUI_RESERVEFILE_SPECIALBITMAP LicenseData "licence.txt" # The default installation directory InstallDir c:\mspgcc # Registry key to check for directory (so if you install again, it will # overwrite the old one automatically) InstallDirRegKey HKCU "Software\${PRODUCT}" "" Function DoCygwinDll IfFileExists cygwin1.dll mis_cygwin File c:\cygwin\bin\cygwin1.dll File c:\cygwin\bin\cygintl-2.dll File c:\cygwin\bin\cygiconv-2.dll Goto cygwin_ok mis_cygwin: MessageBox MB_OK "found a version of cygwin1.dll not replacing (may cause problems)" cygwin_ok: FunctionEnd Function AddPath # Add the program directory to the search path, if necessary ReadRegStr $R0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" IfErrors no_path_to_change Push $R0 ;original string Push "$INSTDIR\bin" ;Look for this Push "" ;Replace with this Call StrReplace Pop $0 StrCmp $0 $R0 change_path # It seems the directory is already present in the path variable Goto path_unchanged change_path: ;~ WriteRegStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$R0;$INSTDIR\bin" ; set environment ; HKCU "Environment" would be used for current user only ; for all users: WriteRegExpandStr HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment" "Path" "$R0;$INSTDIR\bin" ; notify processes about changed PATH setting SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000 path_unchanged: Goto path_change_done no_path_to_change: MessageBox MB_OK "You do not have a Path variable in your registry. If you are running Windows 95, 98, or Me \ you may need to add $INSTDIR\bin to the PATH variable in your c:\autoexec.bat file." path_change_done: FunctionEnd Function StrReplace Exch $0 ;this will replace wrong characters Exch Exch $1 ;needs to be replaced Exch Exch 2 Exch $2 ;the orginal string Push $3 ;counter Push $4 ;temp character Push $5 ;temp string Push $6 ;length of string that need to be replaced Push $7 ;length of string that will replace Push $R0 ;tempstring Push $R1 ;tempstring Push $R2 ;tempstring StrCpy $3 "-1" StrCpy $5 "" StrLen $6 $1 StrLen $7 $0 Loop: IntOp $3 $3 + 1 StrCpy $4 $2 $6 $3 StrCmp $4 "" ExitLoop StrCmp $4 $1 Replace Goto Loop Replace: StrCpy $R0 $2 $3 IntOp $R2 $3 + $6 StrCpy $R1 $2 "" $R2 StrCpy $2 $R0$0$R1 IntOp $3 $3 + $7 Goto Loop ExitLoop: StrCpy $0 $2 Pop $R2 Pop $R1 Pop $R0 Pop $7 Pop $6 Pop $5 Pop $4 Pop $3 Pop $2 Pop $1 Exch $0 FunctionEnd Function IsNT ; NT means anything based on NT - NT, 2000, or XP Push $0 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion StrCmp $0 "" 0 IsNT_yes ; we are not running on NT. Pop $0 Push 0 Return IsNT_yes: ; NT!!! Pop $0 Push 1 FunctionEnd Function un.IsNT ; NT means anything based on NT - NT, 2000, or XP Push $0 ReadRegStr $0 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion StrCmp $0 "" 0 IsNT_yes ; we are not running on NT. Pop $0 Push 0 Return IsNT_yes: ; NT!!! Pop $0 Push 1 FunctionEnd # eof --- NEW FILE: mspgcc-full-install.nsi --- !define MSPGCC_PART "full" !define PRODUCT "mspgcc" #where to get the binaries in SRCDIR #build date in VERSION !include "variables.nsh" !define VERSION_MAJOR 0 !define VERSION_MINOR 4 !define README "README.txt" OutFile "${PRODUCT}-${VERSION}.exe" !include "mspgcc-base.nsh" Name ${PRODUCT} #---------------------------------------------------------------------------- SubSection "Make utilities & libs" SecMakeAndLibs Section "Make utilities" SecMake SetOutPath "$INSTDIR\bin" ;~ Call DoCygwinDll File c:\cygwin\bin\make.exe File c:\cygwin\bin\diff.exe File c:\cygwin\bin\patch.exe File c:\cygwin\bin\mkdir.exe File c:\cygwin\bin\cp.exe File c:\cygwin\bin\mv.exe File c:\cygwin\bin\rm.exe SectionEnd Section "Cygwin libs" SecCygwin SetOutPath "$INSTDIR\bin" File c:\cygwin\bin\cygwin1.dll File c:\cygwin\bin\cygintl-2.dll File c:\cygwin\bin\cygintl-3.dll File c:\cygwin\bin\cygiconv-2.dll SectionEnd SubSectionEnd Section "Binutils" SecBinutils SectionIn RO !include "msp430-binutils-install.nsh" SetOutPath "$INSTDIR\docs" File README.txt File README-msp430-binutils.txt # Write the installation path into the registry WriteRegStr HKCU "Software\${PRODUCT}" "Install_Dir" "$INSTDIR" # Write the uninstall keys for Windows WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "DisplayName" "${PRODUCT} - The GNU tools for the MSP430" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "DisplayIcon" "$INSTDIR\${PRODUCT}-uninstall.exe" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "DisplayVersion" "${VERSION}" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "InstallLocation" "$INSTDIR" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "UninstallString" "$INSTDIR\${PRODUCT}-uninstall.exe" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "VersionMajor" "${VERSION_MAJOR}" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "VersionMinor" "${VERSION_MINOR}" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "NoModify" "1" WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" "NoRepair" "1" Call AddPath WriteUninstaller "${PRODUCT}-uninstall.exe" SectionEnd Section "C compiler" SecGcc !include "msp430-gcc-install.nsh" SetOutPath $INSTDIR\docs File README-msp430-gcc.txt SectionEnd Section "Target C library" SecLibc !include "msp430-libc-install.nsh" SetOutPath $INSTDIR\docs File "README-msp430-libc.txt" SectionEnd Section "Documentation" SecDocs !include "msp430-docs-install.nsh" CreateDirectory "$SMPROGRAMS\mspgcc" CreateShortCut "$SMPROGRAMS\mspgcc\mspgcc-manual.lnk" "$INSTDIR\docs\mspgcc-manual.pdf" "" "$INSTDIR\docs\mspgcc-manual.pdf" 0 CreateShortCut "$SMPROGRAMS\mspgcc\mspgcc-faq.lnk" "$INSTDIR\docs\mspgcc-faq.pdf" "" "$INSTDIR\docs\mspgcc-faq.pdf" 0 CreateShortCut "$SMPROGRAMS\mspgcc\Documentation.lnk" "$INSTDIR\docs" "" "$INSTDIR\docs" 0 SectionEnd Section "Examples" SecExamples !include "msp430-examples-install.nsh" CreateDirectory "$SMPROGRAMS\mspgcc" CreateShortCut "$SMPROGRAMS\mspgcc\examples.lnk" "$INSTDIR\examples" "" "$INSTDIR\examples" 0 SectionEnd Section "Examples" SecLibraries !include "msp430-libraries-install.nsh" SectionEnd Section "Debugger" SecGdb !include "msp430-gdb-install.nsh" SetOutPath "$INSTDIR\docs" File "README-msp430-gdb.txt" SectionEnd Section "JTAG and BSL" SecDownloader SetOutPath "$INSTDIR\bin" File "msp430-gdbproxy.exe" ;~ File "c:\mspgcc\bin\msp430-reset.exe" File "${SRCDIR}\bin\python23.dll" File "${SRCDIR}\bin\msp430-bsl.exe" File "${SRCDIR}\bin\msp430-jtag.exe" File "${SRCDIR}\bin\msp430-downloader.exe" File "${SRCDIR}\bin\msp430-ram-usage.exe" File "${SRCDIR}\bin\MSP430mspgcc.dll" File "${SRCDIR}\bin\HIL.dll" SetOutPath "$INSTDIR\bin\lib" File "${SRCDIR}\bin\lib\shared-bsl.zip" File "${SRCDIR}\bin\lib\shared-jtag.zip" File "${SRCDIR}\bin\lib\shared-downloader.zip" File "${SRCDIR}\bin\lib\shared-ram-usage.zip" File "${SRCDIR}\bin\lib\PyWinTypes23.dll" File "${SRCDIR}\bin\lib\win32event.pyd" File "${SRCDIR}\bin\lib\win32file.pyd" File "${SRCDIR}\bin\lib\select.pyd" File "${SRCDIR}\bin\lib\_ctypes.pyd" ;~ File "${SRCDIR}\bin\lib\_parjtag.pyd" File "${SRCDIR}\bin\lib\_sre.pyd" File "${SRCDIR}\bin\lib\datetime.pyd" File "${SRCDIR}\bin\lib\w9xpopen.exe" SetOutPath "$INSTDIR\docs" File "README-msp430-gdbproxy.txt" File "README-msp430-bsl.txt" File "LICENSE-msp430-bsl.txt" File "README-msp430-jtag.txt" File "LICENSE-msp430-jtag.txt" SetOutPath "$INSTDIR" CreateDirectory "$SMPROGRAMS\mspgcc" CreateShortCut "$SMPROGRAMS\mspgcc\msp430-gdbproxy.lnk" "$INSTDIR\bin\msp430-gdbproxy.exe" "--port=3333 msp430" "$INSTDIR\gdbproxy.exe" 0 CreateShortCut "$SMPROGRAMS\mspgcc\msp430-gdbproxy-debug.lnk" "$INSTDIR\bin\msp430-gdbproxy.exe" "--port=3333 --debug --debug msp430" "$INSTDIR\gdbproxy.exe" 0 SectionEnd SubSection "GiveIO (required for Windows NT, 2000 and XP only))" SecGiveio Section "Program" Call IsNT Pop $0 StrCmp $0 1 need_giveio_1 MessageBox MB_OK "This machine does not appear to be running Windows NT, 2000, or XP! giveio will not be installed." Goto skip_giveio_1 need_giveio_1: # Set output path to the installation directory. SetOutPath $INSTDIR\giveio # Put file there File "${SRCDIR}\giveio\loaddrv.exe" File "${SRCDIR}\giveio\giveio.sys" File "${SRCDIR}\giveio\install_giveio.bat" File "${SRCDIR}\giveio\remove_giveio.bat" File "${SRCDIR}\giveio\status_giveio.bat" File "${SRCDIR}\giveio\README.txt" skip_giveio_1: SectionEnd Section "Start Menu Shortcuts" Call IsNT Pop $0 StrCmp $0 1 need_giveio_2 Goto skip_giveio_2 need_giveio_2: CreateDirectory "$SMPROGRAMS\mspgcc\GiveIO" CreateShortCut "$SMPROGRAMS\mspgcc\GiveIO\Status Giveio Service.lnk" "$INSTDIR\giveio\status_giveio.bat" "" "$INSTDIR\giveio\status_giveio.bat" 0 CreateShortCut "$SMPROGRAMS\mspgcc\GiveIO\Install Giveio Service.lnk" "$INSTDIR\giveio\install_giveio.bat" "" "$INSTDIR\giveio\install_giveio.bat" 0 CreateShortCut "$SMPROGRAMS\mspgcc\GiveIO\Remove Giveio Service.lnk" "$INSTDIR\giveio\remove_giveio.bat" "" "$INSTDIR\giveio\remove_giveio.bat" 0 skip_giveio_2: SectionEnd Section "Start GIVEIO Service now" Call IsNT Pop $0 StrCmp $0 1 need_giveio_3 Goto skip_giveio_3 need_giveio_3: Exec "$INSTDIR\giveio\install_giveio.bat" skip_giveio_3: SectionEnd SubSectionEnd #---------------------------------------------------------------------------- Section "Uninstall" #binutils !include "msp430-binutils-uninstall.nsh" Delete "$INSTDIR\docs\README-msp430-binutils.txt" Delete "$INSTDIR\docs\README.txt" #make utilities Delete "$INSTDIR\bin\make.exe" Delete "$INSTDIR\bin\diff.exe" Delete "$INSTDIR\bin\patch.exe" Delete "$INSTDIR\bin\mkdir.exe" Delete "$INSTDIR\bin\cp.exe" Delete "$INSTDIR\bin\mv.exe" Delete "$INSTDIR\bin\rm.exe" RMDir "$INSTDIR\bin" RMDir "$INSTDIR" #gcc !include "msp430-gcc-uninstall.nsh" Delete "$INSTDIR\docs\README-msp430-gcc.txt" #gdb !include "msp430-gdb-uninstall.nsh" Delete "$INSTDIR\docs\README-msp430-gdb.txt" #libc etc !include "msp430-libc-uninstall.nsh" Delete "$INSTDIR\docs\README-msp430-libc.txt" #examples !include "msp430-examples-uninstall.nsh" Delete "$SMPROGRAMS\mspgcc\examples.lnk" #docs !include "msp430-docs-uninstall.nsh" Delete "$SMPROGRAMS\mspgcc\msp430-manual.lnk" Delete "$SMPROGRAMS\mspgcc\msp430-faq.lnk" Delete "$SMPROGRAMS\mspgcc\Documentation.lnk" #jtag and bsl Delete "$INSTDIR\bin\msp430-gdbproxy.exe" ;~ Delete "$INSTDIR\bin\msp430-reset.exe" Delete "$INSTDIR\bin\msp430-jtag.exe" Delete "$INSTDIR\bin\msp430-bsl.exe" Delete "$INSTDIR\bin\msp430-downloader.exe" Delete "$INSTDIR\bin\msp430-ram-usage.exe" Delete "$INSTDIR\bin\python23.dll" Delete "$INSTDIR\bin\MSP430mspgcc.dll" Delete "$INSTDIR\bin\HIL.dll" Delete "$INSTDIR\bin\lib\shared-jtag.zip" Delete "$INSTDIR\bin\lib\shared-bsl.zip" Delete "$INSTDIR\bin\lib\shared-downloader.zip" Delete "$INSTDIR\bin\lib\shared-ram-usage.zip" Delete "$INSTDIR\bin\lib\PyWinTypes23.dll" Delete "$INSTDIR\bin\lib\win32event.pyd" Delete "$INSTDIR\bin\lib\win32file.pyd" Delete "$INSTDIR\bin\lib\select.pyd" Delete "$INSTDIR\bin\lib\_ctypes.pyd" ;~ Delete "$INSTDIR\bin\lib\_parjtag.pyd" Delete "$INSTDIR\bin\lib\_sre.pyd" Delete "$INSTDIR\bin\lib\datetime.pyd" Delete "$INSTDIR\bin\lib\w9xpopen.exe" RMDir "$INSTDIR\bin\lib" Delete "$INSTDIR\docs\README-msp430-gdbproxy.txt" Delete "$INSTDIR\docs\README-msp430-jtag.txt" Delete "$INSTDIR\docs\LICENSE-msp430-jtag.txt" Delete "$INSTDIR\docs\README-msp430-bsl.txt" Delete "$INSTDIR\docs\LICENSE-msp430-bsl.txt" RMDir "$INSTDIR\docs" Delete "$SMPROGRAMS\mspgcc\msp430-gdbproxy.lnk" #giveio ;~ Call un.IsNT ;~ Pop $0 ;~ StrCmp $0 1 un_need_giveio_3 ;~ Goto un_skip_giveio_3 ;~ un_need_giveio_3: ;~ Exec "$INSTDIR\giveio\remove_giveio.bat" ;~ un_skip_giveio_3: Delete "$INSTDIR\giveio\loaddrv.exe" Delete "$INSTDIR\giveio\giveio.sys" Delete "$INSTDIR\giveio\install_giveio.bat" Delete "$INSTDIR\giveio\remove_giveio.bat" Delete "$INSTDIR\giveio\status_giveio.bat" Delete "$INSTDIR\giveio\README.txt" RMDir "$INSTDIR\giveio" Delete "$SMPROGRAMS\mspgcc\GiveIO\Status Giveio Service.lnk" Delete "$SMPROGRAMS\mspgcc\GiveIO\Install Giveio Service.lnk" Delete "$SMPROGRAMS\mspgcc\GiveIO\Remove Giveio Service.lnk" RMDir "$SMPROGRAMS\mspgcc\GiveIO" #support Delete "$INSTDIR\bin\cygwin1.dll" Delete "$INSTDIR\bin\cygintl-2.dll" Delete "$INSTDIR\bin\cygintl-3.dll" Delete "$INSTDIR\bin\cygiconv-2.dll" # MUST REMOVE UNINSTALLER, too Delete "$INSTDIR\${PRODUCT}-uninstall.exe" #finalize RMDir "$SMPROGRAMS\mspgcc" RMDir "$INSTDIR\bin" RMDir "$INSTDIR" # remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT}" ;~ DeleteRegKey HKLM Software\NSIS_mspgcc DeleteRegKey /ifempty HKCU "Software\${PRODUCT}" SectionEnd !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SecBinutils} "The GNU binutils package, version 2.14, for the MSP430. This includes the assember, linker, and librarian." !insertmacro MUI_DESCRIPTION_TEXT ${SecGcc} "The GNU C/C++ compiler (GCC), version 3.2.3, for the MSP430." !insertmacro MUI_DESCRIPTION_TEXT ${SecLibc} "libc, for the MSP430." !insertmacro MUI_DESCRIPTION_TEXT ${SecDocs} "Documentation for mspgcc" !insertmacro MUI_DESCRIPTION_TEXT ${SecExamples} "Several C and assembler examples for the MSP430." !insertmacro MUI_DESCRIPTION_TEXT ${SecLibraries} "Several add-on libraries for the MSP430." !insertmacro MUI_DESCRIPTION_TEXT ${SecGdb} "The GNU command line debugger (GDB) for the MSP430." !insertmacro MUI_DESCRIPTION_TEXT ${SecDownloader} "gdbproxy, msp430-jtag, msp430-bsl. Interface to the MSP430 FET JTAG tool and BSL." !insertmacro MUI_DESCRIPTION_TEXT ${SecGiveio} "A parallel port access driver for Windows NT, 2000 and XP (needed for the JTAG adaptor). Note: this is NOT needed for Windows 95, 98 or Me." !insertmacro MUI_DESCRIPTION_TEXT ${SecMakeAndLibs} "The GNU make utilities - make, diff, patch, rm, mv, mkdir, cp and the cygwin libraries." !insertmacro MUI_DESCRIPTION_TEXT ${SecMake} "The GNU make utilities - make, diff, patch, rm, mv, mkdir, cp." !insertmacro MUI_DESCRIPTION_TEXT ${SecCygwin} "Cygwin DLLs required for the tools. Can be left out if a recent Cygwin is already installed on the box" !insertmacro MUI_FUNCTION_DESCRIPTION_END Index: makefile =================================================================== RCS file: /cvsroot/mspgcc/packaging/makefile,v retrieving revision 1.1 retrieving revision 1.2 diff -u -w -d -r1.1 -r1.2 --- makefile 25 Sep 2005 03:25:28 -0000 1.1 +++ makefile 26 Sep 2005 22:02:31 -0000 1.2 @@ -24,6 +24,10 @@ # # [email protected] ############################################################################## +ifdef WINDIR +WINDOWS = yes +endif + # versions BINUTILS_VERSION := 2.16 @@ -31,19 +35,21 @@ GDB_VERSION := 5.1.1 # location of the gnu source tarballs -ARCHIVES = $(BUILDDIR)/archives +ARCHIVES = $(PWD)/archives +# location of the patches +PATCHES = $(PWD)/patches # cvs checkout of the mspgcc project (must have a subdir called "gcc", "msp430-libc" etc) # see also "sf" taregt below -CVSFILES = $(BUILDDIR)/sf +#~ CVSFILES = $(BUILDDIR)/sf # if checked out in the packaging folder, the other files are one level up: -#~ CVSFILES = .. +CVSFILES = $(dir $(PWD)) # due to hisroric reasons, GCC 3.2.3 patches are actualy in the 3.3 folder... CVSFILESGCC = $(CVSFILES)/gcc/gcc-3.3 # other vars BUILDDATE := $(shell date +%Y%m%d) -BUILDDIR := $(PWD) +BUILDDIR := $(PWD)/build ifdef WINDOWS INSTALLDIR = $(BUILDDIR)/installed @@ -62,9 +68,6 @@ BINUTILS = binutils-$(BINUTILS_VERSION) GCC = gcc-$(GCC_VERSION) GDB = gdb-$(GDB_VERSION) -ifdef WINDIR -WINDOWS := yes -endif # external tools NSIS := "/c/Program Files/NSIS/makensis" @@ -94,7 +97,7 @@ @echo @echo "Possible targets:" @echo "folders create the folders for the archives and CVS files" - @echo "sf retrieve mspgcc patches with CVS" + @echo "sf retrieve mspgcc patches with CVS (anonymous)" @echo "build download build and install binutils, gcc, gdb, libraries" @echo @echo "INSTALLDIR defaults to /opt/mspgcc. Edit this makefile if" @@ -108,15 +111,25 @@ @echo "just the makefile in it:" @echo "# make folders sf build" @echo + @echo "If building from a CVS checkout ("make folders" has to be run" + @echo "the very first time):" + @echo "# make build" + @echo + @echo "Windows installer (from a CVS checkout)" + @echo "# make build build-addon windows-installer" debug: - @echo "date: $(BUILDDATE)" - @echo $(INSTALLDIR) - @echo $(BUILDDIR) + @echo BUILDDATE = $(BUILDDATE) + @echo INSTALLDIR = $(INSTALLDIR) + @echo BUILDDIR = $(BUILDDIR) + @echo ARCHIVES = $(ARCHIVES) + @echo CVSFILES = $(CVSFILES) + @echo PATCHES = $(PATCHES) ############################################################################## # Set up the environment folders: + mkdir -p $(BUILDDIR) mkdir -p $(CVSFILES) mkdir -p $(ARCHIVES) @@ -164,82 +177,83 @@ # Binutils: assembler, linker and more binutils-clean: - rm -rf $(BINUTILS) + rm -rf $(BUILDDIR)/$(BINUTILS) binutils-build: binutils-clean $(ARCHIVES)/$(BINUTILS).tar.bz2 - tar xjf $(ARCHIVES)/$(BINUTILS).tar.bz2 + @echo "Unpacking binutils" + cd $(BUILDDIR) && tar xjf $(ARCHIVES)/$(BINUTILS).tar.bz2 #~ @echo Applying extra mspgcc patches... - #~ cd $(BINUTILS); patch -p1 < binutils-21x1-42x-42x0.patch + #~ cd $(BUILDDIR)/$(BINUTILS); patch -p1 < $(PATCHES)/binutils-21x1-42x-42x0.patch @echo "Configure and building binutils (this takes a while)" - cd $(BINUTILS); ./configure --target=msp430 --prefix=$(INSTALLDIR) --disable-nls >$(BUILDDIR)/binutils-build.log 2>&1 - cd $(BINUTILS); make >>$(BUILDDIR)/binutils-build.log 2>&1 - @echo binutils done + cd $(BUILDDIR)/$(BINUTILS) && ./configure --target=msp430 --prefix=$(INSTALLDIR) --disable-nls >$(BUILDDIR)/binutils-build.log 2>&1 + cd $(BUILDDIR)/$(BINUTILS) && make >>$(BUILDDIR)/binutils-build.log 2>&1 + @echo binutils compiled binutils-install: - cd $(BINUTILS); make install >>$(BUILDDIR)/binutils-build.log 2>&1 + cd $(BUILDDIR)/$(BINUTILS); make install >>$(BUILDDIR)/binutils-build.log 2>&1 $(FILELIST) $(INSTALLDIR) >files-binutils.txt # The compiler # optional --program-suffix=-x.x --enable-languages=c,c++,ada,f77 gcc-clean: - rm -rf $(GCC) + rm -rf $(BUILDDIR)/$(GCC) gcc-build: gcc-clean \ $(ARCHIVES)/gcc-core-$(GCC_VERSION).tar.bz2 \ #~ $(ARCHIVES)/gcc-g++-$(GCC_VERSION).tar.bz2 \ #~ $(ARCHIVES)/gcc-ada-$(GCC_VERSION).tar.bz2 \ #~ $(ARCHIVES)/gcc-g77-$(GCC_VERSION).tar.bz2 - tar xjf $(ARCHIVES)/gcc-core-$(GCC_VERSION).tar.bz2 - #~ tar xjf $(ARCHIVES)/gcc-g++-$(GCC_VERSION).tar.bz2 - #~ tar xjf $(ARCHIVES)/gcc-ada-$(GCC_VERSION).tar.bz2 - #~ tar xjf $(ARCHIVES)/gcc-g77-$(GCC_VERSION).tar.bz2 - #~ tar xjf $(ARCHIVES)/gcc-java-$(GCC_VERSION).tar.bz2 + cd $(BUILDDIR) && tar xjf $(ARCHIVES)/gcc-core-$(GCC_VERSION).tar.bz2 + #~ cd $(BUILDDIR) && tar xjf $(ARCHIVES)/gcc-g++-$(GCC_VERSION).tar.bz2 + #~ cd $(BUILDDIR) && tar xjf $(ARCHIVES)/gcc-ada-$(GCC_VERSION).tar.bz2 + #~ cd $(BUILDDIR) && tar xjf $(ARCHIVES)/gcc-g77-$(GCC_VERSION).tar.bz2 + #~ cd $(BUILDDIR) && tar xjf $(ARCHIVES)/gcc-java-$(GCC_VERSION).tar.bz2 @echo Applying mspgcc patches - cp -r $(CVSFILESGCC)/* $(GCC) + cp -r $(CVSFILESGCC)/* $(BUILDDIR)/$(GCC) ifdef WINDOWS @echo Applying patch for oooooooold windoze - cd $(GCC); patch -p1 < ../gcc-3.2.3-cygwin.patch #win98 patch + cd $(BUILDDIR)/$(GCC); patch -p1 < $(PATCHES)/gcc-3.2.3-cygwin.patch #win98 patch endif @echo "Configuring and building msp430-gcc (this takes a while)" - cd $(GCC); ./configure --target=msp430 --prefix=$(INSTALLDIR) --disable-nls >$(BUILDDIR)/gcc-build.log 2>&1 - cd $(GCC); make >>$(BUILDDIR)/gcc-build.log 2>&1 + cd $(BUILDDIR)/$(GCC); ./configure --target=msp430 --prefix=$(INSTALLDIR) --disable-nls >$(BUILDDIR)/gcc-build.log 2>&1 + cd $(BUILDDIR)/$(GCC); make >>$(BUILDDIR)/gcc-build.log 2>&1 @echo msp430-gcc done gcc-install: $(FILELIST) $(INSTALLDIR) >files-before.txt - cd $(GCC); make install >>$(BUILDDIR)/gcc-build.log 2>&1 + cd $(BUILDDIR)/$(GCC); make install >>$(BUILDDIR)/gcc-build.log 2>&1 $(FILELIST) $(INSTALLDIR) >files-after.txt $(FILEDIFF) files-before.txt files-after.txt >files-gcc.txt $(FILELIST_RM) files-before.txt files-after.txt # The debugger gdb-clean: - rm -rf $(GDB) + rm -rf $(BUILDDIR)/$(GDB) gdb-build: gdb-clean \ $(ARCHIVES)/gdb-$(GDB_VERSION).tar.bz2 - tar xjf $(ARCHIVES)/gdb-$(GDB_VERSION).tar.bz2 + cd $(BUILDDIR) && tar xjf $(ARCHIVES)/gdb-$(GDB_VERSION).tar.bz2 @echo Applying mspgcc patches - cp -r $(CVSFILES)/gdb/gdb-$(GDB_VERSION)/* $(GDB) + cp -r $(CVSFILES)/gdb/gdb-$(GDB_VERSION)/* $(BUILDDIR)/$(GDB) @echo "Configuring and building msp430-gdb (this takes a while)" - cd $(GDB); ./configure --target=msp430 --prefix=$(INSTALLDIR) --disable-nls >$(BUILDDIR)/gdb-build.log 2>&1 - cd $(GDB); make >>$(BUILDDIR)/gdb-build.log 2>&1 + cd $(BUILDDIR)/$(GDB); ./configure --target=msp430 --prefix=$(INSTALLDIR) --disable-nls >$(BUILDDIR)/gdb-build.log 2>&1 + cd $(BUILDDIR)/$(GDB); make >>$(BUILDDIR)/gdb-build.log 2>&1 @echo msp430-gdb done gdb-install: $(FILELIST) $(INSTALLDIR) >files-before.txt - cd $(GDB); make install >>$(BUILDDIR)/gdb-build.log 2>&1 + cd $(BUILDDIR)/$(GDB); make install >>$(BUILDDIR)/gdb-build.log 2>&1 $(FILELIST) $(INSTALLDIR) >files-after.txt $(FILEDIFF) files-before.txt files-after.txt >files-gdb.txt $(FILELIST_RM) files-before.txt files-after.txt # C library for the cross compiler msp430-libc-clean: - rm -rf msp430-libc + rm -rf $(BUILDDIR)/msp430-libc msp430-libc-build: msp430-libc-clean - cp -r $(CVSFILES)/msp430-libc . - cd msp430-libc/src; cat Makefile | sed -e 's^/usr/local/msp430^$(INSTALLDIR)^' > Makefile-new - cd msp430-libc/src; rm Makefile - cd msp430-libc/src; mv Makefile-new Makefile - mkdir -p msp430-libc/src/msp1 msp430-libc/src/msp2 - cd msp430-libc/src; make >$(BUILDDIR)/libc-build.log 2>&1 + cp -r $(CVSFILES)/msp430-libc $(BUILDDIR) + cd $(BUILDDIR)/msp430-libc/src && cat Makefile | sed -e 's^/usr/local/msp430^$(INSTALLDIR)^' > Makefile-new + cd $(BUILDDIR)/msp430-libc/src && rm Makefile + cd $(BUILDDIR)/msp430-libc/src && mv Makefile-new Makefile + mkdir -p $(BUILDDIR)/msp430-libc/src/msp1 $(BUILDDIR)/msp430-libc/src/msp2 + cd $(BUILDDIR)/msp430-libc/src && make >$(BUILDDIR)/libc-build.log 2>&1 msp430-libc-install: $(FILELIST) $(INSTALLDIR) >files-before.txt - cd msp430-libc/src; make install >>$(BUILDDIR)/libc-build.log 2>&1 + cd $(BUILDDIR)/msp430-libc/src; make install >>$(BUILDDIR)/libc-build.log 2>&1 $(FILELIST) $(INSTALLDIR) >files-after.txt $(FILEDIFF) files-before.txt files-after.txt >files-libc.txt $(FILELIST_RM) files-before.txt files-after.txt @@ -250,50 +264,50 @@ # (lib)MSP430mspgcc.dll/so (lib)HIL.dll/so and giveio, loadrv on windows. libmspgcc-clean: - rm -rf libmspgcc + rm -rf $(BUILDDIR)/libmspgcc libmspgcc-build: libmspgcc-clean - mkdir libmspgcc - cp -r $(CVSFILES)/jtag/* libmspgcc/ - cd libmspgcc; make >$(BUILDDIR)/libmspgcc-build.log 2>&1 + mkdir $(BUILDDIR)/libmspgcc + cp -r $(CVSFILES)/jtag/* $(BUILDDIR)/libmspgcc/ + cd $(BUILDDIR)/libmspgcc && make >$(BUILDDIR)/libmspgcc-build.log 2>&1 libmspgcc-install: ifdef WINDOWS - cp libmspgcc/msp430/MSP430mspgcc.dll $(INSTALLDIR)/bin - cp libmspgcc/hardware_access/HIL.dll $(INSTALLDIR)/bin + cp $(BUILDDIR)/libmspgcc/msp430/MSP430mspgcc.dll $(INSTALLDIR)/bin + cp $(BUILDDIR)/libmspgcc/hardware_access/HIL.dll $(INSTALLDIR)/bin mkdir -p $(INSTALLDIR)/giveio - cd libmspgcc/hardware_access/giveio; \ + cd $(BUILDDIR)/libmspgcc/hardware_access/giveio; \ cp install_giveio.bat remove_giveio.bat status_giveio.bat \ loaddrv.exe giveio.sys README.txt \ $(INSTALLDIR)/giveio else - cd libmspgcc/msp430; make install LIB_PREFIX=$(INSTALLDIR)/lib >>$(BUILDDIR)/libmspgcc-build.log 2>&1 - cd libmspgcc/hardware_access; make install LIB_PREFIX=$(INSTALLDIR)/lib >>$(BUILDDIR)/libmspgcc-build.log 2>&1 + cd $(BUILDDIR)/libmspgcc/msp430 && make install LIB_PREFIX=$(INSTALLDIR)/lib >>$(BUILDDIR)/libmspgcc-build.log 2>&1 + cd $(BUILDDIR)/libmspgcc/hardware_access && make install LIB_PREFIX=$(INSTALLDIR)/lib >>$(BUILDDIR)/libmspgcc-build.log 2>&1 endif # Examples. Cleanup the examples folder and install them. examples-build: - rm -rf examples - mkdir examples - cp -r $(CVSFILES)/examples/* examples - cd examples; make clean >$(BUILDDIR)/examples.log 2>&1 - rm -rf `find examples/ -name CVS -type d` + rm -rf $(BUILDDIR)/examples + mkdir $(BUILDDIR)/examples + cp -r $(CVSFILES)/examples/* $(BUILDDIR)/examples + cd $(BUILDDIR)/examples; make clean >$(BUILDDIR)/examples.log 2>&1 + rm -rf `find $(BUILDDIR)/examples/ -name CVS -type d` examples-install: ifdef WINDOWS - cp -r examples $(INSTALLDIR) >>$(BUILDDIR)/examples.log 2>&1 + cp -r $(BUILDDIR)/examples $(INSTALLDIR) >>$(BUILDDIR)/examples.log 2>&1 else mkdir -p $(INSTALLDIR)/share/doc/mspgcc-examples - cp -r examples/* $(INSTALLDIR)/share/doc/mspgcc-examples >>$(BUILDDIR)/examples.log 2>&1 + cp -r $(BUILDDIR)/examples/* $(INSTALLDIR)/share/doc/mspgcc-examples >>$(BUILDDIR)/examples.log 2>&1 endif $(FILELIST) $(INSTALLDIR)/examples >files-examples.txt # Addon mspgcc libraries: libmspgcc libcommandline and more libraries-build: - rm -rf libraries - mkdir libraries - cp -r $(CVSFILES)/libraries/* libraries - cd libraries; make >$(BUILDDIR)/libraries.log 2>&1 + rm -rf $(BUILDDIR)/libraries + mkdir $(BUILDDIR)/libraries + cp -r $(CVSFILES)/libraries/* $(BUILDDIR)/libraries + cd $(BUILDDIR)/libraries; make >$(BUILDDIR)/libraries.log 2>&1 libraries-install: $(FILELIST) $(INSTALLDIR) >files-before.txt - cd libraries; make PREFIX=$(INSTALLDIR) install >>$(BUILDDIR)/libraries.log 2>&1 + cd $(BUILDDIR)/libraries; make PREFIX=$(INSTALLDIR) install >>$(BUILDDIR)/libraries.log 2>&1 $(FILELIST) $(INSTALLDIR) >files-after.txt $(FILEDIFF) files-before.txt files-after.txt >files-libraries.txt $(FILELIST_RM) files-before.txt files-after.txt @@ -312,23 +326,23 @@ # msp430-jtag, msp430-bsl and more tools pytools-build: - rm -rf python - mkdir python - cp -r $(CVSFILES)/python/* python/ + rm -rf $(BUILDDIR)/python + mkdir $(BUILDDIR)/python + cp -r $(CVSFILES)/python/* $(BUILDDIR)/python/ ifdef WINDOWS - cp libmspgcc/msp430/MSP430mspgcc.dll python/ - cp libmspgcc/hardware_access/HIL.dll python/ - cd python/win32 && rm -rf ../build; python setup-bsl-py2exe.py - cd python/win32 && rm -rf ../build; python setup-jtag-py2exe.py - cd python/win32 && rm -rf ../build; python setup-downloader-py2exe.py + cp $(BUILDDIR)/libmspgcc/msp430/MSP430mspgcc.dll $(BUILDDIR)/python/ + cp $(BUILDDIR)/libmspgcc/hardware_access/HIL.dll $(BUILDDIR)/python/ + cd $(BUILDDIR)/python/win32 && rm -rf ../build; python setup-bsl-py2exe.py + cd $(BUILDDIR)/python/win32 && rm -rf ../build; python setup-jtag-py2exe.py + cd $(BUILDDIR)/python/win32 && rm -rf ../build; python setup-downloader-py2exe.py else - rm -r python/CVS python/msp430/CVS - echo "#!/bin/bash" >python/msp430-jtag - echo "# Wrapper script for msp430-jtag.py. It passes the location" >>python/msp430-jtag - echo "# of the mspgcc libraries in environment variables." >>python/msp430-jtag - echo "export LIBMSPGCC_PATH=$(INSTALLDIR)/lib" >>python/msp430-jtag - echo "export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(INSTALLDIR)/lib" >>python/msp430-jtag - echo "exec $(INSTALLDIR)/bin/msp430-jtag-unwrapped \$$@" >>python/msp430-jtag + rm -r $(BUILDDIR)/python/CVS python/msp430/CVS + echo "#!/bin/bash" >$(BUILDDIR)/python/msp430-jtag + echo "# Wrapper script for msp430-jtag.py. It passes the location" >>$(BUILDDIR)/python/msp430-jtag + echo "# of the mspgcc libraries in environment variables." >>$(BUILDDIR)/python/msp430-jtag + echo "export LIBMSPGCC_PATH=$(INSTALLDIR)/lib" >>$(BUILDDIR)/python/msp430-jtag + echo "export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(INSTALLDIR)/lib" >>$(BUILDDIR)/python/msp430-jtag + echo "exec $(INSTALLDIR)/bin/msp430-jtag-unwrapped \$$@" >>$(BUILDDIR)/python/msp430-jtag endif # this installs the msp430 python library only for the mspgcc tools # windows: the py2exe'd files are just copied @@ -338,14 +352,14 @@ # libHIL libraries do not need to be installed system wide. pytools-install: ifdef WINDOWS - cp -r python/bin/* $(INSTALLDIR)/bin + cp -r $(BUILDDIR)/python/bin/* $(INSTALLDIR)/bin else - install python/msp430-jtag $(INSTALLDIR)/bin/msp430-jtag - install python/msp430-jtag.py $(INSTALLDIR)/bin/msp430-jtag-unwrapped - install python/msp430-bsl.py $(INSTALLDIR)/bin/msp430-bsl - install python/msp430-ram-usage.py $(INSTALLDIR)/bin/msp430-ram-usage - install python/titext2ihex.py $(INSTALLDIR)/bin/titext2ihex - cp -r python/msp430 $(INSTALLDIR)/bin + install $(BUILDDIR)/python/msp430-jtag $(INSTALLDIR)/bin/msp430-jtag + install $(BUILDDIR)/python/msp430-jtag.py $(INSTALLDIR)/bin/msp430-jtag-unwrapped + install $(BUILDDIR)/python/msp430-bsl.py $(INSTALLDIR)/bin/msp430-bsl + install $(BUILDDIR)/python/msp430-ram-usage.py $(INSTALLDIR)/bin/msp430-ram-usage + install $(BUILDDIR)/python/titext2ihex.py $(INSTALLDIR)/bin/titext2ihex + cp -r $(BUILDDIR)/python/msp430 $(INSTALLDIR)/bin endif # strip executables so that they get smaller @@ -381,7 +395,7 @@ libmspgcc-build libmspgcc-install \ stripfiles \ pytools-build pytools-install \ - libraries-buils libraries-install + libraries-build libraries-install # Examples and documentation build-addon: examples-build examples-install docs-install @@ -406,6 +420,9 @@ pytools-install \ examples-install docs-install +.PHONY: FORCE +FORCE: + ############################################################################## #### Windows installer ############################################################################## @@ -413,28 +430,33 @@ # file list -> NSIS include conversion msp430-binutils-install.nsh: files-binutils.txt - python files-to_nsh.py files-binutils.txt binutils $(INSTALLDIR) + python files_to_nsh.py files-binutils.txt binutils $(INSTALLDIR) msp430-gcc-install.nsh: files-gcc.txt - python files-to_nsh.py files-gcc.txt gcc $(INSTALLDIR) + python files_to_nsh.py files-gcc.txt gcc $(INSTALLDIR) msp430-gdb-install.nsh: files-gdb.txt - python files-to_nsh.py files-gdb.txt gdb $(INSTALLDIR) + python files_to_nsh.py files-gdb.txt gdb $(INSTALLDIR) msp430-libc-install.nsh: files-libc.txt - python files-to_nsh.py files-libc.txt libc $(INSTALLDIR) + python files_to_nsh.py files-libc.txt libc $(INSTALLDIR) msp430-docs-install.nsh: files-docs.txt - python files-to_nsh.py files-docs.txt docs $(INSTALLDIR) + python files_to_nsh.py files-docs.txt docs $(INSTALLDIR) msp430-examples-install.nsh: files-examples.txt - python files-to_nsh.py files-examples.txt examples $(INSTALLDIR) + python files_to_nsh.py files-examples.txt examples $(INSTALLDIR) msp430-libraries-install.nsh: files-libraries.txt python files_to_nsh.py files-libraries.txt libraries $(INSTALLDIR) +installer-variables: FORCE + echo '!define VERSION "$(BUILDDATE)"' >variables.nsh + echo '!define SRCDIR "$(shell cygpath -w $(INSTALLDIR))"' >>variables.nsh + # process all the file lists, build installer windows-installer: stamp msp430-binutils-install.nsh msp430-gcc-install.nsh \ msp430-gdb-install.nsh msp430-libc-install.nsh \ - msp430-docs-install.nsh msp430-examples-install.nsh + msp430-docs-install.nsh msp430-examples-install.nsh \ + msp430-libraries-install.nsh installer-variables $(NSIS) mspgcc-full-install.nsi ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php