-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
137 lines (102 loc) · 5.5 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
VERSION = 0.0-8
SRCDIR = fvfutil
LIBDIR = fvlib
TESTSDIR = tests
#DASRCDIR = DatABEL/src
BINDIR = bin
TEXT2FVF = $(BINDIR)/text2fvf
FV2TEXT = $(BINDIR)/fv2text
MERGEVARS = $(BINDIR)/mergevars
#RSHLIB = $(BINDIR)/filevector.so
READSPEED = $(BINDIR)/readspeed
CORRECTNESSTEST = $(BINDIR)/correctnesstest
ACCESSMODETEST = $(BINDIR)/accessmodetest
MODIFTEST = $(BINDIR)/modificationtest
CONVERTTEST = $(BINDIR)/converttest
CONVERT = $(BINDIR)/convert
WRITE_VAR_SPEED = $(BINDIR)/writevarspeed
TRANSPOSE = $(BINDIR)/transpose
BUILDTESTDATA = $(BINDIR)/buildtestdata
BUILDSUBMATRIX = $(BINDIR)/buildsubmatrix
UNITTEST = $(BINDIR)/unittest
TRANSPOSETEST = $(BINDIR)/transposetest
RFHTEST = $(BINDIR)/rfhtest
# GNU compiler
CPP = g++
# use for Solaris
# CPP = CC
CFLAGS = -I $(LIBDIR) -I $(SRCDIR) -g -Wall -D_NOT_R_FILEVECTOR #-m64
# Get the gcc version and check if the minor version number is above
# 7. Before gcc 4.7 the option for -std=c++11 was named -std=c++0x.
GCCVERSIONGTEQ47 := $(shell expr `gcc -dumpversion | cut -f2 -d.` \>= 7)
ifeq "$(GCCVERSIONGTEQ47)" "1"
CFLAGS += -std=c++11
else
CFLAGS += -std=c++0x
endif
CPPUNITFLAGS = -lcppunit
EXECS = $(TEXT2FVF) $(MERGEVARS) ${CONVERT}
LIBFILES = $(LIBDIR)/*.cpp $(LIBDIR)/*.h
REGFILES = $(SRCDIR)/usage.cpp $(SRCDIR)/usage.h
TESTSFILES = $(TESTSDIR)/*.cpp $(TESTSDIR)/*.h
BINARIES = converter text2fvf fv2text transpose writespeed # $(RSHLIB)
all: $(BINARIES)
$(BINARIES): | $(BINDIR)
$(BINDIR):
mkdir -p $(BINDIR)
text2fvf: $(TEXT2FVF)
$(TEXT2FVF): $(LIBFILES) $(REGFILES) $(SRCDIR)/text2fvf.cpp $(SRCDIR)/text2fvf_main.cpp $(SRCDIR)/usage.cpp $(SRCDIR)/text2fvf.h
$(CPP) $(CFLAGS) $(LIBDIR)/*.cpp $(SRCDIR)/usage.cpp $(SRCDIR)/text2fvf.cpp $(SRCDIR)/text2fvf_main.cpp -o $(TEXT2FVF)
fv2text: $(FV2TEXT)
$(FV2TEXT): $(LIBFILES) $(REGFILES) $(SRCDIR)/fv2text.cpp
$(CPP) $(CFLAGS) $(LIBDIR)/*.cpp $(SRCDIR)/fv2text.cpp -o $(FV2TEXT)
$(MERGEVARS): $(LIBFILES) $(REGFILES) $(SRCDIR)/mergevars.cpp
$(CPP) $(CFLAGS) $(LIBDIR)/*.cpp $(SRCDIR)/usage.cpp $(SRCDIR)/text2fvf.cpp $(SRCDIR)/mergevars.cpp -o $(MERGEVARS)
fvfutildis: clean
cd ..; tar cvf filevector_$(VERSION).tar filevector_$(VERSION); gzip filevector_$(VERSION).tar
DatABELdis: clean
cd ..; tar chvf DatABEL_$(VERSION).tar DatABEL_$(VERSION); gzip DatABEL_$(VERSION).tar
clean: tests-clean
rm -rf $(BINDIR)/* $(SRCDIR)/*.o $(LIBDIR)/*.o
correctnesstest : $(CORRECTNESSTEST)
$(CORRECTNESSTEST): $(LIBFILES) $(TESTFILES) $(TESTSDIR)/*.cpp $(TESTSDIR)/*.h
$(CPP) $(CFLAGS) $(LIBDIR)/*.cpp $(SRCDIR)/text2fvf.cpp $(TESTSDIR)/CorrectnessTest.cpp ${TESTSDIR}/TestUtil.cpp ${CPPUNITFLAGS} -o $(CORRECTNESSTEST); $(CORRECTNESSTEST)
readspeed : $(READSPEED)
$(READSPEED): $(LIBFILES) $(TESTFILES) $(TESTSDIR)/ReadSpeed.cpp
$(CPP) $(CFLAGS) $(LIBDIR)/*.cpp $(SRCDIR)/text2fvf.cpp $(TESTSDIR)/ReadSpeed.cpp -o $(READSPEED)
modificationtest : $(MODIFTEST)
$(MODIFTEST): $(LIBFILES) $(TESTFILES) $(TESTSDIR)/FileModificationTest.*
$(CPP) $(CFLAGS) $(SRCDIR)/text2fvf.cpp $(LIBDIR)/*.cpp $(TESTSDIR)/TestUtil.cpp $(TESTSDIR)/FileModificationTest.cpp $(CPPUNITFLAGS) -o $(MODIFTEST); $(MODIFTEST)
unittest : $(UNITTEST)
$(UNITTEST): $(LIBFILES) $(TESTFILES) $(TESTSDIR)/TestUtil.* $(TESTSDIR)/UnitTest.*
$(CPP) $(CFLAGS) $(SRCDIR)/text2fvf.cpp $(LIBDIR)/*.cpp $(TESTSDIR)/TestUtil.cpp $(TESTSDIR)/UnitTest.cpp $(CPPUNITFLAGS) -o $(UNITTEST); $(UNITTEST)
transposetest: $(TRANSPOSETEST)
$(TRANSPOSETEST): $(LIBFILES) $(TESTFILES) $(TESTSDIR)/TransposeTest.cpp
$(CPP) $(CFLAGS) $(SRCDIR)/text2fvf.cpp $(LIBDIR)/*.cpp $(TESTSDIR)/TestUtil.cpp $(TESTSDIR)/TransposeTest.cpp $(CPPUNITFLAGS) -o $(TRANSPOSETEST); $(TRANSPOSETEST)
rfhtest: $(RFHTEST)
$(RFHTEST): $(LIBFILES) $(TESTFILES) $(TESTSDIR)/ReusableFileHandleTest.cpp
$(CPP) $(CFLAGS) $(LIBDIR)/*.cpp $(TESTSDIR)/TestUtil.cpp $(TESTSDIR)/ReusableFileHandleTest.cpp $(CPPUNITFLAGS) -o $(RFHTEST); $(RFHTEST)
converter : $(CONVERT)
$(CONVERT): $(LIBFILES) $(SRCDIR)/convert.cpp
$(CPP) $(CFLAGS) $(LIBDIR)/*.cpp $(SRCDIR)/text2fvf.cpp $(SRCDIR)/convert.cpp $(CPPUNITFLAGS) -o $(CONVERT)
transpose :$(TRANSPOSE)
$(TRANSPOSE) : $(LIBFILES) $(SRCDIR)/transpose_main.cpp
$(CPP) $(CFLAGS) $(LIBDIR)/*.cpp $(SRCDIR)/text2fvf.cpp $(SRCDIR)/transpose_main.cpp -o $(TRANSPOSE)
writespeed : $(WRITE_VAR_SPEED)
$(WRITE_VAR_SPEED): $(LIBFILES) $(SRCDIR)/convert.cpp
$(CPP) $(CFLAGS) $(LIBDIR)/*.cpp $(SRCDIR)/text2fvf.cpp $(TESTSDIR)/WriteVariablesSpeed.cpp $(CPPUNITFLAGS) -o $(WRITE_VAR_SPEED)
accessmodetest : $(ACCESSMODETEST)
$(ACCESSMODETEST): $(LIBFILES) $(TESTFILES) $(TESTSDIR)/AccessModeTest.cpp
$(CPP) $(CFLAGS) $(LIBDIR)/*.cpp $(SRCDIR)/text2fvf.cpp $(TESTSDIR)/TestUtil.cpp $(TESTSDIR)/AccessModeTest.cpp $(CPPUNITFLAGS) -o $(ACCESSMODETEST); $(ACCESSMODETEST)
converttest : $(CONVERTTEST)
$(CONVERTTEST):$(LIBFILES) $(TESTFILES) $(TESTSDIR)/ConvertTest.cpp
$(CPP) $(CFLAGS) $(LIBDIR)/*.cpp $(SRCDIR)/text2fvf.cpp $(TESTSDIR)/TestUtil.cpp $(TESTSDIR)/ConvertTest.cpp $(CPPUNITFLAGS) -o $(CONVERTTEST); $(CONVERTTEST)
buildtestdata : $(BUILDTESTDATA)
$(BUILDTESTDATA):$(TESTSDIR)/BuildTestData.cpp $(LIBDIR)/*.cpp $(LIBDIR)/*.h
$(CPP) $(CFLAGS) $(TESTSDIR)/BuildTestData.cpp $(LIBDIR)/*.cpp $(CPPUNITFLAGS) -o $(BUILDTESTDATA)
preparetestdata: buildtestdata
$(BUILDTESTDATA) tests/data/correctnessTestData 33815 1473 100 120; $(BUILDTESTDATA) tests/data/2write/modify_me 1001 1003;
tests : preparetestdata correctnesstest readspeed modificationtest unittest writespeed accessmodetest converttest transposetest
runtests : tests
tests-clean:
rm -rf tests/data/2write/* tests/data/modetests/* tests/data/correctnessTestData.*