summaryrefslogtreecommitdiff
path: root/util_spectral_scan/Makefile
diff options
context:
space:
mode:
authorHarsh Sharma <92harshsharma@gmail.com>2018-06-13 13:24:54 -0500
committerHarsh Sharma <92harshsharma@gmail.com>2018-06-13 13:24:54 -0500
commit7c383be1542368f2601015d9fc2a417197677677 (patch)
treebc06453f879cbadf65fd88123c506956403c5684 /util_spectral_scan/Makefile
downloadlora_gateway_mtac_full-7c383be1542368f2601015d9fc2a417197677677.tar.gz
lora_gateway_mtac_full-7c383be1542368f2601015d9fc2a417197677677.tar.bz2
lora_gateway_mtac_full-7c383be1542368f2601015d9fc2a417197677677.zip
Initial Commit
Diffstat (limited to 'util_spectral_scan/Makefile')
-rw-r--r--util_spectral_scan/Makefile63
1 files changed, 63 insertions, 0 deletions
diff --git a/util_spectral_scan/Makefile b/util_spectral_scan/Makefile
new file mode 100644
index 0000000..35d625f
--- /dev/null
+++ b/util_spectral_scan/Makefile
@@ -0,0 +1,63 @@
+### Environment constants
+
+LGW_PATH ?= ../libloragw
+ARCH ?=
+CROSS_COMPILE ?=
+
+### External constant definitions
+
+include $(LGW_PATH)/library.cfg
+
+### Constant symbols
+
+CC = $(CROSS_COMPILE)gcc
+AR = $(CROSS_COMPILE)ar
+CFLAGS = -O2 -Wall -Wextra -std=c99 -I inc
+
+OBJDIR = obj
+INCLUDES = $(wildcard inc/*.h)
+
+### Constants for LoRa concentrator HAL library
+# List the library sub-modules that are used by the application
+
+LGW_INC = $(LGW_PATH)/inc/config.h
+LGW_INC += $(LGW_PATH)/inc/loragw_hal.h
+
+### Linking options
+
+LIBS := -lloragw -lrt
+
+### General build targets
+
+all: util_spectral_scan
+
+clean:
+ rm -f $(OBJDIR)/*.o
+ rm -f util_spectral_scan
+
+### HAL library (do no force multiple library rebuild even with 'make -B')
+
+$(LGW_PATH)/inc/config.h:
+ @if test ! -f $@; then \
+ $(MAKE) all -C $(LGW_PATH); \
+ fi
+
+$(LGW_PATH)/libloragw.a: $(LGW_INC)
+ @if test ! -f $@; then \
+ $(MAKE) all -C $(LGW_PATH); \
+ fi
+
+### Sub-modules compilation
+
+$(OBJDIR):
+ mkdir -p $(OBJDIR)
+
+$(OBJDIR)/%.o: src/%.c $(INCLUDES) | $(OBJDIR)
+ $(CC) -c $(CFLAGS) -I$(LGW_PATH)/inc $< -o $@
+
+### Main program assembly
+
+util_spectral_scan: $(OBJDIR)/util_spectral_scan.o
+ $(CC) -L$(LGW_PATH) $^ $(LIBS) -o $@
+
+### EOF