File: Makefile

package info (click to toggle)
libgdf 0.1.3-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,352 kB
  • sloc: cpp: 7,096; makefile: 65; sh: 49
file content (53 lines) | stat: -rw-r--r-- 1,660 bytes parent folder | download | duplicates (6)
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
#
# build matlab functions using matlab's mex tool
#
# issues:
#	* MEX automatically appends the arch dependent suffix (.mexglx, .mexa64, etc.)
#	  How can we make the Makefile aware of the correct suffix? (Hardcoded for now)
#
#	* The libGDF binaries are put where the user chooses to build the library with cmake.
#	  Putting the binaries into a specific location inside the source tree would probably
#	  be the easiest solution, but is not pretty. (For now the search path is hardcoded to
#	  ../build)
#
#	* Location of matlab installation: How can this be determined?
#


SOURCEDIR = .
OUTDIR = .
OBJDIR = build

MEXSUFFIX = mexa64

GDF_INCLUDE_DIR = -I../libgdf/include
GDF_LIB_DIR = -L../build/libgdf
GDF_LIBS = -lGDF

MATLABROOT = /opt/matlab/R2010b
MATLAB_INCLUDE_DIR = -I$(MATLABROOT)/extern/include

MEXTOOL = $(MATLABROOT)/bin/mex

CXXFLAGS = -c -cxx -O -DNDEBUG
LDFLAGS = 

all: $(OUTDIR)/gdf_reader.$(MEXSUFFIX) $(OUTDIR)/gdf_writer.$(MEXSUFFIX)

clean:
	rm -rf $(OBJDIR) $(OUTDIR)/gdf_reader.$(MEXSUFFIX) $(OUTDIR)/gdf_writer.$(MEXSUFFIX)
	
buildclean:
	rm -rf $(OBJDIR)
	
$(OUTDIR)/gdf_reader.$(MEXSUFFIX): $(OBJDIR)/gdf_reader.o
	$(MEXTOOL) -cxx $(LDFLAGS) $(GDF_LIB_DIR) $(GDF_LIBS) -outdir $(OUTDIR) -output $@ $^
	
$(OUTDIR)/gdf_writer.$(MEXSUFFIX): $(OBJDIR)/gdf_writer.o
	$(MEXTOOL) -cxx $(LDFLAGS) $(GDF_LIB_DIR) $(GDF_LIBS) -outdir $(OUTDIR) -output $@ $^
	
$(OBJDIR)/gdf_reader.o: $(SOURCEDIR)/gdf_reader.cpp
	$(MEXTOOL) $(CXXFLAGS) $(MATLAB_INCLUDE_DIR) $(GDF_INCLUDE_DIR) -outdir $(OBJDIR) $^

$(OBJDIR)/gdf_writer.o: $(SOURCEDIR)/gdf_writer.cpp
	$(MEXTOOL) $(CXXFLAGS) $(MATLAB_INCLUDE_DIR) $(GDF_INCLUDE_DIR) -outdir $(OBJDIR) $^