generated from bandogora/nunit-Ceasy
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
42 lines (30 loc) · 1.21 KB
/
Makefile
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
40
41
42
CC ?= gcc
DIR ?= .
app_bin_dir ?= /usr/bin
EXTRA_CFLAGS ?=
EXTRA_LDFLAGS ?=
CFLAGS ?= -O3 -fstack-protector-strong -Wall -Wextra -Wformat -Winline -Werror=format-security \
-D_FORTIFY_SOURCE=2 -march=native -fPIC -I$(DIR)/include -fanalyzer $(EXTRA_CFLAGS)
LDFLAGS ?= -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie -L$(DIR) -L$(DIR)/lib -lc -lpthread \
-lcurl -lunit -lnaah64 $(EXTRA_LDFLAGS)
VPATH = $(DIR)/src:$(DIR)/include
objects = main.o jsmn.o json_helpers.o curl_callbacks.o vzw_connect.o request_handler.o firmware_requests.o
all: jsmn.h base64.h libnaah64.a app
app: config/vzw_secrets.h $(objects)
$(CC) $(CFLAGS) $(objects) -o $(DIR)/app $(LDFLAGS)
chmod +x $(DIR)/app
%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
.PHONY: clean jsmn.h base64.h libnaah64.a install
libnaah64.a:
$(MAKE) -C $(DIR)/modules/nibble-and-a-half libnaah64.a
cp $(DIR)/modules/nibble-and-a-half/libnaah64.a $(DIR)/lib/
base64.h:
cp $(DIR)/modules/nibble-and-a-half/base64.h $(DIR)/include
jsmn.h:
cp $(DIR)/modules/jsmn/jsmn.h $(DIR)/include
install: app
cp $(DIR)/app $(app_bin_dir)/iots
clean:
rm -rf $(DIR)/app $(objects) $(DIR)/lib/libnaah64.a $(DIR)/include/jsmn.h $(DIR)/include/base64.h
$(MAKE) -C $(DIR)/modules/nibble-and-a-half clean