alexforencich / xboot

XBoot Extensible Bootloader
125 stars 69 forks source link

Build fails on windows with AS6.1. #9

Open fake-name opened 10 years ago

fake-name commented 10 years ago

I'm trying to build xboot on windows, using a completely stock setup (just did a fresh check-out) with AS6.1.

I have all the relevant binaries on my $PATH.

I've copied the example x32a4.conf.mk from the conf directory into the main directory.

Running make -d x32a4.conf.mk fails with

Removing child 0x0251a080 PID 39087024 from chain.
  Successfully remade target file `gccversion'.
  Considering target file `sizebefore'.
   File `sizebefore' does not exist.
   Finished prerequisites of target file `sizebefore'.
  Must remake target `sizebefore'.
Creating temporary batch file D:\NEKOPR~2\AppData\Local\Temp\make809684-1.bat
CreateProcess(D:\NEKOPR~2\AppData\Local\Temp\make809684-1.bat,D:\NEKOPR~2\AppData\Local\Temp\make809684-1.bat,...)
Putting child 0x0251a080 (sizebefore) PID 39087024 on the chain.
Live child 0x0251a080 (sizebefore) PID 39087024
-f was unexpected at this time.

I've been trying to poke around and fix things, but makefiles melt my brain, and I really don't know how to fix this.

I have cygwin installed locally, and I added SHELL=C:/cygwin/bin/sh.exe at the beginning of the makefile, but that just results in another error:

CreateProcess(C:\cygwin\bin\sh.exe,C:/cygwin/bin/sh.exe -c "echo >> config.h",...)
Live child 0x0251a260 (config.h) PID 39096208
Reaping winning child 0x0251a260 PID 39096208
CreateProcess(C:\cygwin\bin\sh.exe,C:/cygwin/bin/sh.exe -c "if [ \"1\" = \"y\" ] || [ \"1\" = \"yes\" ] ; then echo \"#define ATTACH_LED_INV\" >> config.h ; elif [ -n \"1\" ] && [ \"1\" != \"n\" ] && [ \"1\" != \"no\" ] ; then echo \"#define ATTACH_LED_INV 1\" >> config.h ; fi ;  if [ \"1\" = \"y\" ] || [ \"1\" = \"yes\" ] ; then echo \"#define ATTACH_LED_PIN\" >> config.h ; elif [ -n \"1\" ] && [ \"1\" != \"n\" ] && [ \"1\" != \"no\" ] ; then echo \"#define ATTACH_LED_PIN 1\" >> config.h ; fi ;  if [ \"A\" = \"y\" ] || [ \"A\" = \"yes\" ] ; then echo \"#define ATTACH_LED_PORT_NAME\" >> config.h ; elif [ -n \"A\" ] && [ \"A\" != \"n\" ] && [ \"A\" != \"no\" ] ; then echo \"#define ATTACH_LED_PORT_NAME A\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define ENABLE_API\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define ENABLE_API yes\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define ENABLE_API_FIRMWARE_UPDATE\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define ENABLE_API_FIRMWARE_UPDATE yes\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define ENABLE_API_LOW_LEVEL_FLASH\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define ENABLE_API_LOW_LEVEL_FLASH yes\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define ENABLE_API_SPM_WRAPPER\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define ENABLE_API_SPM_WRAPPER yes\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define ENABLE_BLOCK_SUPPORT\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define ENABLE_BLOCK_SUPPORT yes\" >> config.h ; fi ;  if [ \"no\" = \"y\" ] || [ \"no\" = \"yes\" ] ; then echo \"#define ENABLE_BOOTLOADER_PROTECTION\" >> config.h ; elif [ -n \"no\" ] && [ \"no\" != \"n\" ] && [ \"no\" != \"no\" ] ; then echo \"#define  ENABLE_BOOTLOADER_PROTECTION no\" >> config.h ; fi ;  if [ \"no\" = \"y\" ] || [ \"no\" = \"yes\" ] ; then echo \"#define ENABLE_CODE_PROTECTION\" >> config.h ; elif [ -n \"no\" ] && [ \"no\" != \"n\" ] && [ \"no\" != \"no\" ] ; then echo \"#define ENABLE_CODE_PROTECTION no\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define ENABLE_CRC_SUPPORT\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define ENABLE_CRC_SUPPORT yes\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define ENABLE_EEPROM_BYTE_SUPPORT\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define ENABLE_EEPROM_BYTE_SUPPORT yes\" >> config.h ; fi ;  if [ \"no\" = \"y\" ] || [ \"no\" = \"yes\" ] ; then echo \"#define ENABLE_EEPROM_PROTECTION\" >> config.h ; elif [ -n \"no\" ] && [ \"no\" != \"n\" ] && [ \"no\" != \"no\" ] ; then echo \"#define ENABLE_EEPROM_PROTECTION no\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define ENABLE_FLASH_BYTE_SUPPORT\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define ENABLE_FLASH_BYTE_SUPPORT yes\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define ENABLE_FLASH_ERASE_WRITE\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define ENABLE_FLASH_ERASE_WRITE yes\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define ENABLE_FUSE_BITS\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define ENABLE_FUSE_BITS yes\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define ENABLE_LOCK_BITS\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define ENABLE_LOCK_BITS yes\" >> config.h ; fi ;  if [ \"3\" = \"y\" ] || [ \"3\" = \"yes\" ] ; then echo \"#define ENTER_BLINK_COUNT\" >> config.h ; elif [ -n \"3\" ] && [ \"3\" != \"n\" ] && [ \"3\" != \"no\" ] ; then echo \"#define ENTER_BLINK_COUNT 3\" >> config.h ; fi ;  if [ \"30000\" = \"y\" ] || [ \"30000\" = \"yes\" ] ; then echo \"#define ENTER_BLINK_WAIT\" >> config.h ; elif [ -n \"30000\" ] && [ \"30000\" != \"n\" ] && [ \"30000\" != \"no\" ] ; then echo \"#define ENTER_BLINK_WAIT 30000\" >> config.h ; fi ;  if [ \"0\" = \"y\" ] || [ \"0\" = \"yes\" ] ; then echo \"#define ENTER_PIN\" >> config.h ; elif [ -n \"0\" ] && [ \"0\" != \"n\" ] && [ \"0\" != \"no\" ] ; then echo \"#define ENTER_PIN 0\" >> config.h ; fi ;  if [ \"1\" = \"y\" ] || [ \"1\" = \"yes\" ] ; then echo \"#define ENTER_PIN_PUEN\" >> config.h ; elif [ -n \"1\" ] && [ \"1\" != \"n\" ] && [ \"1\" != \"no\" ] ; then echo \"#define ENTER_PIN_PUEN 1\" >> config.h ; fi ;  if [ \"0\" = \"y\" ] || [ \"0\" = \"yes\" ] ; then echo \"#define ENTER_PIN_STATE\" >> config.h ; elif [ -n \"0\" ] && [ \"0\" != \"n\" ] && [ \"0\" != \"no\" ] ; then echo \"#define ENTER_PIN_STATE 0\" >> config.h ; fi ;  if [ \"C\" = \"y\" ] || [ \"C\" = \"yes\" ] ; then echo \"#define ENTER_PORT_NAME\" >> config.h ; elif [ -n \"C\" ] && [ \"C\" != \"n\" ] && [ \"C\" != \"no\" ] ; then echo \"#define ENTER_PORT_NAME C\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define FIFO_BIT_REVERSE\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define FIFO_BIT_REVERSE yes\" >> config.h ; fi ;  if [ \"D\" = \"y\" ] || [ \"D\" = \"yes\" ] ; then echo \"#define FIFO_CTL_PORT_NAME\" >> config.h ; elif [ -n \"D\" ] && [ \"D\" != \"n\" ] && [ \"D\" != \"no\" ] ; then echo \"#define FIFO_CTL_PORT_NAME D\" >> config.h ; fi ;  if [ \"C\" = \"y\" ] || [ \"C\" = \"yes\" ] ; then echo \"#define FIFO_DATA_PORT_NAME\" >> config.h ; elif [ -n \"C\" ] && [ \"C\" != \"n\" ] && [ \"C\" != \"no\" ] ; then echo \"#define FIFO_DATA_PORT_NAME C\" >> config.h ; fi ;  if [ \"1\" = \"y\" ] || [ \"1\" = \"yes\" ] ; then echo \"#define FIFO_RD_N\" >> config.h ; elif [ -n \"1\" ] && [ \"1\" != \"n\" ] && [ \"1\" != \"no\" ] ; then echo \"#define FIFO_RD_N 1\" >> config.h ; fi ;  if [ \"3\" = \"y\" ] || [ \"3\" = \"yes\" ] ; then echo \"#define FIFO_RXF_N\" >> config.h ; elif [ -n \"3\" ] && [ \"3\" != \"n\" ] && [ \"3\" != \"no\" ] ; then echo \"#define FIFO_RXF_N 3\" >> config.h ; fi ;  if [ \"2\" = \"y\" ] || [ \"2\" = \"yes\" ] ; then echo \"#define FIFO_TXE_N\" >> config.h ; elif [ -n \"2\" ] && [ \"2\" != \"n\" ] && [ \"2\" != \"no\" ] ; then echo \"#define FIFO_TXE_N 2\" >> config.h ; fi ;  if [ \"0\" = \"y\" ] || [ \"0\" = \"yes\" ] ; then echo \"#define FIFO_WR_N\" >> config.h ; elif [ -n \"0\" ] && [ \"0\" != \"n\" ] && [ \"0\" != \"no\" ] ; then echo \"#define FIFO_WR_N 0\" >> config.h ; fi ;  if [ \"0x10\" = \"y\" ] || [ \"0x10\" = \"yes\" ] ; then echo \"#define I2C_ADDRESS\" >> config.h ; elif [ -n \"0x10\" ] && [ \"0x10\" != \"n\" ] && [ \"0x10\" != \"no\" ] ; then echo \"#define I2C_ADDRESS 0x10\" >> config.h ; fi ;  if [ \"0\" = \"y\" ] || [ \"0\" = \"yes\" ] ; then echo \"#define I2C_AUTONEG_DIS_GC\" >> config.h ; elif [ -n \"0\" ] && [ \"0\" != \"n\" ] && [ \"0\" != \"no\" ] ; then echo \"#define I2C_AUTONEG_DIS_GC 0\" >> config.h ; fi ;  if [ \"1\" = \"y\" ] || [ \"1\" = \"yes\" ] ; then echo \"#define I2C_AUTONEG_DIS_PROMISC\" >> config.h ; elif [ -n \"1\" ] && [ \"1\" != \"n\" ] && [ \"1\" != \"no\" ] ; then echo \"#define I2C_AUTONEG_DIS_PROMISC 1\" >> config.h ; fi ;  if [ \"2\" = \"y\" ] || [ \"2\" = \"yes\" ] ; then echo \"#define I2C_AUTONEG_PIN\" >> config.h ; elif [ -n \"2\" ] && [ \"2\" != \"n\" ] && [ \"2\" != \"no\" ] ; then echo \"#define I2C_AUTONEG_PIN 2\" >> config.h ; fi ;  if [ \"A\" = \"y\" ] || [ \"A\" = \"yes\" ] ; then echo \"#define I2C_AUTONEG_PORT_NAME\" >> config.h ; elif [ -n \"A\" ] && [ \"A\" != \"n\" ] && [ \"A\" != \"no\" ] ; then echo \"#define I2C_AUTONEG_PORT_NAME A\" >> config.h ; fi ;  if [ \"C\" = \"y\" ] || [ \"C\" = \"yes\" ] ; then echo \"#define I2C_DEVICE_PORT\" >> config.h ; elif [ -n \"C\" ] && [ \"C\" != \"n\" ] && [ \"C\" != \"no\" ] ; then echo \"#define I2C_DEVICE_PORT C\" >> config.h ; fi ;  if [ \"1\" = \"y\" ] || [ \"1\" = \"yes\" ] ; then echo \"#define I2C_GC_ENABLE\" >> config.h ; elif [ -n \"1\" ] && [ \"1\" != \"n\" ] && [ \"1\" != \"no\" ] ; then echo \"#define I2C_GC_ENABLE 1\" >> config.h ; fi ;  if [ \"1\" = \"y\" ] || [ \"1\" = \"yes\" ] ; then echo \"#define I2C_MATCH_ANY\" >> config.h ; elif [ -n \"1\" ] && [ \"1\" != \"n\" ] && [ \"1\" != \"no\" ] ; then echo \"#define I2C_MATCH_ANY 1\" >> config.h ; fi ;  if [ \"1\" = \"y\" ] || [ \"1\" = \"yes\" ] ; then echo \"#define LED_INV\" >> config.h ; elif [ -n \"1\" ] && [ \"1\" != \"n\" ] && [ \"1\" != \"no\" ] ; then echo \"#define LED_INV 1\" >> config.h ; fi ;  if [ \"0\" = \"y\" ] || [ \"0\" = \"yes\" ] ; then echo \"#define LED_PIN\" >> config.h ; elif [ -n \"0\" ] && [ \"0\" != \"n\" ] && [ \"0\" != \"no\" ] ; then echo \"#define LED_PIN 0\" >> config.h ; fi ;  if [ \"A\" = \"y\" ] || [ \"A\" = \"yes\" ] ; then echo \"#define LED_PORT_NAME\" >> config.h ; elif [ -n \"A\" ] && [ \"A\" != \"n\" ] && [ \"A\" != \"no\" ] ; then echo \"#define LED_PORT_NAME A\" >> config.h ; fi ;  if [ \"115200\" = \"y\" ] || [ \"115200\" = \"yes\" ] ; then echo \"#define UART_BAUD_RATE\" >> config.h ; elif [ -n \"115200\" ] && [ \"115200\" != \"n\" ] && [ \"115200\" != \"no\" ] ; then echo \"#define UART_BAUD_RATE 115200\" >> config.h ; fi ;  if [ \"4\" = \"y\" ] || [ \"4\" = \"yes\" ] ; then echo \"#define UART_EN_PIN\" >> config.h ; elif [ -n \"4\" ] && [ \"4\" != \"n\" ] && [ \"4\" != \"no\" ] ; then echo \"#define UART_EN_PIN 4\" >> config.h ; fi ;  if [ \"0\" = \"y\" ] || [ \"0\" = \"yes\" ] ; then echo \"#define UART_EN_PIN_INV\" >> config.h ; elif [ -n \"0\" ] && [ \"0\" != \"n\" ] && [ \"0\" != \"no\" ] ; then echo \"#define UART_EN_PIN_INV 0\" >> config.h ; fi ;  if [ \"C\" = \"y\" ] || [ \"C\" = \"yes\" ] ; then echo \"#define UART_EN_PORT_NAME\" >> config.h ; elif [ -n \"C\" ] && [ \"C\" != \"n\" ] && [ \"C\" != \"no\" ] ; then echo \"#define UART_EN_PORT_NAME C\" >> config.h ; fi ;  if [ \"0\" = \"y\" ] || [ \"0\" = \"yes\" ] ; then echo \"#define UART_NUMBER\" >> config.h ; elif [ -n \"0\" ] && [ \"0\" != \"n\" ] && [ \"0\" != \"no\" ] ; then echo \"#define UART_NUMBER 0\" >> config.h ; fi ;  if [ \"C\" = \"y\" ] || [ \"C\" = \"yes\" ] ; then echo \"#define UART_PORT_NAME\" >> config.h ; elif [ -n \"C\" ] && [ \"C\" != \"n\" ] && [ \"C\" != \"no\" ] ; then echo \"#define UART_PORT_NAME C\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define UART_RX_PUEN\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define UART_RX_PUEN yes\" >> config.h ; fi ;  if [ \"1\" = \"y\" ] || [ \"1\" = \"yes\" ] ; then echo \"#define USE_API_VERSION\" >> config.h ; elif [ -n \"1\" ] && [ \"1\" != \"n\" ] && [ \"1\" != \"no\" ] ; then echo \"#define USE_API_VERSION 1\" >> config.h ; fi ;  if [ \"no\" = \"y\" ] || [ \"no\" = \"yes\" ] ; then echo \"#define USE_ATTACH_LED\" >> config.h ; elif [ -n \"no\" ] && [ \"no\" != \"n\" ] && [ \"no\" != \"no\" ] ; then echo \"#define USE_ATTACH_LED no\" >> config.h ; fi ;  if [ \"no\" = \"y\" ] || [ \"no\" = \"yes\" ] ; then echo \"#define USE_AVR1008_EEPROM\" >> config.h ; elif [ -n \"no\" ] && [ \"no\" != \"n\" ] && [ \"no\" != \"no\" ] ; then echo \"#define USE_AVR1008_EEPROM no\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define USE_ENTER_DELAY\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define USE_ENTER_DELAY yes\" >> config.h ; fi ;  if [ \"no\" = \"y\" ] || [ \"no\" = \"yes\" ] ; then echo \"#define USE_ENTER_FIFO\" >> config.h ; elif [ -n \"no\" ] && [ \"no\" != \"n\" ] && [ \"no\" != \"no\" ] ; then echo \"#define USE_ENTER_FIFO no\" >> config.h ; fi ;  if [ \"no\" = \"y\" ] || [ \"no\" = \"yes\" ] ; then echo \"#define USE_ENTER_I2C\" >> config.h ; elif [ -n \"no\" ] && [ \"no\" != \"n\" ] && [ \"no\" != \"no\" ] ; then echo \"#define USE_ENTER_I2C no\" >> config.h ; fi ;  if [ \"no\" = \"y\" ] || [ \"no\" = \"yes\" ] ; then echo \"#define USE_ENTER_PIN\" >> config.h ; elif [ -n \"no\" ] && [ \"no\" != \"n\" ] && [ \"no\" != \"no\" ] ; then echo \"#define USE_ENTER_PIN no\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define USE_ENTER_UART\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define USE_ENTER_UART yes\" >> config.h ; fi ;  if [ \"no\" = \"y\" ] || [ \"no\" = \"yes\" ] ; then echo \"#define USE_FIFO\" >> config.h ; elif [ -n \"no\" ] && [ \"no\" != \"n\" ] && [ \"no\" != \"no\" ] ; then echo \"#define USE_FIFO no\" >> config.h ; fi ;  if [ \"no\" = \"y\" ] || [ \"no\" = \"yes\" ] ; then echo \"#define USE_I2C\" >> config.h ; elif [ -n \"no\" ] && [ \"no\" != \"n\" ] && [ \"no\" != \"no\" ] ; then echo \"#define USE_I2C no\" >> config.h ; fi ;  if [ \"no\" = \"y\" ] || [ \"no\" = \"yes\" ] ; then echo \"#define USE_I2C_ADDRESS_NEGOTIATION\" >> config.h ; elif [ -n \"no\" ] && [ \"no\" != \"n\" ] && [ \"no\" != \"no\" ] ; then echo \"#define USE_I2C_ADDRESS_NEGOTIATION no\" >> config.h ; fi ;  if [ \"no\" = \"y\" ] || [ \"no\" = \"yes\" ] ; then echo \"#define USE_INTERRUPTS\" >> config.h ; elif [ -n \"no\" ] && [ \"no\" != \"n\" ] && [ \"no\" != \"no\" ] ; then echo \"#define USE_INTERRUPTS no\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define USE_LED\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define USE_LED yes\" >> config.h ; fi ;  if [ \"yes\" = \"y\" ] || [ \"yes\" = \"yes\" ] ; then echo \"#define USE_UART\" >> config.h ; elif [ -n \"yes\" ] && [ \"yes\" != \"n\" ] && [ \"yes\" != \"no\" ] ; then echo \"#define USE_UART yes\" >> config.h ; fi ;  if [ \"no\" = \"y\" ] || [ \"no\" = \"yes\" ] ; then echo \"#define USE_UART_EN_PIN\" >> config.h ; elif [ -n \"no\" ] && [ \"no\" != \"n\" ] && [ \"no\" != \"no\" ] ; then echo \"#define USE_UART_EN_PIN no\" >> config.h ; fi ;  if [ \"no\" = \"y\" ] || [ \"no\" = \"yes\" ] ; then echo \"#define USE_WATCHDOG\" >> config.h ; elif [ -n \"no\" ] && [ \"no\" != \"n\" ] && [ \"no\" != \"no\" ] ; then echo \"#define USE_WATCHDOG no\" >> config.h ; fi ;  if [ \"WDT_PER_1KCLK_gc\" = \"y\" ] || [ \"WDT_PER_1KCLK_gc\" = \"yes\" ] ; then echo \"#define WATCHDOG_TIMEOUT\" >> config.h ; elif [ -n \"WDT_PER_1KCLK_gc\" ] && [ \"WDT_PER_1KCLK_gc\" != \"n\" ] && [ \"WDT_PER_1KCLK_gc\" != \"no\" ] ; then echo \"#define WATCHDOG_TIMEOUT WDT_PER_1KCLK_gc\" >> config.h ; fi ;",...)
Live child 0x0251a260 (config.h) PID 39096208
/usr/bin/sh: -c: line 1: syntax error: unexpected end of file
Reaping losing child 0x0251a260 PID 39096208
make[1]: *** [config.h] Error 1
Removing child 0x0251a260 PID 39096208 from chain.

Which looks like a bit much to be passing on the command line. I'd guess that in this case, the command line arguments are being truncated.

I can't just install winavr as I want to eventually try to port xboot to the xmega32e5, which isn't supported by the FOSS avr-gcc, at least without building from sources, which is also a bit beyond me.

Is there any way to build xboot as an Atmel Studio project?

Thanks.

alexforencich commented 10 years ago

Hmm. Well, it looks like the part generating that very long command line is config.h.mk. It may be possible to rework it to avoid such a long command line. I will see what I can do about it.

alexforencich commented 10 years ago

Also, which shell did you run make in? Did you run it from the windows command line or from cygwin? Or did you start up a windows command line, run 'sh', and then run 'make' from within sh?

fake-name commented 10 years ago

This is all using the windows cmd.exe prompt (well, I use the Console2 cmd.exe wrapper, but anyways).

The only difference between the two runs is one I specify SHELL=C:/cygwin/bin/sh.exe in the makefile.

I couldn't get the makefile to work at all under cygwin due to %PATH% issues.

fake-name commented 10 years ago

Ideally, the makefile should work with the simplified version of make that is provided with AS.

As I understand it, AS6 comes with a version of make that isn't quite a full version. Also, some of the commands do not work in the windows cmd.exe prompt.

Looking into the error -f was unexpected at this time., this is originating in the sizebefore target.
@if [ -f $(TARGET).elf ]; then echo; echo $(MSG_SIZE_BEFORE); $(ELFSIZE); echo; fi

Since this seems to just be a debug statement, I removed the sizebefore and sizeafter target statements in all.

The build then fails partway through generating config.h.

CreateProcess(D:\NEKOPR~2\AppData\Local\Temp\make746408-1.bat,D:\NEKOPR~2\AppData\Local\Temp\make746408-1.bat,...)
Live child 0x0254a938 (config.h) PID 39277312
"1" was unexpected at this time.
Reaping losing child 0x0254a938 PID 39277312
Cleaning up temp batch file D:\NEKOPR~2\AppData\Local\Temp\make746408-1.bat
make[1]: *** [config.h] Error 255
Removing child 0x0254a938 PID 39277312 from chain.
make[1]: Leaving directory `D:/NekoProfile/Desktop/xboot'
Reaping losing child 0x0254a7f0 PID 39277400
make: *** [x32a4.conf.mk] Error 2
Removing child 0x0254a7f0 PID 39277400 from chain.

