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.
util_com_stress/Makefile@0:102b50f941d0, 2018-04-11 (annotated)
- Committer:
- dgabino
- Date:
- Wed Apr 11 14:38:42 2018 +0000
- Revision:
- 0:102b50f941d0
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dgabino | 0:102b50f941d0 | 1 | ### Application-specific constants |
dgabino | 0:102b50f941d0 | 2 | |
dgabino | 0:102b50f941d0 | 3 | APP_NAME := util_com_stress |
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 | # must get library build option to know if mpsse must be linked or not |
dgabino | 0:102b50f941d0 | 13 | |
dgabino | 0:102b50f941d0 | 14 | include $(LGW_PATH)/library.cfg |
dgabino | 0:102b50f941d0 | 15 | |
dgabino | 0:102b50f941d0 | 16 | ### Constant symbols |
dgabino | 0:102b50f941d0 | 17 | |
dgabino | 0:102b50f941d0 | 18 | CC := $(CROSS_COMPILE)gcc |
dgabino | 0:102b50f941d0 | 19 | AR := $(CROSS_COMPILE)ar |
dgabino | 0:102b50f941d0 | 20 | |
dgabino | 0:102b50f941d0 | 21 | CFLAGS=-O2 -Wall -Wextra -std=c99 -Iinc -I. |
dgabino | 0:102b50f941d0 | 22 | |
dgabino | 0:102b50f941d0 | 23 | OBJDIR = obj |
dgabino | 0:102b50f941d0 | 24 | |
dgabino | 0:102b50f941d0 | 25 | ### Constants for LoRa concentrator HAL library |
dgabino | 0:102b50f941d0 | 26 | # List the library sub-modules that are used by the application |
dgabino | 0:102b50f941d0 | 27 | |
dgabino | 0:102b50f941d0 | 28 | LGW_INC = $(LGW_PATH)/inc/config.h |
dgabino | 0:102b50f941d0 | 29 | LGW_INC += $(LGW_PATH)/inc/loragw_reg.h |
dgabino | 0:102b50f941d0 | 30 | |
dgabino | 0:102b50f941d0 | 31 | ### Linking options |
dgabino | 0:102b50f941d0 | 32 | |
dgabino | 0:102b50f941d0 | 33 | LIBS := -lloragw -lrt -lm |
dgabino | 0:102b50f941d0 | 34 | |
dgabino | 0:102b50f941d0 | 35 | ### General build targets |
dgabino | 0:102b50f941d0 | 36 | |
dgabino | 0:102b50f941d0 | 37 | all: $(APP_NAME) |
dgabino | 0:102b50f941d0 | 38 | |
dgabino | 0:102b50f941d0 | 39 | clean: |
dgabino | 0:102b50f941d0 | 40 | rm -f $(OBJDIR)/*.o |
dgabino | 0:102b50f941d0 | 41 | rm -f $(APP_NAME) |
dgabino | 0:102b50f941d0 | 42 | |
dgabino | 0:102b50f941d0 | 43 | ### HAL library (do no force multiple library rebuild even with 'make -B') |
dgabino | 0:102b50f941d0 | 44 | |
dgabino | 0:102b50f941d0 | 45 | $(LGW_PATH)/inc/config.h: |
dgabino | 0:102b50f941d0 | 46 | @if test ! -f $@; then \ |
dgabino | 0:102b50f941d0 | 47 | $(MAKE) all -C $(LGW_PATH); \ |
dgabino | 0:102b50f941d0 | 48 | fi |
dgabino | 0:102b50f941d0 | 49 | |
dgabino | 0:102b50f941d0 | 50 | $(LGW_PATH)/libloragw.a: $(LGW_INC) |
dgabino | 0:102b50f941d0 | 51 | @if test ! -f $@; then \ |
dgabino | 0:102b50f941d0 | 52 | $(MAKE) all -C $(LGW_PATH); \ |
dgabino | 0:102b50f941d0 | 53 | fi |
dgabino | 0:102b50f941d0 | 54 | |
dgabino | 0:102b50f941d0 | 55 | ### Main program compilation and assembly |
dgabino | 0:102b50f941d0 | 56 | |
dgabino | 0:102b50f941d0 | 57 | $(OBJDIR): |
dgabino | 0:102b50f941d0 | 58 | mkdir -p $(OBJDIR) |
dgabino | 0:102b50f941d0 | 59 | |
dgabino | 0:102b50f941d0 | 60 | $(OBJDIR)/$(APP_NAME).o: src/$(APP_NAME).c $(LGW_INC) | $(OBJDIR) |
dgabino | 0:102b50f941d0 | 61 | $(CC) -c $(CFLAGS) -I$(LGW_PATH)/inc $< -o $@ |
dgabino | 0:102b50f941d0 | 62 | |
dgabino | 0:102b50f941d0 | 63 | $(APP_NAME): $(OBJDIR)/$(APP_NAME).o $(LGW_PATH)/libloragw.a |
dgabino | 0:102b50f941d0 | 64 | $(CC) -L$(LGW_PATH) $< -o $@ $(LIBS) |
dgabino | 0:102b50f941d0 | 65 | |
dgabino | 0:102b50f941d0 | 66 | ### EOF |