From 4f71fa354b88a0163300e9dddb5bf4f72118b00a Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Wed, 5 May 2021 01:37:12 -0700 Subject: [PATCH] add infrastructure to support the gateway and irrigation firmwares.. This can now easily be expanded to support other projects as well.. --- Makefile | 24 +++++++++++++++++------- irr_main.c | 4 ++++ 2 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 irr_main.c diff --git a/Makefile b/Makefile index f2a8466..039a3e4 100644 --- a/Makefile +++ b/Makefile @@ -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) diff --git a/irr_main.c b/irr_main.c new file mode 100644 index 0000000..df67b91 --- /dev/null +++ b/irr_main.c @@ -0,0 +1,4 @@ +int +main() +{ +}