Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Makefile.avr
- $(info XXXXXXXXXXXXXXXXXXXXXXXX Starting micropnp/Makefile.avr XXXXXXXXXXXXXXXXXXXXXXXX)
- # When compiling upnp.c, AUTOSTART should be enabled to
- # automatically load the uPnP process, from where we bootstrap
- # everything
- $(OBJECTDIR)/upnp.o: CFLAGS += -DAUTOSTART_ENABLE
- %.comp: CFLAGS += -DBUILD_COMPONENT
- # Use our own linker script (avr51.xr). Newer versions of binutils have a
- # default linker script that tends to leave too much sections unmerged.
- # Deployable components should only have: .text, .data, .bss, .rela for every
- # section, .symtab, .strtab, .shstrtab
- # Linker is called directly instead of through avr-gcc (generally bad
- # practice). In this case avr-gcc would have passed flags causing libc calls to
- # be statically compiled in (e.g. printf call in code creates gigantic
- # component)
- %.comp: %.ce
- $(STRIP) -N __do_clear_bss -N __do_copy_data --remove-section=.comment $<
- avr-ld -r -T$(UPNP)/cpu/avr/avr51.xr $< -o $@
- # Cancel built-in rule for .out so we can take over
- %.out: %
- # Use LooCI scripts to generate symbols.c
- %.out: %.co $(PROJECT_OBJECTFILES) contiki-$(TARGET).a
- $(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(LIBC)
- # Override Contiki defined .hex so we can also include .bootloader
- %.hex: %.out
- $(OBJCOPY) $^ -j .text -j .data -j .bootloader -O ihex $@
- # Cancel Contiki defined .elf so we can take over
- %.elf: %.co $(PROJECT_OBJECTFILES) contiki-$(TARGET).a symbols.o
- # Redirect .elf target to .out, and run avr-size if allowed
- %.elf: %.out
- cp $< $@
- ifndef NOAVRSIZE
- avr-size -C --mcu=$(MCU) $@
- endif
- # Sets fuses as defined in contiki-main.c of platform.
- %.fu: %.fuses.bin
- $(eval LFUSE = $(shell od -A none --format=x1 --read-bytes=1 $<))
- $(eval HFUSE = $(shell od -A none --format=x1 --read-bytes=1 -j1 $<))
- $(eval EFUSE = $(shell od -A none --format=x1 --read-bytes=1 -j2 $<))
- $(AVRDUDE) $(AVRDUDE_MCU) $(AVRDUDE_OPTIONS) $(AVRDUDE_PORT) $(AVRDUDE_PROGRAMMER) \
- -U lfuse:w:0x$(LFUSE):m -U hfuse:w:0x$(HFUSE):m -U efuse:w:0x$(EFUSE):m
- %.fuses.bin: %.out
- $(OBJCOPY) $< -j .fuse -O binary --change-section-lma .fuse=0 $@
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement