1
2add_header(
3  llvm_libc_common_h
4  HDR
5    __llvm-libc-common.h
6)
7
8add_header(
9  libc_posix_types
10  HDR
11    __posix-types.h
12)
13
14add_header(
15  stdc_types
16  HDR
17    __llvm-libc-stdc-types.h
18)
19
20add_gen_header(
21  ctype
22  DEF_FILE ctype.h.def
23  GEN_HDR ctype.h
24  DEPENDS
25    .llvm_libc_common_h
26)
27
28add_gen_header(
29  fenv
30  DEF_FILE fenv.h.def
31  GEN_HDR fenv.h
32  DEPENDS
33    .llvm_libc_common_h
34)
35
36add_gen_header(
37  math
38  DEF_FILE math.h.def
39  GEN_HDR math.h
40  DEPENDS
41    .llvm_libc_common_h
42    .stdc_types
43)
44
45add_gen_header(
46  assert_h
47  DEF_FILE assert.h.def
48  GEN_HDR assert.h
49  DEPENDS
50    .llvm_libc_common_h
51)
52
53add_gen_header(
54  string
55  DEF_FILE string.h.def
56  GEN_HDR string.h
57  DEPENDS
58    .llvm_libc_common_h
59)
60
61add_gen_header(
62  time
63  DEF_FILE time.h.def
64  GEN_HDR time.h
65  DEPENDS
66    .llvm_libc_common_h
67)
68
69add_gen_header(
70  threads
71  DEF_FILE threads.h.def
72  GEN_HDR threads.h
73  PARAMS
74    platform_threads=../config/${LIBC_TARGET_OS}/threads.h.in
75  DEPENDS
76    .llvm_libc_common_h
77  DATA_FILES
78    ../config/${LIBC_TARGET_OS}/threads.h.in
79)
80
81add_gen_header(
82  errno
83  DEF_FILE errno.h.def
84  PARAMS
85    platform_errno=../config/${LIBC_TARGET_OS}/errno.h.in
86  GEN_HDR errno.h
87  DATA_FILES
88    ../config/${LIBC_TARGET_OS}/errno.h.in
89)
90
91add_gen_header(
92  signal
93  DEF_FILE signal.h.def
94  PARAMS
95    platform_signal=../config/${LIBC_TARGET_OS}/signal.h.in
96  GEN_HDR signal.h
97  DATA_FILES
98    ../config/${LIBC_TARGET_OS}/signal.h.in
99)
100
101add_gen_header(
102  stdio
103  DEF_FILE stdio.h.def
104  GEN_HDR stdio.h
105  DEPENDS
106    .llvm_libc_common_h
107)
108
109add_gen_header(
110  stdlib
111  DEF_FILE stdlib.h.def
112  GEN_HDR stdlib.h
113  DEPENDS
114    .llvm_libc_common_h
115)
116
117add_gen_header(
118  unistd
119  DEF_FILE unistd.h.def
120  GEN_HDR unistd.h
121  DEPENDS
122    .llvm_libc_common_h
123)
124
125# TODO: Not all platforms will have a include/sys directory. Add the sys
126# directory and the targets for sys/*.h files conditional to the OS requiring
127# them.
128file(MAKE_DIRECTORY "sys")
129
130add_gen_header(
131  sys_mman
132  DEF_FILE sys/mman.h.def
133  GEN_HDR sys/mman.h
134  DEPENDS
135    .libc_posix_types
136    .llvm_libc_common_h
137)
138
139add_gen_header(
140  sys_syscall
141  DEF_FILE sys/syscall.h.def
142  GEN_HDR sys/syscall.h
143  PARAMS
144    syscall_numbers=../config/${LIBC_TARGET_OS}/syscall_numbers.h.inc
145  DATA_FILES
146    ../config/${LIBC_TARGET_OS}/syscall_numbers.h.inc
147)
148