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  ctype
16  HDR
17   ctype.h
18  DEPENDS
19    .llvm_libc_common_h
20)
21
22add_gen_header(
23  math
24  DEF_FILE math.h.def
25  GEN_HDR math.h
26  DEPENDS
27    .llvm_libc_common_h
28)
29
30add_gen_header(
31  assert_h
32  DEF_FILE assert.h.def
33  GEN_HDR assert.h
34  DEPENDS
35    .llvm_libc_common_h
36)
37
38add_gen_header(
39  string
40  DEF_FILE string.h.def
41  GEN_HDR string.h
42  DEPENDS
43    .llvm_libc_common_h
44)
45
46add_gen_header(
47  threads
48  DEF_FILE threads.h.def
49  GEN_HDR threads.h
50  PARAMS
51    platform_threads=../config/${LIBC_TARGET_OS}/threads.h.in
52  DEPENDS
53    .llvm_libc_common_h
54  DATA_FILES
55    ../config/${LIBC_TARGET_OS}/threads.h.in
56)
57
58add_gen_header(
59  errno
60  DEF_FILE errno.h.def
61  PARAMS
62    platform_errno=../config/${LIBC_TARGET_OS}/errno.h.in
63  GEN_HDR errno.h
64  DATA_FILES
65    ../config/${LIBC_TARGET_OS}/errno.h.in
66)
67
68add_gen_header(
69  signal
70  DEF_FILE signal.h.def
71  PARAMS
72    platform_signal=../config/${LIBC_TARGET_OS}/signal.h.in
73  GEN_HDR signal.h
74  DATA_FILES
75    ../config/${LIBC_TARGET_OS}/signal.h.in
76)
77
78add_gen_header(
79  stdio
80  DEF_FILE stdio.h.def
81  GEN_HDR stdio.h
82  DEPENDS
83    .llvm_libc_common_h
84)
85
86add_gen_header(
87  stdlib
88  DEF_FILE stdlib.h.def
89  GEN_HDR stdlib.h
90  DEPENDS
91    .llvm_libc_common_h
92)
93
94add_gen_header(
95  unistd
96  DEF_FILE unistd.h.def
97  GEN_HDR unistd.h
98  DEPENDS
99    .llvm_libc_common_h
100)
101
102# TODO: Not all platforms will have a include/sys directory. Add the sys
103# directory and the targets for sys/*.h files conditional to the OS requiring
104# them.
105file(MAKE_DIRECTORY "sys")
106
107add_gen_header(
108  sys_mman
109  DEF_FILE sys/mman.h.def
110  GEN_HDR sys/mman.h
111  DEPENDS
112    .libc_posix_types
113    .llvm_libc_common_h
114)
115
116add_gen_header(
117  sys_syscall
118  DEF_FILE sys/syscall.h.def
119  GEN_HDR sys/syscall.h
120  PARAMS
121    syscall_numbers=../config/${LIBC_TARGET_OS}/syscall_numbers.h.inc
122  DATA_FILES
123    ../config/${LIBC_TARGET_OS}/syscall_numbers.h.inc
124)
125