-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile.host
92 lines (79 loc) · 2.99 KB
/
Makefile.host
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
############################################################################
# apps/system/lzf/Makefile.host
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership. The
# ASF licenses this file to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance with the
# License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# 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.
#
############################################################################
############################################################################
# USAGE:
#
# 1. TOPDIR and APPDIR must be defined on the make command line: TOPDIR
# is the full path to the nuttx/ directory; APPDIR is the full path to
# the apps/ directory. For example:
#
# make -f Makefile.host TOPDIR=/home/me/projects/nuttx
# APPDIR=/home/me/projects/apps
#
# 2. Add CONFIG_DEBUG_FEATURES=y to the make command line to enable debug output
# 3. Make sure to clean old target .o files before making new host .o
# files.
#
############################################################################
include $(APPDIR)/Make.defs
BIN = bttool$(HOSTEXEEXT)
CFLAGS := -I.
CFLAGS += -I service/src
CFLAGS += -I framework/include
CFLAGS += -I tools
CFLAGS += -I service
CFLAGS += -I service/common
CFLAGS += -I service/ipc/socket/include
CFLAGS += -I service/stacks
CFLAGS += -I service/stacks/include
CFLAGS += -I service/profiles
CFLAGS += -I service/profiles/include
CFLAGS += -DFAR= -DOK=0 -m32
LDLIBS += -lpthread -lreadline -luv
BTDIR = $(APPDIR)/frameworks/bluetooth
CSRCS := $(wildcard framework/common/*.c)
CSRCS += $(wildcard framework/socket/*.c)
CSRCS += $(wildcard tools/*.c)
CSRCS := $(filter-out $(wildcard tools/lea*) tools/log.c,$(wildcard $(CSRCS)))
CSRCS += service/ipc/socket/src/bt_socket_client.c
CSRCS += service/ipc/socket/src/bt_socket_adapter.c
CSRCS += service/common/service_loop.c
CSRCS += service/src/manager_service.c
CSRCS += service/common/callbacks_list.c
CSRCS += service/common/index_allocator.c
CSRCS += service/utils/log.c
CINC := nuttx/config.h
CINC += nuttx/list.h
CINC += nuttx/nuttx.h
all: $(BIN)
.PHONY: clean
nuttx/config.h:
$(Q) mkdir -p nuttx
$(Q) ln -sf $(TOPDIR)/include/nuttx/config.h nuttx/
nuttx/list.h:
$(Q) mkdir -p nuttx
$(Q) ln -sf $(TOPDIR)/include/nuttx/list.h nuttx/
nuttx/nuttx.h:
$(Q) mkdir -p nuttx
$(Q) ln -sf $(TOPDIR)/include/nuttx/nuttx.h nuttx/
$(BIN): $(CINC) $(CSRCS)
$(Q) $(HOSTCC) $(CFLAGS) -o $@ $(filter-out $(CINC), $^) $(LDLIBS)
clean:
rm -rf $(BIN) nuttx