mirror of
https://github.com/hoglet67/AtomBusMon.git
synced 2025-01-08 03:29:21 +00:00
Build: simplfy makefile by outputting a .bin file
Change-Id: I85cea0011a819fff3789e121a89af05b24ddfbd7
This commit is contained in:
parent
da3651abf2
commit
c2e80e2e4c
@ -20,7 +20,7 @@ PROG = avr_progmem
|
|||||||
|
|
||||||
CFLAGS=$(CPU_CFLAGS) -DF_CPU=${F_CPU}UL -DSERIAL_STATUS -DCOOKED_SERIAL -DNOUSART1 -mmcu=$(MCU) -Wall -Os -mcall-prologues
|
CFLAGS=$(CPU_CFLAGS) -DF_CPU=${F_CPU}UL -DSERIAL_STATUS -DCOOKED_SERIAL -DNOUSART1 -mmcu=$(MCU) -Wall -Os -mcall-prologues
|
||||||
|
|
||||||
OBJECTS=AtomBusMon.o status.o $(CPU_OBJECTS)
|
OBJECTS=AtomBusMon.o status.o $(CPU_OBJECTS)
|
||||||
|
|
||||||
build: $(TARGET).mcs
|
build: $(TARGET).mcs
|
||||||
|
|
||||||
@ -37,25 +37,23 @@ working/$(PROJECT).bit:
|
|||||||
$(TARGET).bit: $(PROG).mem working/$(PROJECT).bit
|
$(TARGET).bit: $(PROG).mem working/$(PROJECT).bit
|
||||||
data2mem -bm $(BMM_FILE) -bd $(PROG).mem -bt working/$(PROJECT).bit -o b $(TARGET).bit
|
data2mem -bm $(BMM_FILE) -bd $(PROG).mem -bt working/$(PROJECT).bit -o b $(TARGET).bit
|
||||||
|
|
||||||
$(PROG).mem: $(PROG).hex
|
$(PROG).mem: $(PROG).bin
|
||||||
srec_cat $< -Intel -Byte_Swap 2 -Data_Only -o tmp.mem -vmem 8
|
od -An -tx1 -w16 -v <$(PROG).bin >$(PROG).mem
|
||||||
gawk ' BEGIN{FS=" ";} { $$1= ""; print}' tmp.mem > $@
|
|
||||||
rm tmp.mem
|
|
||||||
|
|
||||||
$(PROG).hex : $(PROG).out
|
$(PROG).bin : $(PROG).out
|
||||||
$(OBJCOPY) -R .eeprom -O ihex $(PROG).out $(PROG).hex
|
$(OBJCOPY) -R .comment --reverse-bytes=2 -O binary $(PROG).out $(PROG).bin
|
||||||
|
|
||||||
$(PROG).out : $(OBJECTS)
|
$(PROG).out : $(OBJECTS)
|
||||||
$(CC) $(CFLAGS) -o $(PROG).out -Wl,-Map,$(PROG).map $^
|
$(CC) $(CFLAGS) -o $(PROG).out -Wl,-Map,$(PROG).map $^
|
||||||
|
|
||||||
%.o : %.c
|
%.o : %.c
|
||||||
$(CC) $(CFLAGS) -Os -c $<
|
$(CC) $(CFLAGS) -Os -c $<
|
||||||
|
|
||||||
%.o : %.S
|
%.o : %.S
|
||||||
$(CC) $(CFLAGS) -Os -c $<
|
$(CC) $(CFLAGS) -Os -c $<
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f $(TARGET).bit $(TARGET).mcs $(PROG).mem $(PROG).hex $(PROG).out $(PROG).map *.o
|
rm -f $(TARGET).bit $(TARGET).mcs $(PROG).mem $(PROG).bin $(PROG).out $(PROG).map *.o
|
||||||
|
|
||||||
clobber: clean
|
clobber: clean
|
||||||
rm -rf $(BMM_FILE) working/ iceconfig/
|
rm -rf $(BMM_FILE) working/ iceconfig/
|
||||||
|
Loading…
Reference in New Issue
Block a user