|
- ARMCC?= arm-none-eabi-gcc
- ARMOBJDUMP?= arm-none-eabi-objdump
- ARMTARGET?= -mcpu=cortex-m3 -mthumb -DSTROBE_SINGLE_THREAD=1
-
- PROG = lora.irr
- PROGEXT = .elf
-
- SRCS = main.c
- SRCS+= strobe_rng_init.c
-
- CFLAGS+= -DNDEBUG
-
- # Strobe
- .PATH: $(.CURDIR)/strobe
- CFLAGS = -I$(.CURDIR)/strobe
- SRCS+= strobe.c \
- x25519.c
-
- # Microcontroller
- STM32=$(.CURDIR)/stm32
- .PATH: $(STM32)/l151ccux
- LINKER_SCRIPT=$(STM32)/l151ccux/STM32L151CCUX_FLASH.ld
- SRCS+= startup_stm32l151ccux.s \
- system_stm32l1xx.c
-
- CFLAGS+= -I$(STM32)
- CFLAGS+= -I$(STM32)/l151ccux
- CFLAGS+= -DSTM32L151xC
-
- OBJS = $(SRCS:C/.c$/.o/)
-
- .PHONY: all
- all: $(PROG)$(PROGEXT) $(PROG).list
-
- $(PROG)$(PROGEXT): $(OBJS)
- $(ARMCC) $(ARMTARGET) -o $@ $(.ALLSRC) -T$(LINKER_SCRIPT) --specs=nosys.specs -Wl,--gc-sections -static --specs=nano.specs -Wl,--start-group -lc -lm -Wl,--end-group
-
- $(PROG).list: $(PROG)$(PROGEXT)
- $(ARMOBJDUMP) -h -S $(.ALLSRC) > $@
-
- .PHONY: runtests
- runtests:
- ls *.py | entr sh -c 'python -m coverage run -m unittest lora && coverage report --omit=p/\* -m -i'
-
- .c.o:
- $(ARMCC) $(ARMTARGET) $(CFLAGS) -c $< -o $@
-
- STROBE_REPO = https://git.code.sf.net/p/strobe/code
- STROBE_BRANCH = master
-
- .PHONY: init-strobe
- init-strobe:
- git subtree add -P strobe --squash $(STROBE_REPO) $(STROBE_BRANCH)
-
- .PHONY: update-strobe
- update-strobe:
- git subtree pull -P strobe --squash $(STROBE_REPO) $(STROBE_BRANCH)
|