[En-Nut-Discussion] Readability modification to Makefiles
Bernd Walter
enut at cicely.de
Mon Mar 21 11:43:50 CET 2011
On Mon, Mar 21, 2011 at 10:26:13AM +0100, Harald Kipp wrote:
> Hi Ulrich,
>
> On 3/20/2011 2:06 PM, Ulrich Prinz wrote:
>
> > While this is not to problematic for the Nut/OS build process as there
> > the compiler is set very strict and any simple warning will cause an
> > abort, compiling your application can inherit lots of warnings that you
> > never see on the overloaded screen.
>
> Agreed.
For me ethernut is compiled Werror:
arm-elf-gcc -c -I../include -DAT91SAM7X_EK -DAT91_PLL_MAINCK="18432000" -DNUTMEM_SIZE="0xFF00" -DNUTMEM_START="0x00200100" -DNUT_THREAD_IDLESTACK="512" -DNUT_THREAD_MAINSTACK="1024" -DNUT_THREAD_TCPSMSTACK="1024" -DNUT_THREAD_DHCPSTACK="1024" -DNUT_THREAD_SNTPSTACK="1024" -DFOPEN_MAX=20 -DPHAT_SECTOR_BUFFERS="6" -DNIC_PHY_ADDR=1 -DMMC_CS_BIT=SPI0_NPCS3_PA09B -DNUT_WDT_START=yes -DMCU_AT91=yes -DMCU_AT91SAM7X=yes -DNUTLUA_STRLIB_IS_STANDARD=yes -DNUTLUA_MATHLIB_IS_STANDARD=yes -DNUTLUA_TABLIB_IS_STANDARD=yes -DNUTLUA_OPTIMIZE_MEMORY=2 -DNUTLUA_FLOATING_POINT -DLIB_HEAPSIZE=8192 -DNUT_CPU_FREQ="55000073" -DPLL_MUL_VAL=1300 -DPLL_DIV_VAL=218 -mthumb -mcpu=arm7tdmi -mthumb-interwork -Os -Wall -Wstrict-prototypes -Werror -Wa,-a=setenv.lst -o setenv.o setenv.c
No way to _oversee_ a warning with that.
> > What does the trick is the following:
> ...
> > %.hex: %.elf
> > @echo " [HEX] $@"
> > @$(BIN) $(BINFLAGS) -O ihex $< $@
>
> Putting this on every command line has a disadvantage. Sometimes I need
> to inspect the command for 2 reasons:
>
> 1. I want to copy the command to use it "offline" (without calling make).
> 2. Users often report problems, where the command output of make would
> show me, what's wrong.
It was also very handy to verify thumb vs non-thumb usage in ARM, since
interrupt code can't be compiled as thumb code.
--
B.Walter <bernd at bwct.de> http://www.bwct.de
Modbus/TCP Ethernet I/O Baugruppen, ARM basierte FreeBSD Rechner uvm.
More information about the En-Nut-Discussion
mailing list