Skip to content

Commit 6267f57

Browse files
committed
Clean up make scripts a little, also simplifies readme
1 parent e12ef18 commit 6267f57

5 files changed

+18
-72
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Third-party forks, or separate tools, covering usecases this version doesn't (th
2121

2222
Compilation - Linux:
2323
- `sudo apt-get install g++ build-essential`; for GUI support, also `sudo apt-get install libgtk-3-dev pkg-config`; adjust for your distro if necessary
24-
- `./make-linux.sh` to build an optimized binary; for development, use `make CFLAGS=-g` (ignore make-maintainer.sh)
24+
- `./make-linux.sh` to build an optimized binary; for development, use `make CFLAGS=-g`
2525

2626
Compilation - OSX, other Unix, or anything else with a C++ compiler:
2727
- Install a C++ compiler
@@ -31,7 +31,7 @@ Compilation - OSX, other Unix, or anything else with a C++ compiler:
3131

3232
Compilation - Windows:
3333
- Install [mingw-w64](https://winlibs.com/), or similar
34-
- `mingw32-make CFLAGS=-O3` (GUI is automatically enabled), or extract the appropriate optimization commands from make-linux.sh
34+
- `mingw32-make CFLAGS=-g` (GUI is automatically enabled)
3535
- For better optimization, use `./make-windows.sh`
3636

3737
Usage:

flatpak/com.github.Alcaro.Flips.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"name" : "flips",
2323
"buildsystem" : "simple",
2424
"build-commands": [
25-
"sh make-linux.sh --cflags=-DFLATPAK",
25+
"sh make-linux.sh",
2626
"make install PREFIX=/app"
2727
],
2828
"sources" : [

make-linux.sh

+4-6
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
FLAGS='-Wall -O3 -flto -fuse-linker-plugin -fomit-frame-pointer -fmerge-all-constants -fvisibility=hidden'
66
FLAGS=$FLAGS' -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables'
77
FLAGS=$FLAGS' -ffunction-sections -fdata-sections -Wl,--gc-sections -fprofile-dir=obj/'
8-
#Linux flags, they don't make sense on Windows
9-
#make-maintainer.sh uses this
10-
LINFLAGS=' -Wl,-z,relro,-z,now,--as-needed,--hash-style=gnu,--relax'
8+
FLAGS=$FLAGS' -Wl,-z,relro,-z,now,--as-needed,--hash-style=gnu,--relax'
119

1210
# not a good solution, but imposing Werror on others is rude, and I'm not aware of a better way to detect if it's me
1311
if [ "$HOME" = "/home/walrus" ]; then
@@ -44,7 +42,7 @@ done
4442
if [ $PROFILE = yes ]; then
4543

4644
echo 'GTK+ (1/3)'
47-
rm obj/* flips; make CFLAGS="$FLAGS$LINFLAGS -fprofile-generate -lgcov" || exit $?
45+
rm obj/* flips; make CFLAGS="$FLAGS -fprofile-generate -lgcov" || exit $?
4846
[ -e flips ] || exit 1
4947

5048
echo 'GTK+ (2/3)'
@@ -61,7 +59,7 @@ $TIME ./flips --create --bps-delta profile/firefox-10.0esr.tar profile/f
6159
$TIME ./flips --create --bps-delta-moremem profile/firefox-10.0esr.tar profile/firefox-17.0esr.tar /dev/null
6260

6361
echo 'GTK+ (3/3)'
64-
rm flips; make CFLAGS="$FLAGS$LINFLAGS -fprofile-use" || exit $?
62+
rm flips; make CFLAGS="$FLAGS -fprofile-use" || exit $?
6563
else
66-
rm flips; make CFLAGS="$FLAGS$LINFLAGS" || exit $?
64+
rm flips; make CFLAGS="$FLAGS" || exit $?
6765
fi

make-maintainer.sh

-56
This file was deleted.

make-windows.sh

100644100755
+11-7
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,30 @@ FLAGS='-Wall -O3 -flto -fuse-linker-plugin -fomit-frame-pointer -fmerge-all-cons
1010
FLAGS=$FLAGS' -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables'
1111
FLAGS=$FLAGS' -ffunction-sections -fdata-sections -Wl,--gc-sections -fprofile-dir=obj/'
1212

13+
# Can be overridden to build Windows binaries from a Linux host
14+
# for example WINE=wine MAKE=mingw32-make ./make-windows.sh
15+
MAKE="${MAKE:-make}"
16+
WINE="${WINE:-}"
17+
1318

1419
rm floating.zip
1520
rm -r obj/* || true
1621

1722
#if trying to make a 32bit Flips, add -Wl,--large-address-aware
1823

1924
echo 'Windows (1/3)'
20-
rm -r obj/* flips.exe; make CFLAGS="$FLAGS -fprofile-generate -lgcov"
25+
rm -r obj/* flips.exe; $MAKE CFLAGS="$FLAGS -fprofile-generate -lgcov"
2126
[ -e flips.exe ] || exit
2227
echo 'Windows (2/3)'
23-
./flips.exe --create --bps-delta profile/firefox-10.0esr.tar profile/firefox-17.0esr.tar /dev/null
24-
./flips.exe --create --bps-delta-moremem profile/firefox-10.0esr.tar profile/firefox-17.0esr.tar /dev/null
28+
$WINE ./flips.exe --create --bps-delta profile/firefox-10.0esr.tar profile/firefox-17.0esr.tar /dev/null
29+
$WINE ./flips.exe --create --bps-delta-moremem profile/firefox-10.0esr.tar profile/firefox-17.0esr.tar /dev/null
2530
echo 'Windows (3/3)'
26-
rm flips.exe; make CFLAGS="$FLAGS -fprofile-use -s"
27-
31+
rm flips.exe; $MAKE CFLAGS="$FLAGS -fprofile-use -s"
2832

2933
#verify that there are no unexpected dependencies
3034
objdump -p flips.exe | grep 'DLL Name' | \
3135
grep -Pvi '(msvcrt|advapi32|comctl32|comdlg32|gdi32|kernel32|shell32|user32|api-ms-win-crt)' && \
3236
echo "Invalid dependency" && exit 1
3337

34-
exit 0
35-
38+
# a script's exit status is the same as the last command or pipeline run; if that's the above grep, things break
39+
true

0 commit comments

Comments
 (0)