Elliott Hughes | a3cc9bc | 2019-08-15 16:10:41 -0700 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | set -e |
| 4 | |
Elliott Hughes | 00969f6 | 2019-08-22 10:54:26 -0700 | [diff] [blame] | 5 | rm -rf .config generated/ android/ |
Elliott Hughes | a3cc9bc | 2019-08-15 16:10:41 -0700 | [diff] [blame] | 6 | |
Elliott Hughes | 077af14 | 2019-08-21 08:39:15 -0700 | [diff] [blame] | 7 | function generate() { |
| 8 | which=$1 |
| 9 | echo -e "\n-------- $1\n" |
Elliott Hughes | a3cc9bc | 2019-08-15 16:10:41 -0700 | [diff] [blame] | 10 | |
Elliott Hughes | 077af14 | 2019-08-21 08:39:15 -0700 | [diff] [blame] | 11 | # These are the only generated files we actually need. |
| 12 | files="config.h flags.h globals.h help.h newtoys.h tags.h" |
Elliott Hughes | a3cc9bc | 2019-08-15 16:10:41 -0700 | [diff] [blame] | 13 | |
Elliott Hughes | 077af14 | 2019-08-21 08:39:15 -0700 | [diff] [blame] | 14 | cp .config-$which .config |
| 15 | NOBUILD=1 scripts/make.sh |
| 16 | out=android/$which/generated/ |
| 17 | mkdir -p $out |
| 18 | for f in $files; do cp generated/$f $out/$f ; done |
| 19 | rm -rf .config generated/ |
| 20 | } |
| 21 | |
Elliott Hughes | 077af14 | 2019-08-21 08:39:15 -0700 | [diff] [blame] | 22 | generate "device" |
Elliott Hughes | 00969f6 | 2019-08-22 10:54:26 -0700 | [diff] [blame] | 23 | generate "linux" |
| 24 | generate "mac" |