Mercurial > forge
annotate extra/NaN/src/Makefile @ 7376:37789a34b615 octave-forge
add reading and writing of XPT (SAS Transport File) format
author | schloegl |
---|---|
date | Mon, 23 Aug 2010 21:02:33 +0000 |
parents | 7df85b226263 |
children | 03cd0c75b7ac |
rev | line source |
---|---|
6547 | 1 |
2 CC = gcc | |
3 CXX = g++ | |
6555 | 4 CFLAGS = -Wall -Wconversion -O3 -fPIC |
6547 | 5 OCTMEX = mkoctfile --mex |
3901 | 6 |
6555 | 7 MATLABDIR = /usr/local/matlab |
6556
d736430aaa42
PSVM improved/fixed; compilation of libsvm for matlab improved; silence libsvm
schloegl
parents:
6555
diff
changeset
|
8 MEX_OPTION = CC\#$(CXX) CXX\#$(CXX) CFLAGS\#"$(CFLAGS)" CXXFLAGS\#"$(CFLAGS)" |
6547 | 9 # comment the following line if you use MATLAB on 32-bit computer |
10 MEX_OPTION += -largeArrayDims | |
11 MATMEX = $(MATLABDIR)/bin/mex $(MEX_OPTION) | |
6560 | 12 |
13 | |
14 | |
7376
37789a34b615
add reading and writing of XPT (SAS Transport File) format
schloegl
parents:
7232
diff
changeset
|
15 PROGS = histo_mex.mex covm_mex.mex kth_element.mex sumskipnan_mex.mex str2array.mex train.mex svmtrain_mex.mex svmpredict_mex.mex xptopen.mex |
6547 | 16 |
6561 | 17 octave: $(PROGS) |
6560 | 18 |
19 MEX_EXT = $(shell $(MATLABDIR)/bin/mexext) | |
6563 | 20 matlab: $(patsubst %.mex, %.$(MEX_EXT), $(PROGS)) |
21 all: $(PROGS) $(patsubst %.mex, %.$(MEX_EXT), $(PROGS)) | |
3901 | 22 |
23 $(PROGS): Makefile | |
2414 | 24 |
25 %.oct: %.cc | |
26 mkoctfile $< | |
2968
e49fc39e8ee0
Add "clean" rules to makefiles and discard exit status
goffioul
parents:
2414
diff
changeset
|
27 |
6549 | 28 %.mex: %.cpp |
6547 | 29 $(OCTMEX) $< ## Octave |
6549 | 30 %.$(MEX_EXT): %.cpp |
6547 | 31 $(MATMEX) $< ## Matlab |
32 | |
6562 | 33 svmtrain_mex.mex svmpredict_mex.mex: svmtrain_mex.cpp svm.h svm.cpp svm_model_matlab.c |
6555 | 34 $(CXX) $(CFLAGS) -I /usr/include/octave -c svm.cpp |
6586 | 35 $(CC) $(CFLAGS) -I /usr/include/octave -c svm_model_matlab.c |
6549 | 36 env CC=$(CXX) $(OCTMEX) svmtrain_mex.cpp svm.o svm_model_matlab.o |
6554 | 37 env CC=$(CXX) $(OCTMEX) svmpredict_mex.cpp svm.o svm_model_matlab.o |
6549 | 38 |
6562 | 39 svmtrain_mex.$(MEX_EXT) svmpredict_mex.$(MEX_EXT): svmtrain_mex.cpp svm.h svm.cpp svm_model_matlab.c |
6555 | 40 $(CXX) $(CFLAGS) -I $(MATLABDIR)/extern/include -c svm.cpp |
6586 | 41 $(CC) $(CFLAGS) -I $(MATLABDIR)/extern/include -c svm_model_matlab.c |
6552
37ebea0d2428
build for octave must be the default, matlab build is optional
schloegl
parents:
6549
diff
changeset
|
42 $(MATMEX) svmtrain_mex.cpp svm.o svm_model_matlab.o |
6554 | 43 $(MATMEX) svmpredict_mex.cpp svm.o svm_model_matlab.o |
6547 | 44 |
6588 | 45 train.$(MEX_EXT) predict.$(MEX_EXT): train.c linear.h tron.o linear.o linear_model_matlab.c |
6563 | 46 $(CC) $(CFLAGS) -I $(MATLABDIR)/extern/include -c linear_model_matlab.c |
6588 | 47 $(MATMEX) -lblas train.c tron.o linear.o linear_model_matlab.o |
6563 | 48 #$(MATMEX) -lblas predict.c tron.o linear.o linear_model_matlab.o |
6560 | 49 |
6588 | 50 train.mex predict.mex: train.c linear.h tron.o linear.o linear_model_matlab.c |
6563 | 51 $(CC) $(CFLAGS) -I /usr/include/octave -c linear_model_matlab.c |
6588 | 52 env CC=$(CXX) $(OCTMEX) -lblas train.c tron.o linear.o linear_model_matlab.o |
6563 | 53 #env CC=$(CXX) $(OCTMEX) -lblas predict.c tron.o linear.o linear_model_matlab.o |
6560 | 54 |
55 linear.o: linear.cpp linear.h | |
56 $(CXX) $(CFLAGS) -c linear.cpp | |
57 | |
58 tron.o: tron.cpp tron.h | |
59 $(CXX) $(CFLAGS) -c tron.cpp | |
60 | |
61 | |
62 | |
6547 | 63 clean: ; -$(RM) *.o core octave-core *.oct *~ *.mex* |