-
Notifications
You must be signed in to change notification settings - Fork 14
/
Makefile
116 lines (104 loc) · 2.89 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#================================================================================
#
# Copyright (C) 2020 Institute of Theoretical Astrophysics, University of Oslo.
#
# This file is part of Commander3.
#
# Commander3 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.
#
# Commander3 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 Commander3. If not, see <https://www.gnu.org/licenses/>.
#
#================================================================================
# Commander Makefile for use with EITHER the planck
# module build system OR a set of stand-alone
# config files. Default make target prints help.
#
# This makefile requires the use of GNU make or
# compatible tools that allow the substitution
# operator ":=".
#
NOW := $(shell date +%Y%m%d-%H%M)
DIR := commander_$(NOW)
TOPDIR := $(shell pwd)
export TOPDIR
ifdef COMMANDER
include $(TOPDIR)/commander3/config/config.$(COMMANDER)
ifndef INSTALL
INSTALL := $(TOPDIR)/install_$(COMMANDER)
endif
else
$(error COMMANDER undefined)UNDEFINED
endif
ifndef MAKE
export MAKE := make
endif
ifndef AR
export AR := ar
endif
ifndef ARFLAGS
export ARFLAGS := crv
endif
ifndef RANLIB
export RANLIB := ranlib
endif
ifndef CTAR
export CTAR := tar czvf
endif
ifndef F90
export F90 := f90
endif
ifndef MPF90
export MPF90 := mpif90
endif
ifndef F90FLAGS
export F90FLAGS := -g -O2
endif
ifndef MPF77
export MPF77 := mpif77
endif
ifndef FFLAGS
export FFLAGS := -g -O2
endif
ifndef MPCC
export MPCC := cc
endif
ifndef CFLAGS
export CFLAGS := -g -O2
endif
ifndef MPCXX
export MPCXX := c++
endif
ifndef CXXFLAGS
export CXXFLAGS := -g -O2
endif
ifndef LDFLAGS
export LDFLAGS := -lm
endif
ifndef FORTRAN_UPPER
export FORTRAN_UPPER := 0
endif
ifndef CFITSIO_LINK
export CFITSIO_LINK := -L/usr/local/lib -lcfitsio
endif
ifndef LAPACK_LINK
export LAPACK_LINK := #-L/usr/local/lib -llapack -lblas
endif
export F90COMP := $(F90FLAGS) $(LAPACK_INCLUDE) $(CFITSIO_INCLUDE) $(HEALPIX_INCLUDE) $(HDF_INCLUDE) $(CAMB_INCLUDE) $(FFTW_INCLUDE)
export FCOMP := $(FFLAGS) $(LAPACK_INCLUDE) $(CFITSIO_INCLUDE) $(HEALPIX_INCLUDE) $(FFTW_INCLUDE)
export CCOMP := $(CFLAGS) $(LAPACK_INCLUDE) $(CFITSIO_INCLUDE) $(HEALPIX_INCLUDE) $(FFTW_INCLUDE)
export LINK := -L. $(SHARP_LINK) $(HEALPIX_LINK) $(CFITSIO_LINK) $(LAPACK_LINK) $(HDF_LINK) $(LDFLAGS) $(F90OMPFLAGS) $(CAMB_LINK) $(FFTW_LINK)
export TEMPITA := "$(TOPDIR)/commander3/python/tempita_proc.py"
all : commander
commander :
@cd commander3/src; $(MAKE)
clean :
@cd commander3/src; $(MAKE) clean