D:\NekoProfile\Desktop\xboot>

Unfortunately, despite the fact that it failed, make still apparently feels the need to clean up the failing temporary .bat file, so I can't pinpoint what is causing the error.

fake-name commented 10 years ago

It's probably worth noting that make clean also fails on windows, since rm returns an error if you try to remove a non-existent file. This makes the clean exit prematurely.

fake-name commented 10 years ago

It's also worth noting that I took the giant failed one-liner from above, and massaged it (manually) into a proper sh script, and was able to successfully run it and generate a config.h file, so there isn't anything theoretically wrong with it's contents.

It still fails to build, though:


-------- begin --------
avr-gcc (AVR_8_bit_GNU_Toolchain_3.4.2_992) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiling: xboot.c
avr-gcc -c -mmcu=atxmega32e5 -I. -gstabs   -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -fno-jump-tables -Wall -Wa,-adhlns=xboot.lst  -Wstrict-prototypes -std=gnu99 -MD -MP -MF .dep/xboot.o.d -DF_CPU=32000000L -DUSE_CONFIG_H xboot.c -o xboot.o
In file included from xboot.h:398:0,
                 from xboot.c:34:
uart.h:86:45: warning: always_inline function might not be inlinable [-Wattributes]
uart.h:85:45: warning: always_inline function might not be inlinable [-Wattributes]
xboot.c: In function 'main':
uart.h:85:45: error: inlining failed in call to always_inline 'uart_init': function body not available
xboot.c:224:18: error: called from here
In file included from xboot.h:398:0,
                 from xboot.c:34:
uart.h:86:45: error: inlining failed in call to always_inline 'uart_deinit': function body not available
xboot.c:888:20: error: called from here
make: *** [xboot.o] Error 1

D:\NekoProfile\Desktop\xboot-master>

Which looks like an include issue, or the .S file isn't being properly assembled beforehand.

alexforencich commented 10 years ago

If it wasn't a proper sh script, I would have noticed long ago :)

I am wondering if there is a good way to break it up into a multiline script so it will call sh once per line instead of once for a gigantic pile of concatenated lines. Unfortunately, I am attending a conference at the moment and I have not had a chance to really work on the issue.

There have been issues with always_inline in the past; I think I misunderstood how it worked as gcc isn't as smart as it could be wrt. inlining functions that are defined in different files. Try removing any always_inline statements (looks like the problematic one is in uart.h) and trying again.

fake-name commented 10 years ago

I don't think the issue is the always_inline, since the trunk compiles fine on other platforms, even with the latest avr-gcc.

At the moment, I'm just using a linux-VM for my dev stuff.

AvnerGidron commented 8 years ago

Hi, I have the same problem... did you managed to fix this? Thanks, Avner