-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile.cbraid-mex
76 lines (65 loc) · 2.04 KB
/
Makefile.cbraid-mex
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
# <LICENSE
# Braidlab: a Matlab package for analyzing data using braids
#
# http://github.com/jeanluct/braidlab
#
# Copyright (C) 2013-2021 Jean-Luc Thiffeault <jeanluc@math.wisc.edu>
# Marko Budisic <marko@clarkson.edu>
#
# This file is part of Braidlab.
#
# Braidlab 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.
#
# Braidlab 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 Braidlab. If not, see <http://www.gnu.org/licenses/>.
# LICENSE>
# File Names.
LIBCBRAID_SRC = cbraid.cpp braiding.cpp
LIBCBRAID_INCLUDEDIR = ../include
LIBCBRAID_OBJ = $(LIBCBRAID_SRC:.cpp=.o)
LIBCBRAID_A = libcbraid-mex.a
LIBCBRAID_CLEAN = $(LIBCBRAID_OBJ) $(LIBCBRAID_A)
# Compile options.
#CPPFLAGS_CLN = -DUSE_CLN
ifeq ($(CPPFLAGS_CLN),-DUSE_CLN)
LIBFLAGS_CLN = -lcln
endif
# The -fPIC option is for Matlab MEX-files. Doesn't hurt for other uses.
CPPFLAGS = -Wall -std=c++11 -O -fPIC -I$(LIBCBRAID_INCLUDEDIR) $(CPPFLAGS_CLN)
LIBFLAGS = -lcbraid -lm $(LIBFLAGS_CLN)
ARFLAGS = rv
CXX = g++
MAKEDEPCMD = $(CXX)
MAKEDEPFLAGS = -M
DEPFILE = .depends
# Default target.
all: $(LIBCBRAID_A)
# Default compile rules.
.cpp.o:
$(CXX) $(CPPFLAGS) -c $<
# Build libcbraid.
$(LIBCBRAID_A): $(LIBCBRAID_OBJ)
$(AR) $(ARFLAGS) $@ $?
$(LIBCBRAID_OBJ): $(LIBCBRAID_SRC)
# Cleanup.
clean:
rm -f $(LIBCBRAID_CLEAN)
rm -f $(DEPFILE)
# Make dependencies.
depend:
rm -f $(DEPFILE)
make $(DEPFILE)
# Make dependencies file.
$(DEPFILE):
$(MAKEDEPCMD) $(MAKEDEPFLAGS) $(LIBCBRAID_SRC) \
-I$(LIBCBRAID_INCLUDEDIR) > $(DEPFILE)
# Read in dependencies file created by 'make depend'.
sinclude $(DEPFILE)