Browse Source

add infrastructure to support the gateway and irrigation firmwares..

This can now easily be expanded to support other projects as well..
irr_shared
John-Mark Gurney 3 years ago
parent
commit
4f71fa354b
2 changed files with 21 additions and 7 deletions
  1. +17
    -7
      Makefile
  2. +4
    -0
      irr_main.c

+ 17
- 7
Makefile View File

@@ -38,10 +38,14 @@ SOEXT=dylib
.error Unsupported platform: $(PLATFORM)
.endif

PROG = lora.irr
PROGEXT = .elf

SRCS = main.c
PROGS = lora.gw lora.irr

SRCS.lora.gw = main.c

SRCS.lora.irr = irr_main.c

SRCS+= board.c
SRCS+= misc.c
SRCS+= strobe_rng_init.c
@@ -120,7 +124,6 @@ SRCS+= \

CFLAGS+= -I$(STM32)/usb

OBJS = $(SRCS:C/.c$/.o/)
CFLAGS+= -Werror -Wall

LIBLORA_TEST_SRCS= comms.c strobe.c x25519.c
@@ -132,7 +135,6 @@ $(LIBLORA_TEST): $(LIBLORA_TEST_OBJS)

.MAIN: all
.PHONY: all
all: $(PROG)$(PROGEXT) $(PROG).list

DEPENDS = .arm_deps .test_deps
.PHONY: depend
@@ -157,11 +159,19 @@ rng_save.c: Makefile
.test_deps: $(LIBLORA_TEST_SRCS)
$(CC) $(CFLAGS) $(.ALLSRC) -MM | sed -e 's/\.o:/\.no:/' > $@ || (rm -f $@ && false)

$(PROG)$(PROGEXT) $(PROG).map: $(OBJS)
$(ARMCC) $(ARMTARGET) -o $(PROG)$(PROGEXT) $(.ALLSRC) -T$(LINKER_SCRIPT) --specs=nosys.specs -Wl,-Map="$(PROG).map" -Wl,--gc-sections -static --specs=nano.specs -Wl,--start-group -lc -lm -Wl,--end-group
.for i in $(PROGS)
ALLTGTS+= $(i)$(PROGEXT) $(i).list
ASRCS.$(i) = $(SRCS) $(SRCS.$(i))
OBJS.$(i) = $(ASRCS.$(i):C/.c$/.o/)

$(PROG).list: $(PROG)$(PROGEXT)
$(i)$(PROGEXT) $(i).map: $(OBJS.$(i))
$(ARMCC) $(ARMTARGET) -o $(i)$(PROGEXT) $(.ALLSRC) -T$(LINKER_SCRIPT) --specs=nosys.specs -Wl,-Map="$(i).map" -Wl,--gc-sections -static --specs=nano.specs -Wl,--start-group -lc -lm -Wl,--end-group

$(i).list: $(i)$(PROGEXT)
$(ARMOBJDUMP) -h -S $(.ALLSRC) > $@ || (rm -f $@ && false)
.endfor

all: $(ALLTGTS)

.PHONY: runbuild
runbuild: $(SRCS)


+ 4
- 0
irr_main.c View File

@@ -0,0 +1,4 @@
int
main()
{
}

Loading…
Cancel
Save