abi.cc -> abi_type.cc
[musl-tables] / Makefile
1 MUSL=../musl
2
3 all: tables abi.ARCH.musl
4
5 clean:
6         rm -f sizeof*.o sizeof-glibc sizeof-musl sizeof.diff tab_*.html
7
8 tables:
9         MUSL=$(MUSL) ./update.sh
10
11 sizeof: sizeof-glibc sizeof-musl
12         ./sizeof-glibc >data/sizeof.ARCH.glibc
13         ./sizeof-musl >data/sizeof.ARCH.musl
14         diff -U1 data/sizeof.ARCH.glibc data/sizeof.ARCH.musl >data/sizeof.ARCH.diff || true
15
16 LIBGCC=`gcc -print-file-name=libgcc.a |sed 's,/libgcc.a$$,,'`
17 # when compiling with pcc
18 #PCC=`pcc -v foobar.o 2>&1 |sed -n 's,.* \([^ ]*\)/lib/crtbegin.o.*,\1,p'`
19
20 sizeof.c:
21         ./sizeof.sh
22
23 sizeof-glibc: sizeof.c
24         gcc -std=gnu99 -o $@ $<
25 sizeof-musl: sizeof.c
26         gcc -std=gnu99 -nostdinc -fno-stack-protector -isystem $(MUSL)/include -isystem $(LIBGCC) -isystem /usr/include -c -o $@.o $<
27         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
28 #       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
29 #       pcc -nostdinc -isystem $(MUSL)/include -isystem $(PCC)/include -c -o $@.o $<
30 #       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
31
32 sizeof-g++: sizeof.c
33         g++ -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
36 abi: abi.ARCH.diff
37         cp abi.ARCH.* data/
38
39 abi_type.cc:
40         ./abi_type.sh
41 abi.ARCH.glibc: abi_type.cc
42         g++ -std=c++11 $(GLIBC_FLAGS) -c -o $@.o $<
43         nm -C $@.o |sed -n 's/^[[:xdigit:]]* T //p' |sort >$@
44 abi.ARCH.musl: abi_type.cc
45         g++ -std=c++11 -nostdinc -fno-stack-protector -isystem $(MUSL)/include -isystem $(LIBGCC) -isystem /usr/include -c -o $@.o $<
46         nm -C $@.o |sed -n 's/^[[:xdigit:]]* T //p' |sort >$@
47 abi.ARCH.diff:  abi.ARCH.glibc abi.ARCH.musl
48         diff -U0 $^ >$@ || true