v1.1.24 update
[musl-tables] / Makefile
1 all: tables abi
2
3 clean:
4         rm -f sizeof*.o sizeof-glibc sizeof-musl sizeof.diff tab_*.html
5
6 tables:
7         MUSL=$(MUSL) ./update.sh
8 abi: data/abi_type.x86_64.musl data/abi_func.x86_64.musl
9
10 abi_type.x86_64.cc abi_func.cc: tables
11
12 data/abi_type.x86_64.musl: abi_type.x86_64.cc
13         CXX='g++ -nostdinc -isystem /tmp/T.x86_64/include' ./abi_type_data.sh >$@
14 data/abi_func.x86_64.musl: abi_func.cc
15         CXX='g++ -nostdinc -isystem /tmp/T.x86_64/include' ./abi_func_data.sh >$@
16
17
18 sizeof: sizeof-glibc sizeof-musl
19         ./sizeof-glibc >data/sizeof.ARCH.glibc
20         ./sizeof-musl >data/sizeof.ARCH.musl
21         diff -U1 data/sizeof.ARCH.glibc data/sizeof.ARCH.musl >data/sizeof.ARCH.diff || true
22
23 LIBGCC=`gcc -print-file-name=libgcc.a |sed 's,/libgcc.a$$,,'`
24 # when compiling with pcc
25 #PCC=`pcc -v foobar.o 2>&1 |sed -n 's,.* \([^ ]*\)/lib/crtbegin.o.*,\1,p'`
26
27 sizeof.c:
28         ./sizeof.sh
29
30 sizeof-glibc: sizeof.c
31         gcc -std=gnu99 -o $@ $<
32 sizeof-musl: sizeof.c
33         gcc -std=gnu99 -nostdinc -fno-stack-protector -isystem $(MUSL)/include -isystem $(LIBGCC) -isystem /usr/include -c -o $@.o $<
34         ld -o $@ $@.o -X -d -e _start -Bstatic $(MUSL)/lib/crti.o $(MUSL)/lib/crt1.o $(MUSL)/lib/crtn.o -L$(MUSL)/lib -lc -L$(LIBGCC) -lgcc -nostdlib
35 #       ld -o $@ $@.o $(MUSL)/lib/crti.o $(MUSL)/lib/crt1.o $(MUSL)/lib/crtn.o -L$(MUSL)/lib -lc -dynamic-linker $(MUSL)/lib/libc.so -L$(LIBGCC) -lgcc -nostdlib
36 #       pcc -nostdinc -isystem $(MUSL)/include -isystem $(PCC)/include -c -o $@.o $<
37 #       ld -X -d -e _start -Bstatic -o $@ $@.o $(MUSL)/lib/crti.o $(MUSL)/lib/crt1.o $(PCC)/lib/crtbegin.o $(PCC)/lib/crtend.o -L$(MUSL)/lib -lc -L$(PCC)/lib -lpcc -nostdlib
38
39 sizeof-g++: sizeof.c
40         g++ -std=gnu99 -nostdinc -fno-stack-protector -isystem $(MUSL)/include -isystem $(LIBGCC) -isystem /usr/include -c -o $@.o $<
41         ld -o $@ $@.o -X -d -e _start -Bstatic $(MUSL)/lib/crti.o $(MUSL)/lib/crt1.o $(MUSL)/lib/crtn.o -L$(MUSL)/lib -lc -L$(LIBGCC) -lgcc -nostdlib
42
43 #abi: abi.ARCH.diff
44 #       cp abi.ARCH.* data/
45
46 #abi_type.cc:
47 #       ./abi_type.sh
48 abi.ARCH.glibc: abi_type.cc
49         g++ -std=c++11 $(GLIBC_FLAGS) -c -o $@.o $<
50         nm -C $@.o |sed -n 's/^[[:xdigit:]]* T //p' |sort >$@
51 abi.ARCH.musl: abi_type.cc
52         g++ -std=c++11 -nostdinc -fno-stack-protector -isystem $(MUSL)/include -isystem $(LIBGCC) -isystem /usr/include -c -o $@.o $<
53         nm -C $@.o |sed -n 's/^[[:xdigit:]]* T //p' |sort >$@
54 abi.ARCH.diff:  abi.ARCH.glibc abi.ARCH.musl
55         diff -U0 $^ >$@ || true