-
Notifications
You must be signed in to change notification settings - Fork 0
/
amalgamate.py
26 lines (21 loc) · 972 Bytes
/
amalgamate.py
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
# -- ccontainer amalgamete helper script --
# This helper script iterates include/ccontainer directory
# Copies all header files
# And creates one single .h file which named `ccontainer_amalgamate.h` out of it
# Into the curret directory or specified directory
# By this way you can use all the container types without
# explicity including them.
import os
ccontainer_amalgamate_header = open("ccontainer_amalgamate.h", 'a') # use append
script_info_text = "/* This header is auto-generated by ccontainer amalgamate.py\n* To create one single one single header file*/\n"
ccontainer_amalgamate_header.write(script_info_text)
INCLUDE_PATH = "./include/ccontainer/"
for header in os.listdir(INCLUDE_PATH):
if header.endswith(".h"):
# copy the content
# write to amalgamate header
header_content = open(INCLUDE_PATH + header, 'r')
ccontainer_amalgamate_header.write(header_content.read())
continue
else :
continue