From 1ac3026c039cb15dd8c110c84215096854c3c804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Sun, 20 Mar 2016 16:36:04 +0100 Subject: Some chages in configuration build --- examples/blink/.config | 25 +++++++++++++++++++++++++ examples/blink/Makefile | 39 ++++++++++++++++++++++----------------- examples/blink/config | 24 ------------------------ examples/blink/config.orig | 24 ------------------------ examples/usartecho/.config | 42 ++++++++++++++++++++++++++++++++++++++++++ examples/usartecho/Makefile | 39 ++++++++++++++++++++++----------------- examples/usartecho/config | 41 ----------------------------------------- examples/usartecho/config.orig | 41 ----------------------------------------- 8 files changed, 111 insertions(+), 164 deletions(-) create mode 100644 examples/blink/.config delete mode 100644 examples/blink/config delete mode 100644 examples/blink/config.orig create mode 100644 examples/usartecho/.config delete mode 100644 examples/usartecho/config delete mode 100644 examples/usartecho/config.orig (limited to 'examples') diff --git a/examples/blink/.config b/examples/blink/.config new file mode 100644 index 0000000..52dfc53 --- /dev/null +++ b/examples/blink/.config @@ -0,0 +1,25 @@ +# +# Automatically generated file; DO NOT EDIT. +# AVR-IOE configuration +# +MMCU="atmega328p" +ATMEGA328P=y +# ATTINY85 is not set +# ATTINY4313 is not set +F_CPU=16000 + +# +# Compilation options +# +GNUTOOLCHAIN_PREFIX="avr-" +CONFCFLAGS="-Os -ffunction-sections -fdata-sections -fshort-enums -Wall" +MCUSUPPORT_IOPORTS=y +CONFIG_IOPORTS=y +MCUSUPPORT_PCINT0=y +MCUSUPPORT_PCINT1=y +MCUSUPPORT_PCINT2=y +# CONFIG_IOPORTS_PCINT is not set +MCUSUPPORT_SPI=y +# CONFIG_SPI is not set +MCUSUPPORT_USART=y +# CONFIG_USART is not set diff --git a/examples/blink/Makefile b/examples/blink/Makefile index 43941b6..ef7e205 100644 --- a/examples/blink/Makefile +++ b/examples/blink/Makefile @@ -4,13 +4,14 @@ PROJNAME = blink SRC = blink.c OBJ = $(patsubst %.c,%.o,$(SRC)) # This creates list of *.o files from *.c +Q ?= @ # This can be overwritten to show commands .PHONY: all -ifneq ("$(wildcard config)","") # Checking if configuration exists +ifneq ("$(wildcard .config)","") # Checking if configuration exists all: $(PROJNAME).hex @echo Now you can flash $< to your chip. else -all: help +all: .config endif # Edit here help like you ever want @@ -26,39 +27,43 @@ help: .PHONY: clean clean: @echo " CLEAN OBJ" - @$(RM) $(OBJ) + $(Q)$(RM) $(OBJ) @echo " CLEAN $(PROJNAME).elf $(PROJNAME).hex" - @$(RM) $(PROJNAME).elf $(PROJNAME).hex - @$(MAKE) -C ../.. clean + $(Q)$(RM) $(PROJNAME).elf $(PROJNAME).hex + $(Q)$(MAKE) -C ../.. clean O=examples/blink # Building targets are available only if configuration is generated -ifneq ("$(wildcard config)","") --include config +ifneq ("$(wildcard .config)","") +-include .config # If you want change some standard CFLAGS, change them in configuration not here. # Add here only options that should not be applied to avr-ioe also. -CFLAGS = -I../../include -mmcu=$(MMCU) -imacros ../../.config.h \ +CFLAGS = -I../../include -mmcu=$(MMCU) -imacros build/config.h \ $(shell echo $(CONFCFLAGS)) $(shell echo -DF_CPU=$(F_CPU)000L) -$(PROJNAME).elf: ../../libioe.a +$(PROJNAME).elf: libioe.a $(PROJNAME).elf: $(OBJ) @echo " LD $@" - @avr-gcc -Os -mmcu=$(MMCU) $^ -o $@ -L../.. -lioe + $(Q)avr-gcc -Os -mmcu=$(MMCU) $(filter %.o,$^) -o $@ -L. -lioe $(PROJNAME).hex: $(PROJNAME).elf @echo " OBJCOPY $@" - @avr-objcopy -O ihex -R .eeprom $< $@ + $(Q)avr-objcopy -O ihex -R .eeprom $< $@ -$(OBJ): %.o: %.c ../../libioe.a +$(OBJ): %.o: %.c libioe.a @echo " CC $@" - @avr-gcc $(CFLAGS) -c -o $@ $< + $(Q)avr-gcc $(CFLAGS) -c -o $@ $< -../../libioe.a: config - @CONFIG=$$(readlink -f config) $(MAKE) -C ../.. libioe.a +libioe.a: .config + $(Q)$(MAKE) -C ../.. examples/blink/libioe.a O=examples/blink endif +.config: + @echo Configuration for this example is missing. Probably deleted... + @exit 1 + config: - @CONFIG=$$(readlink -f config) $(MAKE) -C ../.. config + $(Q)$(MAKE) -C ../.. config O=examples/blink .PHONY: menuconfig menuconfig: - @CONFIG=$$(readlink -f config) $(MAKE) -C ../.. menuconfig + $(Q)$(MAKE) -C ../.. menuconfig O=examples/blink diff --git a/examples/blink/config b/examples/blink/config deleted file mode 100644 index 09169d4..0000000 --- a/examples/blink/config +++ /dev/null @@ -1,24 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# AVR-IOE configuration -# -MMCU=atmega328p -ATMEGA328P=y -# ATTINY85 is not set -F_CPU=16000 - -# -# Compilation options -# -GNUTOOLCHAIN_PREFIX=avr- -CONFCFLAGS=-Os -ffunction-sections -fdata-sections -fshort-enums -Wall -MCUSUPPORT_IOPORTS=y -CONFIG_IOPORTS=y -MCUSUPPORT_PCINT0=y -MCUSUPPORT_PCINT1=y -MCUSUPPORT_PCINT2=y -# CONFIG_IOPORTS_PCINT is not set -MCUSUPPORT_SPI=y -# CONFIG_SPI is not set -MCUSUPPORT_USART=y -# CONFIG_USART is not set diff --git a/examples/blink/config.orig b/examples/blink/config.orig deleted file mode 100644 index 529a7d3..0000000 --- a/examples/blink/config.orig +++ /dev/null @@ -1,24 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# AVR-IOE configuration -# -MMCU="atmega328p" -ATMEGA328P=y -# ATTINY85 is not set -F_CPU=16000 - -# -# Compilation options -# -GNUTOOLCHAIN_PREFIX="avr-" -CONFCFLAGS="-Os -ffunction-sections -fdata-sections -fshort-enums -Wall" -MCUSUPPORT_IOPORTS=y -CONFIG_IOPORTS=y -MCUSUPPORT_PCINT0=y -MCUSUPPORT_PCINT1=y -MCUSUPPORT_PCINT2=y -# CONFIG_IOPORTS_PCINT is not set -MCUSUPPORT_SPI=y -# CONFIG_SPI is not set -MCUSUPPORT_USART=y -# CONFIG_USART is not set diff --git a/examples/usartecho/.config b/examples/usartecho/.config new file mode 100644 index 0000000..48ae310 --- /dev/null +++ b/examples/usartecho/.config @@ -0,0 +1,42 @@ +# +# Automatically generated file; DO NOT EDIT. +# AVR-IOE configuration +# +MMCU="atmega328p" +ATMEGA328P=y +# ATTINY85 is not set +# ATTINY4313 is not set +F_CPU=16000 + +# +# Compilation options +# +GNUTOOLCHAIN_PREFIX="avr-" +CONFCFLAGS="-Os -ffunction-sections -fdata-sections -fshort-enums -Wall" +MCUSUPPORT_IOPORTS=y +# CONFIG_IOPORTS is not set +MCUSUPPORT_PCINT0=y +MCUSUPPORT_PCINT1=y +MCUSUPPORT_PCINT2=y +MCUSUPPORT_SPI=y +# CONFIG_SPI is not set +MCUSUPPORT_USART=y +CONFIG_USART=y +CONFIG_USART_BAUD=115200 +USART_PARITY_C_NONE=y +# USART_PARITY_C_ODD is not set +# USART_PARITY_C_EVEN is not set +CONFIG_USART_PARITY="USART_PARITY_NONE" +CONFIG_USART_DATABITS=8 +USART_STOPBIT_C_SINGLE=y +# USART_STOPBIT_C_DOUBLE is not set +CONFIG_USART_STOPBIT="USART_STOPBIT_SINGLE" +CONFIG_USART_OUTPUT_BUFFER=y +CONFIG_USART_OUTBUFFER_SIZE=64 +USART_OUTBUFFER_MODE_C_BLOCK=y +# USART_OUTBUFFER_MODE_C_OVERWRITE is not set +# USART_OUTBUFFER_MODE_C_DROP is not set +CONFIG_USART_OUTBUFFER_MODE=0 +# CONFIG_USART_INPUT_BUFFER is not set +CONFIG_USART_INBUFFER_SIZE=32 +CONFIG_USART_INBUFFER_MODE=0 diff --git a/examples/usartecho/Makefile b/examples/usartecho/Makefile index 900fe09..6e4e9d5 100644 --- a/examples/usartecho/Makefile +++ b/examples/usartecho/Makefile @@ -4,13 +4,14 @@ PROJNAME = usartecho SRC = echo.c OBJ = $(patsubst %.c,%.o,$(SRC)) # This creates list of *.o files from *.c +Q ?= @ # This can be overwritten to show commands .PHONY: all -ifneq ("$(wildcard config)","") # Checking if configuration exists +ifneq ("$(wildcard .config)","") # Checking if configuration exists all: $(PROJNAME).hex @echo Now you can flash $< to your chip. else -all: help +all: .config endif # Edit here help like you ever want @@ -26,39 +27,43 @@ help: .PHONY: clean clean: @echo " CLEAN OBJ" - @$(RM) $(OBJ) + $(Q)$(RM) $(OBJ) @echo " CLEAN $(PROJNAME).elf $(PROJNAME).hex" - @$(RM) $(PROJNAME).elf $(PROJNAME).hex - @$(MAKE) -C ../.. clean + $(Q)$(RM) $(PROJNAME).elf $(PROJNAME).hex + $(Q)$(MAKE) -C ../.. clean O=examples/$(PROJNAME) # Building targets are available only if configuration is generated -ifneq ("$(wildcard config)","") --include config +ifneq ("$(wildcard .config)","") +-include .config # If you want change some standard CFLAGS, change them in configuration not here. # Add here only options that should not be applied to avr-ioe also. -CFLAGS = -I../../include -mmcu=$(MMCU) -imacros ../../.config.h \ +CFLAGS = -I../../include -mmcu=$(MMCU) -imacros build/config.h \ $(shell echo $(CONFCFLAGS)) $(shell echo -DF_CPU=$(F_CPU)000L) -$(PROJNAME).elf: ../../libioe.a +$(PROJNAME).elf: libioe.a $(PROJNAME).elf: $(OBJ) @echo " LD $@" - @avr-gcc -Os -mmcu=$(MMCU) $^ -o $@ -L../.. -lioe + @avr-gcc -Os -mmcu=$(MMCU) $(filter %.o,$^) -o $@ -L. -lioe $(PROJNAME).hex: $(PROJNAME).elf @echo " OBJCOPY $@" - @avr-objcopy -O ihex -R .eeprom $< $@ + $(Q)avr-objcopy -O ihex -R .eeprom $< $@ -$(OBJ): %.o: %.c ../../libioe.a +$(OBJ): %.o: %.c libioe.a @echo " CC $@" - @avr-gcc $(CFLAGS) -c -o $@ $< + $(Q)avr-gcc $(CFLAGS) -c -o $@ $< -../../libioe.a: config - @CONFIG=$$(readlink -f config) $(MAKE) -C ../.. libioe.a +libioe.a: .config + $(Q)$(MAKE) -C ../.. examples/$(PROJNAME)/libioe.a O=examples/$(PROJNAME) endif +.config: + @echo Configuration for this example is missing. Probably deleted... + @exit 1 + config: - @CONFIG=$$(readlink -f config) $(MAKE) -C ../.. config + $(Q)$(MAKE) -C ../.. config O=examples/$(PROJNAME) .PHONY: menuconfig menuconfig: - @CONFIG=$$(readlink -f config) $(MAKE) -C ../.. menuconfig + $(Q)$(MAKE) -C ../.. menuconfig O=examples/$(PROJNAME) diff --git a/examples/usartecho/config b/examples/usartecho/config deleted file mode 100644 index 052a5c4..0000000 --- a/examples/usartecho/config +++ /dev/null @@ -1,41 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# AVR-IOE configuration -# -MMCU=atmega328p -ATMEGA328P=y -# ATTINY85 is not set -F_CPU=16000 - -# -# Compilation options -# -GNUTOOLCHAIN_PREFIX=avr- -CONFCFLAGS=-Os -ffunction-sections -fdata-sections -fshort-enums -Wall -MCUSUPPORT_IOPORTS=y -# CONFIG_IOPORTS is not set -MCUSUPPORT_PCINT0=y -MCUSUPPORT_PCINT1=y -MCUSUPPORT_PCINT2=y -MCUSUPPORT_SPI=y -# CONFIG_SPI is not set -MCUSUPPORT_USART=y -CONFIG_USART=y -CONFIG_USART_BAUD=115200 -USART_PARITY_C_NONE=y -# USART_PARITY_C_ODD is not set -# USART_PARITY_C_EVEN is not set -CONFIG_USART_PARITY=USART_PARITY_NONE -CONFIG_USART_DATABITS=8 -USART_STOPBIT_C_SINGLE=y -# USART_STOPBIT_C_DOUBLE is not set -CONFIG_USART_STOPBIT=USART_STOPBIT_SINGLE -CONFIG_USART_OUTPUT_BUFFER=y -CONFIG_USART_OUTBUFFER_SIZE=64 -USART_OUTBUFFER_MODE_C_BLOCK=y -# USART_OUTBUFFER_MODE_C_OVERWRITE is not set -# USART_OUTBUFFER_MODE_C_DROP is not set -CONFIG_USART_OUTBUFFER_MODE=0 -# CONFIG_USART_INPUT_BUFFER is not set -CONFIG_USART_INBUFFER_SIZE=32 -CONFIG_USART_INBUFFER_MODE=0 diff --git a/examples/usartecho/config.orig b/examples/usartecho/config.orig deleted file mode 100644 index 8bc1db9..0000000 --- a/examples/usartecho/config.orig +++ /dev/null @@ -1,41 +0,0 @@ -# -# Automatically generated file; DO NOT EDIT. -# AVR-IOE configuration -# -MMCU="atmega328p" -ATMEGA328P=y -# ATTINY85 is not set -F_CPU=16000 - -# -# Compilation options -# -GNUTOOLCHAIN_PREFIX="avr-" -CONFCFLAGS="-Os -ffunction-sections -fdata-sections -fshort-enums -Wall" -MCUSUPPORT_IOPORTS=y -# CONFIG_IOPORTS is not set -MCUSUPPORT_PCINT0=y -MCUSUPPORT_PCINT1=y -MCUSUPPORT_PCINT2=y -MCUSUPPORT_SPI=y -# CONFIG_SPI is not set -MCUSUPPORT_USART=y -CONFIG_USART=y -CONFIG_USART_BAUD=115200 -USART_PARITY_C_NONE=y -# USART_PARITY_C_ODD is not set -# USART_PARITY_C_EVEN is not set -CONFIG_USART_PARITY="USART_PARITY_NONE" -CONFIG_USART_DATABITS=8 -USART_STOPBIT_C_SINGLE=y -# USART_STOPBIT_C_DOUBLE is not set -CONFIG_USART_STOPBIT="USART_STOPBIT_SINGLE" -CONFIG_USART_OUTPUT_BUFFER=y -CONFIG_USART_OUTBUFFER_SIZE=64 -USART_OUTBUFFER_MODE_C_BLOCK=y -# USART_OUTBUFFER_MODE_C_OVERWRITE is not set -# USART_OUTBUFFER_MODE_C_DROP is not set -CONFIG_USART_OUTBUFFER_MODE=0 -# CONFIG_USART_INPUT_BUFFER is not set -CONFIG_USART_INBUFFER_SIZE=32 -CONFIG_USART_INBUFFER_MODE=0 -- cgit v1.2.3