Skip to content

Commit c9e05bc

Browse files
committed
Building all plats takes a while, so make the user select which plats to build.
1 parent 36ee2e3 commit c9e05bc

File tree

2 files changed

+21
-22
lines changed

2 files changed

+21
-22
lines changed

Makefile

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
DEFAULT_PLATFORM ?= pc86
99

10+
# Which architectures should get built?
11+
12+
PLATS =
13+
# PLATS = all
14+
# PLATS = linux386 linuxppc linuxmips
15+
$(if $(PLATS),, $(error Supply PLATS='something' to specify which architectures to build for. (Use 'all' for all of them.) (Edit the Makefile to set the default.))
16+
1017
# Where should the ACK put its temporary files?
1118

1219
ifeq ($(TMPDIR),)
@@ -60,6 +67,7 @@ ack-setup.exe: etc/windows-installer.nsi all
6067

6168
PLATIND = $(INSDIR)/share/ack
6269
PLATDEP = $(INSDIR)/lib/ack
70+
export PLATS
6371

6472
AB_ENABLE_PROGRESS_INFO = false
6573
include build/ab.mk

build.py

+13-22
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
11
from build.ab import export
22
from build.config import IS_WINDOWS
3+
import os
4+
from os.path import *
5+
from glob import glob
36

4-
# This is the list of which plats to build.
5-
PLATS = (
6-
[
7-
"linux386",
8-
"linux68k",
9-
"linuxmips",
10-
"linuxppc",
11-
"minix68k",
12-
"msdos386",
13-
"msdos86",
14-
"osx386",
15-
"osxppc",
16-
"pc86",
17-
"rpi",
18-
"pdpv7",
19-
"em22",
20-
]
21-
+
22-
# The i80 mach doesn't build on Windows because the ludicrous number of
23-
# object files blows the Windows command line limit.
24-
(["cpm"] if not IS_WINDOWS else [])
25-
)
7+
_plats = os.getenv("PLATS")
8+
if _plats == "all":
9+
PLATS = {dirname(p) for p in glob("*/build.py", root_dir="plat")}
10+
else:
11+
PLATS = _plats.split(" ")
12+
13+
if IS_WINDOWS and ("cpm" in PLATS):
14+
print("Warning: the cpm plat can't be built on Windows because of reasons; skipping.")
15+
PLATS.discard("cpm")
16+
print("Building plats: " + (" ".join(PLATS)))
2617

2718
# This is the list of which plats to test.
2819
TEST_PLATS = [

0 commit comments

Comments
 (0)