Skip to content

Commit f9be218

Browse files
authored
Merge pull request #1150 from LourensVeen/old-macos-make-support
Improve make 3.81 support
2 parents 5758533 + 420dbe5 commit f9be218

8 files changed

Lines changed: 15 additions & 16 deletions

File tree

lib/sapporo_light/Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ $(DYNAMIC_LIB): $(OBJS) $(CUOBJS)
8686
$(NVCC) $(NVCCFLAGS) -c $< -o $@
8787

8888
$(PKG_CONFIG_FILE):
89-
$(file >$@,$(PKG_CONFIG_CONTENTS))
89+
# the file function is not available on old macOS make, so we make do with this
90+
printf '' >$@
91+
$(foreach line,$(PKG_CONFIG_CONTENTS),printf '%s\n' '$(line)' >>$@;)
9092

9193

9294
.PHONY: clean

src/amuse/rfi/tools/dir_templates/Makefile_cxx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ VERSION = VERSION
1616
##### Modify URL as needed #####
1717
$(DOWNLOAD) https://github.com/{code}/{code}/archive/$(VERSION).tar.gz >$@
1818

19-
PATCHES := $(file < patches/series)
20-
PATCHES := $(patsubst %,%,$(PATCHES)) # replace newlines with spaces
19+
PATCHES := $(shell cat patches/series)
2120

2221
src/{code}-$(VERSION): {code}.tar.gz
2322
##### Modify as needed #####

src/amuse/rfi/tools/dir_templates/Makefile_fortran

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ VERSION = VERSION
1616
##### Modify URL as needed #####
1717
$(DOWNLOAD) https://github.com/{code}/{code}/archive/$(VERSION).tar.gz >$@
1818

19-
PATCHES := $(file < patches/series)
20-
PATCHES := $(patsubst %,%,$(PATCHES)) # replace newlines with spaces
19+
PATCHES := $(shell cat patches/series)
2120

2221
src/{code}-$(VERSION): {code}.tar.gz
2322
##### Modify as needed #####

src/amuse_mesa_r15140/Makefile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,7 @@ src/mesa-$(MESA_VERSION).zip:
4242

4343
MESA_DIR := src/mesa-$(MESA_VERSION)
4444

45-
PATCHES := $(file < patches/series_mesa)
46-
PATCHES := $(patsubst %,%,$(PATCHES)) # replace newlines with spaces
47-
45+
PATCHES := $(shell cat patches/series)
4846

4947
$(MESA_DIR): src/mesa-$(MESA_VERSION).zip
5048
cd src && unzip -q ../$<

src/amuse_mesa_r2208/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ support/config.mk:
1212
mesa_r2208.zip:
1313
$(DOWNLOAD) https://zenodo.org/record/2603017/files/mesa-r2208.zip >$@
1414

15-
PATCHES := $(file < patches/series)
16-
PATCHES := $(patsubst %,%,$(PATCHES)) # replace newlines with spaces
15+
PATCHES := $(shell cat patches/series)
1716

1817
src/mesa: mesa_r2208.zip
1918
mkdir -p src

src/amuse_mocassin/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ VERSION = 2.02.70
1414
mocassin.$(VERSION).tar.gz:
1515
$(DOWNLOAD) https://amuse.strw.leidenuniv.nl/codes/mocassin.$(VERSION).tar.gz >$@
1616

17-
PATCHES := $(file < patches/series)
18-
PATCHES := $(patsubst %,%,$(PATCHES)) # replace newlines with spaces
17+
PATCHES := $(shell cat patches/series)
1918

2019
src:
2120
mkdir -p src

src/amuse_mpiamrvac/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ VERSION = r187
1414
mpiamrvac.tar.gz:
1515
$(DOWNLOAD) http://amuse.strw.leidenuniv.nl/codes/mpiamrvac-$(VERSION).tgz >$@
1616

17-
PATCHES := $(file < patches/series)
18-
PATCHES := $(patsubst %,%,$(PATCHES)) # replace newlines with spaces
17+
PATCHES := $(shell cat patches/series)
1918

2019
src/mpiamrvac: | mpiamrvac.tar.gz
2120
tar xf $|

support/shared/lib-targets.mk

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ $(DYNAMIC_LIB): $(OBJS)
9191
$(FC) $(FCFLAGS) -c -o $*.o $<
9292

9393
$(PKG_CONFIG_FILE):
94-
$(file >$@,$(PKG_CONFIG_CONTENTS))
94+
# the file function is not available on old macOS make, so we make do with this
95+
printf '' >$@
96+
$(foreach line,$(PKG_CONFIG_CONTENTS),printf '%s\n' '$(line)' >>$@;)
9597

9698

9799
ifdef DYNAMIC_LIB_MPI
@@ -106,7 +108,9 @@ endif
106108
$(MPIFC) $(FCFLAGS) $(CFLAGS_MPI) -c -o $*.mo $<
107109

108110
$(PKG_CONFIG_FILE_MPI):
109-
$(file >$@,$(PKG_CONFIG_CONTENTS_MPI))
111+
# the file function is not available on old macOS make, so we make do with this
112+
printf '' >$@
113+
$(foreach line,$(PKG_CONFIG_CONTENTS_MPI),printf '%s\n' '$(line)' >>$@;)
110114

111115

112116
# Clean up

0 commit comments

Comments
 (0)