Initial commit
[lnanohtmltiledmap.git] / make_tinycc_gnuas_aarch64
blob73fbbf34e10bbedd36ccefbbbe4a477eb9e69c1d
1 #!/bin/sh
2 tcc=/run/toolchain/bin/arm64-tcc
3 cpp="$tcc -E"
4 as=/nyan/aarch64-binutils/current/bin/aarch64-unknown-linux-gnu-as
5 ld=/nyan/aarch64-binutils/current/bin/aarch64-unknown-linux-gnu-ld
6 strip=/nyan/aarch64-binutils/current/bin/aarch64-unknown-linux-gnu-strip
8 LC_ALL=C
9 export LC_ALL
10 set -e
11 #-------------------------------------------------------------------------------
12 # build dir and src dir
13 build_dir=$(readlink -f .)
14 echo build_dir=$build_dir
16 src_dir=$(readlink -f $(dirname $0))
17 echo src_dir=$src_dir
19 config_h_dir=$build_dir
20 #-------------------------------------------------------------------------------
21 arch=aarch64
22 #-------------------------------------------------------------------------------
23 # configure our ultra-thin linux "uapi" (User API) abstraction layer
24 rm -f $build_dir/ulinux/arch
25 mkdir -p $build_dir/ulinux
26 ln -f -s $src_dir/ulinux/archs/$arch $build_dir/ulinux/arch
27 #-------------------------------------------------------------------------------
28 if test ! -e $config_h_dir/config.h; then
29 printf "missing config.h in $config_h_dir\n"
30 exit 1
32 echo ASM all.S
33 $cpp -D__GNUAS__ -DTINYC_GENERATED_MEMORY_OPERATIONS -I$config_h_dir -I$build_dir -I$src_dir $src_dir/all.S >$build_dir/all.cpp.s
34 # cleanup the cpp output from its line directives
35 egrep -v '^[[:space:]]*#' $build_dir/all.cpp.s > $build_dir/all.s
36 sed -e '/^[[:space:]]*$/ d' -i $build_dir/all.s
37 $as -o $build_dir/all_s.o $build_dir/all.s
39 echo CC all.c
40 $cpp -DTINYC_GENERATED_MEMORY_OPERATIONS -fvisibility=hidden -o $build_dir/all_c.cpp.c -I$config_h_dir -I$build_dir -I$src_dir $src_dir/all.c
41 $tcc -c -DTINYC_GENERATED_MEMORY_OPERATIONS -fvisibility=hidden -o $build_dir/all_c.o -I$config_h_dir -I$build_dir -I$src_dir $src_dir/all.c
43 echo LD lnanohttptiledmap
44 $ld -Bstatic -nostdlib -o $build_dir/lnanohtmltiledmap $build_dir/all_s.o $build_dir/all_c.o
46 echo STRIP lnanohttpmap
47 $strip -s $build_dir/lnanohtmltiledmap