summaryrefslogtreecommitdiff
path: root/loragw_pkt_logger/Makefile
blob: 6b90495e2e9b3da6f2e08d3ed9fc3f008afdde8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
### Application-specific constants

APP_NAME=loragw_pkt_logger

### constant symbols

CC=gcc
CFLAGS=-O2 -Wall -Wextra -Iinc
C99FLAGS=-O2 -Wall -Wextra -std=c99 -Iinc
FLAG_AUX=

### constants for Lora Gateway HAL library

LGW_PATH=../loragw_hal
LGW_INC=-I$(LGW_PATH)/inc
#LGW_LNK=-lloragw -lrt
LGW_LNK=-lloragw -lrt -lmpsse
# add libmpsse or not, depending on what option you compiled the libloragw with

### general build targets

all: $(APP_NAME)

clean:
	rm -f obj/*.o
	rm -f $(APP_NAME)

### sub-modules compilation

obj/parson.o: src/parson.c 
	$(CC) -c $(C99FLAGS) -o obj/parson.o $(LGW_INC) src/parson.c $(FLAG_AUX)

### main program compilation and assembly

obj/$(APP_NAME).o: src/$(APP_NAME).c 
	$(CC) -c $(C99FLAGS) -o obj/$(APP_NAME).o $(LGW_INC) src/$(APP_NAME).c $(FLAG_AUX)

$(APP_NAME): $(LGW_PATH)/libloragw.a obj/$(APP_NAME).o obj/parson.o
	$(CC) -o $(APP_NAME) obj/$(APP_NAME).o obj/parson.o -L$(LGW_PATH) $(LGW_LNK)