88
99# Author: Jennifer Liddle <js10@sanger.ac.uk, jennifer@jsquared.co.uk>
1010#
11- # Redistribution and use in source and binary forms, with or without modification,
12- # are permitted provided that the following conditions are met:
13- # 1. Redistributions of source code must retain the above copyright notice, this
14- # list of conditions and the following disclaimer.
15- # 2. Redistributions in binary form must reproduce the above copyright notice,
16- # this list of conditions and the following disclaimer in the documentation and/or
17- # other materials provided with the distribution.
18- # 3. Neither the name of the Genome Research Ltd nor the names of its contributors
19- # may be used to endorse or promote products derived from software without specific
20- # prior written permission.
21- #
22- # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR WARRANTIES,
23- # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24- # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. EVENT SHALL GENOME RESEARCH LTD. BE LIABLE
25- # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26- # (INCLUDING, LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27- # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28- # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29- # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
30- # THE POSSIBILITY OF SUCH DAMAGE.
31- #
3211
33- INSTALLLIB =/software/varinf/lib
12+ # Redistribution and use in source and binary forms, with or without
13+ # modification, are permitted provided that the following conditions are met:
14+ # 1. Redistributions of source code must retain the above copyright notice,
15+ # this list of conditions and the following disclaimer.
16+ # 2. Redistributions in binary form must reproduce the above copyright
17+ # notice, this list of conditions and the following disclaimer in the
18+ # documentation and/or other materials provided with the distribution.
19+ # 3. Neither the name of Genome Research Ltd nor the names of the
20+ # contributors may be used to endorse or promote products derived from
21+ # software without specific prior written permission.
22+
23+ # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24+ # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25+ # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26+ # IN NO EVENT SHALL GENOME RESEARCH LTD. BE LIABLE FOR ANY DIRECT, INDIRECT,
27+ # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28+ # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
29+ # USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32+ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33+
34+
35+
36+ .PHONY : test # always run, regardless of timestamps
37+
38+ DIR = INSTALL_DIRECTORY # placeholder for main installation directory
39+ BIN=$(DIR ) /bin
40+ # default directories for g2i
41+ INSTALLLIB =/software/varinf/lib
3442INSTALLBIN =/software/varinf/bin
43+ # other useful paths
3544STLPORT_INC =/software/solexa/pkg/STLport/current/stlport
3645STLPORT_LIB =/software/solexa/pkg/STLport/current/build/lib/obj/gcc/so
3746# STLPORT_INC=/software/varinf/lib/STLport/include/stlport
3847# STLPORT_LIB=/software/varinf/lib/STLport/lib
3948PERL_CORE =/usr/lib/perl/5.8.8/CORE
4049PERL_CORE =/software/perl-5.8.8/lib/5.8.8/x86_64-linux-thread-multi/CORE
4150
42- TARGETS =libplinkbin.so gtc g2i b2i b2g gtc_process sim simtools
51+
52+ TARGETS =libplinkbin.so gtc g2i gtc_process sim simtools normalize_manifest
4353PERL_TARGETS =Gtc.so Sim.so
4454LIBS =Gtc.o win2unix.o Sim.o
4555
4656# To compile with debug information added, invoke as (say):
4757# make DEBUG='y'
4858# to build all targets with debug info.
4959# For just one target, say:
50- # make DEBUG='y' b2i
60+ # make DEBUG='y' simtools
5161
5262CC =/usr/bin/g++
5363
5464# do NOT use -ffast-math, as it causes errors in infinity/NaN handling
5565ifeq ($(DEBUG ) ,y)
56- CFLAGS=-g -Wall -fPIC -O0 -I$(STLPORT_INC)
66+ CFLAGS=-g -Wall -fPIC -O0 -I$(STLPORT_INC) -std=c++0x
5767else
58- CFLAGS=-Wall -fPIC -O3 -I$(STLPORT_INC)
68+ CFLAGS=-Wall -fPIC -O3 -I$(STLPORT_INC) -std=c++0x
5969endif
6070# Set runpath instead of relying on LD_LIBRARY_PATH
61- LDFLAGS =-Wl,-rpath -Wl,$(STLPORT_LIB ) -L$(STLPORT_LIB ) -lstlport -lm
71+ LDFLAGS =-Wl,-rpath -Wl,$(STLPORT_LIB ) -L$(STLPORT_LIB ) -lstlport -lm
72+ CXXFLAGS =-Wno-deprecated -I/software/gapi/pkg/cxxtest/4.2.1/
73+
74+ usage :
75+ @echo -e " Usage: make install DIR=<destination directory>\nOther targets: make all, make test, make install_g2i"
6276
63- default : all
6477
6578clean :
66- rm -f * .o Gtc_wrap.cxx Gtc.pm Sim_wrap.cxx Sim.pm $(TARGETS )
79+ rm -f * .o Gtc_wrap.cxx Gtc.pm Sim_wrap.cxx Sim.pm runner.cpp runner $(TARGETS )
80+
81+ test : Sim.o Gtc.o Manifest.o QC.o json/json_reader.o json/json_writer.o json/json_value.o commands.o runner.o
82+ $(CC ) $(CFLAGS ) $(LDFLAGS ) $(CXXFLAGS ) -o runner $^ -lstlport
83+ ./runner # run "./runner -v" to print trace information
6784
68- test :
69- run_tests
85+ runner.o : all
86+ cxxtestgen --error-printer -o runner.cpp test_simtools.h
87+ $(CC ) -c $(CFLAGS ) $(LDFLAGS ) $(CXXFLAGS ) -o $@ runner.cpp
7088
7189install : all
90+ install -d $(BIN )
91+ install g2i gtc normalize_manifest sim simtools $(BIN )
92+ @echo -e " Simtools successfully installed."
93+
94+ install_g2i : all
7295 cp Gtc.pm $(INSTALLLIB )
7396 cp Gtc.so $(INSTALLLIB )
7497 cp Sim.pm $(INSTALLLIB )
@@ -82,24 +105,24 @@ perl: $(PERL_TARGETS)
82105gtc : gtc.o Gtc.o Manifest.o
83106 $(CC ) $(LDFLAGS ) -o $@ $^ -lstlport
84107
108+ normalize_manifest : normalize_manifest.o Manifest.o
109+ $(CC ) $(LDFLAGS ) -o $@ $^ -lstlport
110+
85111sim : sim.o Sim.o
86112 $(CC ) $(LDFLAGS ) -o $@ $^ -lstlport
87113
88- simtools : simtools.o Sim.o Gtc.o Manifest.o QC.o json/json_reader.o json/json_writer.o json/json_value.o
114+ simtools : simtools.o commands.o Sim.o Gtc.o Manifest.o QC.o json/json_reader.o json/json_writer.o json/json_value.o
89115 $(CC ) $(LDFLAGS ) -o $@ $^ -lstlport
90116
117+ commands.o : commands.cpp
118+ $(CC ) -c $(CFLAGS ) $(CPPFLAGS ) -o $@ $<
119+
91120manifest : manifest.o Manifest.o
92121 $(CC ) $(LDFLAGS ) -o $@ $^ -lstlport
93122
94123g2i : g2i.o Gtc.o Manifest.o win2unix.o Sim.o json/json_reader.o json/json_writer.o json/json_value.o utilities.o plink_binary.o
95124 $(CC ) $(LDFLAGS ) -o $@ $^ -lstlport
96125
97- b2i : b2i.o Manifest.o b2base.o # "b2" code needs ssl library;
98- $(CC ) $(LDFLAGS ) -lssl -o $@ $^ -lstlport -lssl # pick this up from /usr/lib
99-
100- b2g : b2g.o Manifest.o b2base.o
101- $(CC ) $(LDFLAGS ) -lssl -o $@ $^ -lstlport -lssl # Ditto.
102-
103126gtc_process : Gtc.o Manifest.o gtc_process.o
104127 $(CC ) $(LDFLAGS ) -o $@ $^ -lstlport
105128
@@ -132,9 +155,6 @@ gtc.o: Gtc.h Manifest.h
132155sim.o : Sim.h
133156simtools.o : Sim.h
134157g2i.o : Gtc.h Manifest.h plink_binary.h
135- b2base.o : b2base.cpp
136- b2i.o : b2i.cpp Manifest.h
137- b2g.o : b2g.cpp Manifest.h
138158win2unix.o : win2unix.cpp win2unix.h
139159plink_binary.o : plink_binary.cpp plink_binary.h
140160
0 commit comments