summaryrefslogtreecommitdiff
path: root/Makefile
blob: 9646c3033db6e611f7e1d55b2000947ca66f7d0d (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
# Makefile for Multi-Tech MTS-Azure libraries and executable
# Copyright 2019 Multi-Tech Systems Inc. All Rights Reserved.
# Author: David Marcaccini
# contact: david.marcaccini@multitech.com

INCLUDE_DIRS= \
    -I./azure-iot-sdk-c/iothub_client/inc \
    -I./azure-iot-sdk-c/deps/umock-c/inc \
    -I./azure-iot-sdk-c/deps/azure-macro-utils-c/inc \
    -I./azure-iot-sdk-c/c-utility/inc

LIB_DIRS= \
    -L./azure-iot-sdk-c/cmake/iotsdk_linux/iothub_client

LDFLAGS= \
    -liothub_client

all: mtsazure

mtsazure: src/mtsazure.c
	$$CC -O2 -o $@ $< $(INCLUDE_DIRS) $(LIB_DIRS) $(LDFLAGS)
	arm-mlinux-linux-gnueabi-strip $@

.PHONY:
install: mtsazure
	mkdir -p $(DESTDIR)/usr/bin
	mkdir -p $(DESTDIR)/usr/lib
	cp mtsazure $(DESTDIR)/usr/bin
	cp -a ./azure-iot-sdk-c/cmake/iotsdk_linux/iothub_client/libiothub_client.so* $(DESTDIR)/usr/lib

.PHONY:
clean:
	rm -rf mtsazure *.o