-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMakefile
More file actions
48 lines (37 loc) · 1.34 KB
/
Makefile
File metadata and controls
48 lines (37 loc) · 1.34 KB
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
# Makefile to compile the MEX function <Process_SMOSxL1C> from linux console:
#// Copyright (c) 2016 Pablo Saavedra Garfias
#//
#// this file is part of 'Process_SMOSxL1C', see LICENSE.
HOST = $(shell hostname)
ifeq ($(HOST),mysu.yolle)
MATLABROOT = /usr/local/MATLAB/R2010b
else
# Uncomment one of the following location for your system and MATLAB installation
MATLABROOT = /usr/local/MATLAB/R2018a/
# MATLABROOT = /usr/local/matlab7.8
# MATLABROOT = /usr/local/matlab9.1
endif
# General Options to pass to the compiler defined in CFLAGS
COMMON_CXX = -O2 -Wall -Wextra -std=gnu++11
MYLIBS = -lgsl -lgslcblas
# Matlab Options:
MYFLAGS = CXXFLAGS='$$CXXFLAGS $$COMMON_CXX' #-Wall -O2 -std=gnu++11'
CC = $(MATLABROOT)/bin/mex # Matlab compiler
# Octave Options:
OCTAVEROOT = /usr/bin
MYFLAGS_OCT = -DOCT_MEX_FILE=1 --mex
CC_OCT = $(OCTAVEROOT)/mkoctfile # Octave compiler
OCT_CXX = `mkoctfile -p CXXFLAGS` $(COMMON_CXX)
MYOCTLIBS = $(MYLIBS) -lmatio
SOURCE = Process_SMOSxL1C.cpp
# Rules to build MATLAB MEX function:
all: Process_SMOSxL1C.mexa64
Process_SMOSxL1C.mexa64: $(SOURCE)
$(CC) $(MYFLAGS) $^ $(MYLIBS)
# Rules to build Octave MEX function:
octave: Process_SMOSxL1C.mex
Process_SMOSxL1C.mex: $(SOURCE)
CXXFLAGS="$(OCT_CXX)" \
$(CC_OCT) $(MYFLAGS_OCT) $^ $(MYOCTLIBS)
clean:
rm -f Process_SMOSxL1C.o Process_SMOSxL1C.mex Process_SMOSxL1C.mexa64