forked from firmadyne/libnvram
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpackage.sh
executable file
·53 lines (41 loc) · 1.58 KB
/
package.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
set -eux
# Host is mapped at /app
rm -rf /app/out
mkdir /app/out
SCRATCH=$(mktemp -d)/libnvram
mkdir $SCRATCH
CC=arm-linux-musleabi-gcc make CFLAGS="-DCONFIG_ARM=1" libnvram.so -C /app
mv nvram.o $SCRATCH/nvram.o.armel
mv libnvram.so $SCRATCH/libnvram.so.armel
make clean
CC=arm-linux-musleabihf-gcc make CFLAGS="-DCONFIG_ARM=1 -mfloat-abi=hard" libnvram.so -C /app
mv nvram.o $SCRATCH/nvram.o.armelhf
mv libnvram.so $SCRATCH/libnvram.so.armelhf
make clean
CC=aarch64-linux-musl-gcc make CFLAGS="-DCONFIG_AARCH64=1" libnvram.so -C /app
mv nvram.o $SCRATCH/nvram.o.aarch64
mv libnvram.so $SCRATCH/libnvram.so.aarch64
make clean
CC=mipsel-linux-musl-gcc make CFLAGS="-DCONFIG_MIPS=1 -march=mips32r2" libnvram.so -C /app
mv nvram.o $SCRATCH/nvram.o.mipsel
mv libnvram.so $SCRATCH/libnvram.so.mipsel
make clean
CC=mipseb-linux-musl-gcc make CFLAGS="-DCONFIG_MIPS=1 -march=mips32r2" libnvram.so -C /app
mv nvram.o $SCRATCH/nvram.o.mipseb
mv libnvram.so $SCRATCH/libnvram.so.mipseb
make clean
CC=mips64eb-linux-musl-gcc make CFLAGS="-DCONFIG_MIPS=1 -march=mips64r2 -mabi=64" libnvram.so -C /app
mv nvram.o $SCRATCH/nvram.o.mips64eb
mv libnvram.so $SCRATCH/libnvram.so.mips64eb
make clean
CC=x86_64-linux-musl-gcc make CFLAGS="-DCONFIG_X86_64=1" libnvram.so -C /app
mv nvram.o $SCRATCH/nvram.o.x86_64
mv libnvram.so $SCRATCH/libnvram.so.x86_64
make clean
CC=i686-linux-musl-gcc make CFLAGS="-DCONFIG_I386=1" libnvram.so -C /app
mv nvram.o $SCRATCH/nvram.o.i386
mv libnvram.so $SCRATCH/libnvram.so.i386
make clean
tar -czvf /app/libnvram-latest.tar.gz -C $(dirname $SCRATCH) libnvram
rm -rf /app/out