This repository has been archived by the owner on Jul 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 84
/
Copy pathMakefile
70 lines (62 loc) · 2.46 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright 2018-2020 Google LLC
#
# This is part of the Google Cloud IoT Device SDK for Embedded C.
# It is licensed under the BSD 3-Clause license; you may not use this file
# except in compliance with the License.
#
# You may obtain a copy of the License at:
# https://opensource.org/licenses/BSD-3-Clause
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Batch Build Tool for IoTC Client Examples
#
# These Examples are built against a pre-built IoTC Client library.
#
# The pre-built IoTC Client library paths are in IOTC_CLIENT_INC_PATH
# and IOTC_CLIENT_LIB_PATH in rules.mk. Their default values reflect the
# original relative location of examples to IoTC Client. If this
# relative location is altered the varables shall be adjusted either
# directly in rules.mk or in commandline like
# 'make IOTC_CLIENT_INC_PATH=new/path/include IOTC_CLIENT_LIB_PATH=new/path/obj/osx'.
#
# Examples can be batch-built with 'make' in this directory or one-by-one
# 'make' in each example directory.
#
# Targets:
#
# all: builds all examples
# clean: cleans all examples
#
# [EXAMPLE_NAME]: builds only the specified example
# 'make mqtt_logic_example'
#
# Result binaries are under [EXAMPLE_NAME]/bin
#
# If you wish to create your own application based on a IoTC example source and
# makefile structure, then the following steps are suggested:
# - create a new subdirectory under examples: my_new_example
# - copy mqtt_logic_example/Makefile to my_new_example/Makefile and initialize
# variable IOTC_EXAMPLE_NAME with 'my_new_example'
# - put your code into my_new_exapmle/src/my_new_example.c
# - add the new example to the examples list: IOTC_EXAMPLES_ALL += my_new_example
# - execute 'make my_new_example'
#
# It should be 'easy' to alter these makefiles to cross-compile. This requires the
# following modification in rules.mk:
# - available cross-compiled IoTC Client library
# - changing the compiler and linker variables: CC and AR
# - adjusting linked libraries
MD=@
IOTC_EXAMPLES_ALL := iot_core_mqtt_client
all: $(IOTC_EXAMPLES_ALL)
.PHONY : $(IOTC_EXAMPLES_ALL)
$(IOTC_EXAMPLES_ALL) :
$(MD) $(MAKE) -C $(CURDIR)/$@ all
clean:
@for M in $(IOTC_EXAMPLES_ALL); do \
$(MAKE) -C $(CURDIR)/$$M clean; \
done;