I'm confused, or have been mistaken... when I ran the make it told me it had nothing to do, I think because the tmp files where still left over from when I built it on NT, I've gotten a bit confused. Sorry for possible confusion...
The make works now i've installed avr-gcc for Ubuntu 8.10 (simple instructions prebuilt at
http://www.avride.com/pop/?p=12) And i use the linux
command which picks up the linux avr-... programs. and the make file i've modified. It seems to work... I understand the the IDE creates the c_source.zxb file... how could I do this from the modified make file ?
The error I was getting from Zbasic make.exe was (just included incase it makes any sense)
- /home/ndudman/.wine/drive_c/Program\ Files/ZBasic/WinAvr/utils/bin/make.exe -f c_source.mak
avr-gcc -c -Dzx24n -mmcu=atmega644p -std=gnu99 -fgnu89-inline -gdwarf-2 -Os -I/home/ndudman/.wine/drive_c/Program\ Files/ZBasic/zxlib -I. -Wall -Wstrict-prototypes -funsigned-char -fpack-struct /home/ndudman/source/c_source/zxTempDir/c_source/c_source.c -o /home/ndudman/source/c_source/zxTempDir/c_source/c_source.o
process_begin: CreateProcess(NULL, avr-gcc -c -Dzx24n -mmcu=atmega644p -std=gnu99 -fgnu89-inline -gdwarf-2 -Os "-I/home/ndudman/.wine/drive_c/Program Files/ZBasic/zxlib" -I. -Wall -Wstrict-prototypes -funsigned-char -fpack-struct /home/ndudman/source/c_source/zxTempDir/c_source/c_source.c -o /home/ndudman/source/c_source/zxTempDir/c_source/c_source.o, ...) failed.
make (e=2): File not found
make.exe: *** [/home/ndudman/source/c_source/zxTempDir/c_source/c_source.o] Error 2
The continuation of CFLAGS on a new line seems to add "" around "-I/home/ndudman/.wine/drive_c/Program Files/ZBasic/zxlib" and the \ for the space in path seems to get removed.
Not sure how the upload to device is performed for zx devices ? I guess the ZLoad.exe, just need the final zxb file ?
I've been developing on an atmega8 using AvrUsb500v2 an stk500 V2 compatible, with USB interface from
http://www.tuxgraphics.org/electronics/ ... 7052.shtml. Would I be able to use the old usb programmer, and associated linux programs I had for the zx device ?
Neil
p.s Heres the make file with my changes, it runs using linux make
- MCU = atmega644p
TARGET = c_source.bin
DEVICE = zx24n
ZXLIBDIR = /home/ndudman/.wine/drive_c/Program\ Files/ZBasic/zxlib
ZXLIB = $(DEVICE)
LDSCRIPT=$(ZXLIBDIR)/zx_avr5.lds
CSRC = /home/ndudman/source/c_source/zxTempDir/c_source/c_source.c \
/home/ndudman/source/c_source/factorial.c
CFLAGS = -D$(DEVICE) -mmcu=$(MCU) -std=gnu99 -fgnu89-inline -gdwarf-2 -Os
CFLAGS += -I$(ZXLIBDIR) -I.
CFLAGS += -Wall -Wstrict-prototypes -funsigned-char -fpack-struct
LDFLAGS = -mmcu=$(MCU) -L$(ZXLIBDIR) -Wl,-T,$(LDSCRIPT)
LDFLAGS += -u rtc_ISR
LDFLAGS += -u default_ISR
LDLIBS = -l$(ZXLIB) -lm
CC = avr-gcc
AR = avr-ar
OBJCOPY = avr-objcopy
NM = avr-nm
OBJDUMP = avr-objdump
ECHO = echo
REMOVE = rm -f
EXT = .i1
OBJ = $(CSRC:.c=.o)
EXTOBJ =
EEPROM = $(basename $(TARGET)).eeb
all : $(TARGET) $(EEPROM) $(basename $(TARGET)).sym
$(REMOVE) $(basename $(TARGET))$(EXT) $(OBJ) $(CSRC:.c=.s)
$(basename $(TARGET))$(EXT) : $(OBJ)
$(CC) -o $(basename $(TARGET))$(EXT) $(LDFLAGS) $(OBJ) $(EXTOBJ) $(LDLIBS)
%.o : %.c
$(CC) -c $(CFLAGS) $< -o $@
%.bin : %$(EXT)
$(OBJCOPY) -R .eeprom -R .zx_eeprom -O binary $< $@
%.eeb : %$(EXT)
$(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 -O binary $< $@
%.sym : %$(EXT)
$(NM) -n $< > $@
%.lss : %$(EXT)
$(OBJDUMP) -h -S $< > $@