libk  Diff

Differences From Artifact [e19ff3649f]:

To Artifact [669569b504]:


47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62





63
64
65
66
67
68
69
...
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
...
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170

171
172
173
174
175
176
177
	*) say "cannot determine correct binary format to use for target $target"; exit 1;;
esac

# first, we establish the
# parameters of the build
has cc && _cc=cc
has clang && _cc=clang 
has gcc && _cc=gcc
cc=${cc:-$_cc}
has m4 && _m4=m4
m4=${m4:-$_m4}
has nasm && asm=nasm
has yasm && asm=yasm
export gen=${gen:-gen}
library=${libkind:-static} # {static|shared|both}






case $library in
	static) build_static_library=yes
	        build_shared_library=no;;

	shared) build_static_library=no
	        build_shared_library=yes;;

................................................................................

# generate errno tables
grep -h "#[ 	]*define[ 	]\+E" $p_headers_errno | sed 's;^#[\t ]*define[\t ]\+\(E[A-Z0-9]\+\).*$;k_platform_error_\1 \1;' > $gen/error_names.tbl
cat $p_headers_errno $gen/error_names.tbl | cpp -P >$gen/error_numbers.tbl
awk -f arch/errtbl.awk <$gen/error_numbers.tbl >$gen/error_table.h

# generate symbol tables for error handling functions
mkdir -p $out/k
awk -f global/gen-conds.awk <global/modules >$out/k/internal.egroup.h
awk -f global/gen-ident.awk <global/modules >$gen/internal.ident.c
comp_co $gen/internal.ident.c $out/internal.ident.o

# first pass: copy all headers into place,
# including ones we need to generate

................................................................................
		comp_mac "$h" "$out/k/$dest"
	done
done

# second pass: generate manpage, html, and pdf
# versions of the documentation from the md src

mkdir -p $out/doc/{man,html,pdf}
global/build-manpage.sh libk.md
for mod in ${modules[@]}; do
	for doc in $(scan $mod '*.md'); do
		base="$(basename $doc)"
		stem="${base%%.md}"
		global/build-manpage.sh "$doc"
		global/build-html.sh "$doc"
		global/build-pdf.sh "$doc"
	done
done


# third pass: compile sources and save the
# resulting object files to $out, tracking
# which is a runtime or function unit. exe's
# will not be compiled until a later pass

fn_objects=()







|




|



>
>
>
>
>







 







|







 







|
|
|
|
|
|
|
<
<
|
|
>







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
...
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
...
158
159
160
161
162
163
164
165
166
167
168
169
170
171


172
173
174
175
176
177
178
179
180
181
	*) say "cannot determine correct binary format to use for target $target"; exit 1;;
esac

# first, we establish the
# parameters of the build
has cc && _cc=cc
has clang && _cc=clang 
has gcc && _cc=gcc # prefer gcc
cc=${cc:-$_cc}
has m4 && _m4=m4
m4=${m4:-$_m4}
has nasm && asm=nasm
has yasm && asm=yasm # prefer yasm
export gen=${gen:-gen}
library=${libkind:-static} # {static|shared|both}

doc=${doc:-yes}
export doc_html=${doc_html:-yes}
export doc_pdf=${doc_pdf:-yes}
export doc_man=${doc_man:-yes}

case $library in
	static) build_static_library=yes
	        build_shared_library=no;;

	shared) build_static_library=no
	        build_shared_library=yes;;

................................................................................

# generate errno tables
grep -h "#[ 	]*define[ 	]\+E" $p_headers_errno | sed 's;^#[\t ]*define[\t ]\+\(E[A-Z0-9]\+\).*$;k_platform_error_\1 \1;' > $gen/error_names.tbl
cat $p_headers_errno $gen/error_names.tbl | cpp -P >$gen/error_numbers.tbl
awk -f arch/errtbl.awk <$gen/error_numbers.tbl >$gen/error_table.h

# generate symbol tables for error handling functions
mkdir -p "$out/k"
awk -f global/gen-conds.awk <global/modules >$out/k/internal.egroup.h
awk -f global/gen-ident.awk <global/modules >$gen/internal.ident.c
comp_co $gen/internal.ident.c $out/internal.ident.o

# first pass: copy all headers into place,
# including ones we need to generate

................................................................................
		comp_mac "$h" "$out/k/$dest"
	done
done

# second pass: generate manpage, html, and pdf
# versions of the documentation from the md src

if test "$doc" = "yes"; then
	global/build-manpage.sh libk.md
	for mod in ${modules[@]}; do
		for doc in $(scan $mod '*.md'); do
			base="$(basename $doc)"
			stem="${base%%.md}"
			global/build-manpage.sh "$doc"


		done
	done
fi

# third pass: compile sources and save the
# resulting object files to $out, tracking
# which is a runtime or function unit. exe's
# will not be compiled until a later pass

fn_objects=()