Skip to content

Commit 5b35c7d

Browse files
committed
rules: provide better feedback on missing libraries.
If the library files are missing (haven't been built) it's better to get a failure message saying that, rather than a failed dependency with no rules to generated it. Before: (I'd manually removed the f4 library) ``` $ make clean all V=1 Using ../../../../../libopencm3/ path to library rm -f *.o *.d *.elf *.bin *.hex *.srec *.list *.map make: *** No rule to make target `adc-dac-printf.elf', needed by `elf'. Stop. ``` After: ``` $ make clean all V=1 Using ../../../../../libopencm3/ path to library rm -f *.o *.d *.elf *.bin *.hex *.srec *.list *.map arm-none-eabi-gcc -Os -g -Wextra -Wshadow -Wimplicit-function-declaration -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes -fno-common -ffunction-sections -fdata-sections -MD -Wall -Wundef -I../../../../../libopencm3//include -DSTM32F4 -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -o adc-dac-printf.o -c adc-dac-printf.c arm-none-eabi-gcc --static -nostartfiles -L../../../../../libopencm3//lib -T../stm32f4-discovery.ld -Wl,-Map=adc-dac-printf.map -Wl,--gc-sections -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 adc-dac-printf.o -lopencm3_stm32f4 -Wl,--start-group -lc -lgcc -lnosys -Wl,--end-group -o adc-dac-printf.elf /home/karlp/tools/gcc-arm-none-eabi-4_9-2015q2/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: cannot find -lopencm3_stm32f4 collect2: error: ld returned 1 exit status make: *** [adc-dac-printf.elf] Error 1 ``` I strongly feel that the latter is far more informative.
1 parent 07c2326 commit 5b35c7d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/Makefile.rules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ $(LDSCRIPT):
158158
@#printf " OBJDUMP $(*).list\n"
159159
$(Q)$(OBJDUMP) -S $(*).elf > $(*).list
160160

161-
%.elf %.map: $(OBJS) $(LDSCRIPT) $(LIB_DIR)/lib$(LIBNAME).a
161+
%.elf %.map: $(OBJS) $(LDSCRIPT)
162162
@#printf " LD $(*).elf\n"
163163
$(Q)$(LD) $(LDFLAGS) $(ARCH_FLAGS) $(OBJS) $(LDLIBS) -o $(*).elf
164164

0 commit comments

Comments
 (0)