Host driver/HAL to build a LoRa Picocell Gateway which communicates through USB with a concentrator board based on Semtech SX1308 multi-channel modem and SX1257/SX1255 RF transceivers.

Committer:
dgabino
Date:
Wed Apr 11 14:38:42 2018 +0000
Revision:
0:102b50f941d0
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dgabino 0:102b50f941d0 1 ### Application-specific constants
dgabino 0:102b50f941d0 2
dgabino 0:102b50f941d0 3 APP_NAME := util_pkt_logger
dgabino 0:102b50f941d0 4
dgabino 0:102b50f941d0 5 ### Environment constants
dgabino 0:102b50f941d0 6
dgabino 0:102b50f941d0 7 LGW_PATH ?= ../libloragw
dgabino 0:102b50f941d0 8 ARCH ?=
dgabino 0:102b50f941d0 9 CROSS_COMPILE ?=
dgabino 0:102b50f941d0 10
dgabino 0:102b50f941d0 11 ### External constant definitions
dgabino 0:102b50f941d0 12
dgabino 0:102b50f941d0 13 include $(LGW_PATH)/library.cfg
dgabino 0:102b50f941d0 14
dgabino 0:102b50f941d0 15 ### Constant symbols
dgabino 0:102b50f941d0 16
dgabino 0:102b50f941d0 17 CC := $(CROSS_COMPILE)gcc
dgabino 0:102b50f941d0 18 AR := $(CROSS_COMPILE)ar
dgabino 0:102b50f941d0 19
dgabino 0:102b50f941d0 20 CFLAGS=-O2 -Wall -Wextra -std=c99 -Iinc -I.
dgabino 0:102b50f941d0 21
dgabino 0:102b50f941d0 22 OBJDIR = obj
dgabino 0:102b50f941d0 23
dgabino 0:102b50f941d0 24 ### Constants for LoRa concentrator HAL library
dgabino 0:102b50f941d0 25 # List the library sub-modules that are used by the application
dgabino 0:102b50f941d0 26
dgabino 0:102b50f941d0 27 LGW_INC = $(LGW_PATH)/inc/config.h
dgabino 0:102b50f941d0 28 LGW_INC += $(LGW_PATH)/inc/loragw_hal.h
dgabino 0:102b50f941d0 29
dgabino 0:102b50f941d0 30 ### Linking options
dgabino 0:102b50f941d0 31
dgabino 0:102b50f941d0 32 LIBS := -lloragw -lrt -lm
dgabino 0:102b50f941d0 33
dgabino 0:102b50f941d0 34 ### General build targets
dgabino 0:102b50f941d0 35
dgabino 0:102b50f941d0 36 all: $(APP_NAME)
dgabino 0:102b50f941d0 37
dgabino 0:102b50f941d0 38 clean:
dgabino 0:102b50f941d0 39 rm -f $(OBJDIR)/*.o
dgabino 0:102b50f941d0 40 rm -f $(APP_NAME)
dgabino 0:102b50f941d0 41
dgabino 0:102b50f941d0 42 ### HAL library (do no force multiple library rebuild even with 'make -B')
dgabino 0:102b50f941d0 43
dgabino 0:102b50f941d0 44 $(LGW_PATH)/inc/config.h:
dgabino 0:102b50f941d0 45 @if test ! -f $@; then \
dgabino 0:102b50f941d0 46 $(MAKE) all -C $(LGW_PATH); \
dgabino 0:102b50f941d0 47 fi
dgabino 0:102b50f941d0 48
dgabino 0:102b50f941d0 49 $(LGW_PATH)/libloragw.a: $(LGW_INC)
dgabino 0:102b50f941d0 50 @if test ! -f $@; then \
dgabino 0:102b50f941d0 51 $(MAKE) all -C $(LGW_PATH); \
dgabino 0:102b50f941d0 52 fi
dgabino 0:102b50f941d0 53
dgabino 0:102b50f941d0 54 ### Sub-modules compilation
dgabino 0:102b50f941d0 55
dgabino 0:102b50f941d0 56 $(OBJDIR):
dgabino 0:102b50f941d0 57 mkdir -p $(OBJDIR)
dgabino 0:102b50f941d0 58
dgabino 0:102b50f941d0 59 $(OBJDIR)/parson.o: src/parson.c inc/parson.h | $(OBJDIR)
dgabino 0:102b50f941d0 60 $(CC) -c $(CFLAGS) $< -o $@
dgabino 0:102b50f941d0 61
dgabino 0:102b50f941d0 62 ### Main program compilation and assembly
dgabino 0:102b50f941d0 63
dgabino 0:102b50f941d0 64 $(OBJDIR)/$(APP_NAME).o: src/$(APP_NAME).c $(LGW_INC) inc/parson.h | $(OBJDIR)
dgabino 0:102b50f941d0 65 $(CC) -c $(CFLAGS) -I$(LGW_PATH)/inc $< -o $@
dgabino 0:102b50f941d0 66
dgabino 0:102b50f941d0 67 $(APP_NAME): $(OBJDIR)/$(APP_NAME).o $(LGW_PATH)/libloragw.a $(OBJDIR)/parson.o
dgabino 0:102b50f941d0 68 $(CC) -L$(LGW_PATH) $< $(OBJDIR)/parson.o -o $@ $(LIBS)
dgabino 0:102b50f941d0 69
dgabino 0:102b50f941d0 70 ### EOF