Skip to content

Commit 734e4fa

Browse files
committed
Add autotools docker Makefile
This way, we can run an autotools build in any of the images.
1 parent b034936 commit 734e4fa

File tree

3 files changed

+21
-38
lines changed

3 files changed

+21
-38
lines changed

M2/BUILD/docker/autotools/Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# include this Makefile in other docker Makefiles to add a
2+
# 'build-autotools' target for running the entire autotools build
3+
4+
define M2_BUILD_SCRIPT_autotools
5+
set -xe
6+
7+
git config --global --add safe.directory $(M2_HOME)/M2
8+
mkdir -p M2/$(BUILD_DIR)
9+
cd M2/$(BUILD_DIR)
10+
$(M2_HOME)/M2/M2/autogen.sh
11+
$(M2_HOME)/M2/M2/configure $(CONFIG_OPT)
12+
make
13+
endef
14+
export M2_BUILD_SCRIPT_autotools
15+
16+
build-autotools: build-image
17+
docker run $(VOLUME) -it --entrypoint="" $(TAG) \
18+
bash -c "$$M2_BUILD_SCRIPT_autotools"

M2/BUILD/docker/fedora/Makefile

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
include ../ubuntu/Makefile
2+
include ../autotools/Makefile
23

34
## Parameters
45
RELEASE = latest
@@ -11,22 +12,4 @@ rpm:; docker run $(VOLUME) -it --entrypoint "" $(TAG) bash -c "cd M2/$(BUI
1112

1213
rpmlint:; docker run $(VOLUME) -it --entrypoint "" $(TAG) bash -c "rpmlint M2/$(BUILD_DIR)/Macaulay2-*.rpm"
1314

14-
## autotools build
15-
## TODO: generalize this to other distros, move to toplevel Makefile
16-
1715
CONFIG_OPT = --with-system-libs --enable-download --enable-rpm --prefix=/usr
18-
19-
define M2_BUILD_SCRIPT_autotools
20-
set -xe
21-
22-
mkdir -p M2/$(BUILD_DIR)
23-
cd M2/$(BUILD_DIR)
24-
$(M2_HOME)/M2/M2/autogen.sh
25-
$(M2_HOME)/M2/M2/configure $(CONFIG_OPT)
26-
make
27-
endef
28-
export M2_BUILD_SCRIPT_autotools
29-
30-
build-autotools: build-image
31-
docker run $(VOLUME) -it --entrypoint="" $(TAG) \
32-
bash -c "$$M2_BUILD_SCRIPT_autotools"

M2/BUILD/docker/rhel/Makefile

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
include ../Makefile
2+
include ../autotools/Makefile
23

34
## Parameters
45
DISTRIBUTION = rockylinux
@@ -9,23 +10,4 @@ BUILD_ARGS = --build-arg DISTRIBUTION=$(DISTRIBUTION) \
910
TAG = m2-$(BUILD)-$(DISTRIBUTION)-$(RELEASE)-build
1011
BUILD_DIR = M2/BUILD/build-docker
1112

12-
## Script for building Macaulay2 (autotools)
13-
define M2_BUILD_SCRIPT_autotools
14-
set -xe
15-
16-
git config --global --add safe.directory $(M2_HOME)/M2
17-
mkdir -p M2/$(BUILD_DIR)
18-
cd M2/$(BUILD_DIR)
19-
$(M2_HOME)/M2/M2/autogen.sh
20-
$(M2_HOME)/M2/M2/configure --with-system-gc --enable-download --enable-rpm \
21-
--prefix=/usr
22-
make
23-
endef
24-
export M2_BUILD_SCRIPT_autotools
25-
26-
###############################################################################
27-
# Build targets
28-
29-
build: build-image
30-
docker run $(VOLUME) -it --entrypoint="" $(TAG) \
31-
bash -c "$$M2_BUILD_SCRIPT_$(BUILD)"
13+
CONFIG_OPT = --with-system-gc --enable-download --enable-rpm --prefix=/usr

0 commit comments

Comments
 (0)