# Copyright © 2019-2023 Dynare Team # # This file is part of Dynare. # # Dynare is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Dynare is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Dynare. If not, see . include versions.mk # settings for different architectures DEPS_ARCH ?= x86_64 # use x86_64 by default BREWDIR := $(if $(filter arm64,$(DEPS_ARCH)),/opt/homebrew,/usr/local) GCC_VERSION = $(shell sed -En "/^c[[:space:]]*=/s/c[[:space:]]*=[[:space:]]*'.*gcc-([0-9]+)'/\1/p" ../homebrew-native-$(DEPS_ARCH).ini) ROOT_PATH = $(realpath .) WGET_OPTIONS := --no-verbose --no-use-server-timestamps --retry-connrefused --retry-on-host-error NTHREADS=$(shell sysctl -n hw.perflevel0.physicalcpu) .PHONY: all build build-slicot build-x13as \ clean-lib clean-libslicot clean-x13as-bin \ clean-src clean-slicot-src clean-x13as-src \ clean-tar clean-slicot-tar clean-x13as-tar \ clean-all clean-lib clean-src clean-tar all: build build: build-slicot build-x13as clean-lib: clean-libslicot clean-x13as-bin clean-src: clean-slicot-src clean-x13as-src clean-tar: clean-slicot-tar clean-x13as-tar clean-all: clean-lib clean-src clean-tar # # slicot # tarballs/slicot-$(SLICOT_VERSION).tar.gz: mkdir -p tarballs wget $(WGET_OPTIONS) -O $@ https://deb.debian.org/debian/pool/main/s/slicot/slicot_$(SLICOT_VERSION).orig.tar.gz $(DEPS_ARCH)/sources64/slicot-$(SLICOT_VERSION): tarballs/slicot-$(SLICOT_VERSION).tar.gz rm -rf $(DEPS_ARCH)/sources64/slicot-* mkdir -p $@ tar xf $< --directory $@ --strip-components=1 touch $@ $(DEPS_ARCH)/lib64/slicot/libslicot64_pic.a: $(DEPS_ARCH)/sources64/slicot-$(SLICOT_VERSION) make -C $< FORTRAN=$(BREWDIR)/bin/gfortran LOADER=$(BREWDIR)/bin/gfortran SLICOTLIB=../libslicot64_pic.a OPTS="-O3 -fdefault-integer-8" lib -j$(NTHREADS) strip -S $