Permalink
Browse files

makefile-inc: for src folders

  • Loading branch information...
mringwal committed Apr 19, 2018
1 parent eedf4e5 commit 6601f559f63d1d77b4c9496c687a51e54ee83250
Showing with 137 additions and 0 deletions.
  1. +23 −0 src/Makefile.inc
  2. +13 −0 src/ble/Makefile.inc
  3. +7 −0 src/ble/gatt-service/Makefile.inc
  4. +44 −0 src/classic/Makefile.inc
  5. +50 −0 tool/create_makefile_inc.py
View
@@ -0,0 +1,23 @@
# Makefile to collect all C source files of src
SRC_FILES = \
btstack_ring_buffer.c \
btstack_hid_parser.c \
ad_parser.c \
hci_transport_h4.c \
l2cap.c \
btstack_memory.c \
btstack_util.c \
hci_dump.c \
btstack_memory_pool.c \
btstack_run_loop.c \
hci_cmd.c \
btstack_linked_list.c \
l2cap_signaling.c \
hci_transport_em9304_spi.c \
hci.c \
btstack_slip.c \
hci_transport_h5.c \
btstack_tlv.c \
btstack_crypto.c \
View
@@ -0,0 +1,13 @@
# Makefile to collect all C source files of src/ble
SRC_BLE_FILES = \
att_server.c \
ancs_client.c \
att_dispatch.c \
sm.c \
att_db_util.c \
le_device_db_memory.c \
le_device_db_tlv.c \
att_db.c \
gatt_client.c \
@@ -0,0 +1,7 @@
# Makefile to collect all C source files of src/ble/gatt-service
SRC_BLE_GATT-SERVICE_FILES = \
battery_service_server.c \
hids_device.c \
device_information_service_server.c \
View
@@ -0,0 +1,44 @@
# Makefile to collect all C source files of src/classic
SRC_CLASSIC_FILES = \
sdp_util.c \
hfp_msbc.c \
avrcp.c \
btstack_sbc_plc.c \
avrcp_target.c \
rfcomm.c \
sdp_client_rfcomm.c \
pbap_client.c \
avrcp_media_item_iterator.c \
hsp_ag.c \
avrcp_controller.c \
hsp_hs.c \
avdtp_acceptor.c \
avdtp.c \
sdp_client.c \
avdtp_sink.c \
btstack_sbc_decoder_bluedroid.c \
goep_client.c \
btstack_cvsd_plc.c \
avrcp_browsing_controller.c \
btstack_sbc_encoder_bluedroid.c \
hid_device.c \
avdtp_source.c \
hfp.c \
avdtp_util.c \
btstack_link_key_db_static.c \
hfp_gsm_model.c \
obex_iterator.c \
avdtp_initiator.c \
bnep.c \
btstack_link_key_db_memory.c \
sdp_server.c \
hfp_ag.c \
btstack_link_key_db_tlv.c \
pan.c \
hfp_hf.c \
spp_server.c \
device_id_server.c \
a2dp_sink.c \
a2dp_source.c \
@@ -0,0 +1,50 @@
#!/usr/bin/env python
#
# Create Makefile.inc file for all source folders
# Copyright 2017 BlueKitchen GmbH
import sys
import os
makefile_inc_header = '''# Makefile to collect all C source files of {folder}
{var_name} = \\
'''
folders = [
'src',
'src/ble',
'src/ble/gatt-service',
'src/classic',
]
# get btstack root
btstack_root = os.path.abspath(os.path.dirname(sys.argv[0]) + '/..')
def create_makefile_inc(path):
global btstack_root
folder_path = btstack_root + '/' + path + '/'
# write makefile based on header and list
with open(folder_path + "Makefile.inc", "wt") as fout:
var_name = path.upper().replace('/','_')+'_FILES'
fout.write(makefile_inc_header.format(var_name=var_name,folder=path))
# get all .c files in folder
for file in os.listdir(folder_path):
if not file.endswith(".c"):
continue
fout.write(' %s \\\n' % file)
fout.write('\n')
# create all makefile.inc
if (len(sys.argv) > 1):
path = sys.argv[1]
print('Creating Makefile.inc for %s' % path)
create_makefile_inc(path)
else:
for path in folders:
print('Creating Makefile.inc for %s' % path)
create_makefile_inc(path)

0 comments on commit 6601f55

Please sign in to comment.