Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative build system #15

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
1e1b7b3
Add simple, portable Makefiles
Dec 8, 2016
03d1a97
Clean up makefiles
Dec 8, 2016
c4a5f52
Get processor arch from uname
outpaddling Dec 8, 2016
3210ff5
Add top level Makefile.simple
Dec 8, 2016
cd9e67a
GNU make compatible ARCH assignment
outpaddling Dec 8, 2016
41e6555
Portable ARCH variable setting in Makefile.simple
Dec 8, 2016
cf2b7cb
Add partial install target
outpaddling Dec 23, 2016
e30aa8d
Makefile.simple : Add INSTALL default
outpaddling Dec 23, 2016
1326b27
Fix install target
outpaddling Dec 23, 2016
12d5586
Save output of original build system for comparison
outpaddling Dec 31, 2016
50a4d56
build.simple : Script for recording platform-specific build parameters
outpaddling Jan 1, 2017
6b2f9e2
Makefile.simple : Remove destdir in clean target
outpaddling Jan 1, 2017
9c363a9
Makefile.simple : Add dynamic libs
outpaddling Jan 4, 2017
2d768d0
Makefile.simple : Add header install
outpaddling Jan 4, 2017
9e972cd
Add plist from original build system
outpaddling Jan 4, 2017
74e1507
Makefile.simple : Finish header install
outpaddling Jan 4, 2017
c1eb7fe
Makefile.simple : Beginnings of java jar builder
outpaddling Jan 4, 2017
d49b6fb
Makefile.simple : Add ngs-java dir
outpaddling Jan 4, 2017
f1e04c1
ngs-java/Makefile.simple : Add clean target
outpaddling Jan 4, 2017
8270357
ngs-java/Makefile.simple : Finish jar builder
outpaddling Jan 4, 2017
d9e22b1
Makefile.simple : Add jar install
outpaddling Jan 4, 2017
4c78c8a
Clean up
outpaddling Jan 4, 2017
4269d33
adapter/Makefile.simple: Avoid using OS, which is set by pkgsrc
outpaddling Jan 4, 2017
3605977
OS X dylib support
outpaddling Jan 4, 2017
de124b7
Clean up dylibs
outpaddling Jan 4, 2017
f49bf36
Move shared object vars to top level Makefile for install target
outpaddling Jan 4, 2017
fbc8f43
Clean up
outpaddling Jan 4, 2017
f9c68da
Fix shared object name passing
outpaddling Jan 4, 2017
cab8992
Clean up
outpaddling Jan 4, 2017
0613141
Document Makefile.simple
outpaddling Jan 4, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions Makefile.simple
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
############################################################################
#
# Simple, portable Makefile for POSIX platforms.
#
# Author: J. Bacon
#
# This Makefile and it's children provide a simple and portable way to
# build NGS on POSIX platforms. It was originally tested with BSD and GNU
# make on CentOS Linux, FreeBSD, Mac OS X, and NetBSD.
#
# The associated build.simple script can be used to invoke make more
# easily and provide flags for not-quite-standard systems such as OS X.
#
# LICENSE: Public Domain
#
# Variables that are conditionally assigned (with ?=) can be overridden
# via the command line as follows:
#
# make VAR=value
#
# For example, MacPorts installs to /opt/local instead of the default
# /usr/local, and hence might use the following:
#
# make PREFIX=/opt/local
#
# Different systems may also use different compilers and keep libraries in
# different locations:
#
# make CC=gcc CFLAGS=-O2 LDFLAGS="-L/usr/X11R6 -lX11"
#
# Variables can also inheret values from parent Makefiles (as in *BSD ports).
#
# Lastly, they can be overridden by the environment, e.g.
#
# setenv CFLAGS "-O -Wall -pipe"
# make
#
# All these override methods allow the Makefile to respect the environment
# in which it is used.
#
# You can append values to variables within this Makefile (with +=).
# However, this should not be used to add compiler-specific flags like
# -Wall, as this would disrespect the environment.
############################################################################

MAKE ?= make
DIRS = ngs-sdk ngs-java

MKDIR ?= mkdir
INSTALL ?= install
RM ?= rm

PREFIX ?= /usr/local
DESTDIR ?= ./stage

# Defaults for most Unix. Override for OS X dylibs.
# Some make implementations do not pass local make variables to child processes
# by default, so pass SO_NAME, etc. manually for portability.
SO_EXT ?= so
SO_MAJ = 1
SO_MIN = 3
SO_REV = 0
SO_VER = ${SO_MAJ}.${SO_MIN}.${SO_REV}
SO_NAME ?= libngs-sdk.${SO_EXT}.${SO_VER}
SO_SHORT_NAME ?= libngs-sdk.${SO_EXT}.${SO_MAJ}
SO_FLAGS ?= -Wl,-soname=libngs-sdk.${SO_EXT}.${SO_MAJ}

all:
@for dir in ${DIRS}; do \
${MAKE} -C $$dir -f Makefile.simple \
SO_NAME=${SO_NAME} SO_SHORT_NAME=${SO_SHORT_NAME} \
SO_FLAGS=${SO_FLAGS} SO_EXT=${SO_EXT}; \
done

clean:
@for dir in ${DIRS}; do \
${MAKE} -C $$dir -f Makefile.simple clean; \
done
${RM} -rf ${DESTDIR}

install: all
${MKDIR} -p ${DESTDIR}${PREFIX}/lib
${INSTALL} -c ngs-sdk/*/*.a ngs-sdk/language/*/*.a \
${DESTDIR}${PREFIX}/lib
${INSTALL} -c ngs-sdk/*.${SO_EXT}* ${DESTDIR}${PREFIX}/lib
${MKDIR} -p ${DESTDIR}${PREFIX}/include/ngs/adapter \
${DESTDIR}${PREFIX}/include/ngs/inl \
${DESTDIR}${PREFIX}/include/ngs/itf \
${DESTDIR}${PREFIX}/include/ngs/unix/`uname -p`
${INSTALL} -c ngs-sdk/ngs/*.hpp ${DESTDIR}${PREFIX}/include/ngs
${INSTALL} -c ngs-sdk/ngs/adapter/*.hpp ngs-sdk/ngs/adapter/*.h \
${DESTDIR}${PREFIX}/include/ngs/adapter
${INSTALL} -c ngs-sdk/ngs/inl/*.hpp ${DESTDIR}${PREFIX}/include/ngs/inl
${INSTALL} -c ngs-sdk/ngs/itf/*.hpp ngs-sdk/ngs/itf/*.h \
${DESTDIR}${PREFIX}/include/ngs/itf
${INSTALL} -c ngs-sdk/ngs/unix/`uname -p`/*.h \
${DESTDIR}${PREFIX}/include/ngs/unix/`uname -p`
${MKDIR} -p ${DESTDIR}${PREFIX}/share/java/classes
${INSTALL} -c ngs-java/ngs-java.jar \
${DESTDIR}${PREFIX}/share/java/classes
25 changes: 25 additions & 0 deletions build.simple
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh -e

# Note:
# This script is only for recording platform-specific flags.
# Makefile.simple should not depend on this script.
# You can simple run
#
# make -f Makefile.simple CXX=...

# Default case below works for FreeBSD, Linux, and Mac.
# If another platform requires special compiler flags, add a case.

case `uname` in
Darwin)
# FIXME: Not sure about the best SO_FLAGS
export CXXFLAGS='-g -O -fPIC'
export SO_EXT=dylib
export SO_FLAGS=''
;;
*)
export CXXFLAGS='-g -O -fPIC'
;;
esac

make -f Makefile.simple $@
92 changes: 92 additions & 0 deletions ngs-java/Makefile.simple
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@

BIN = ngs-java.jar

RM ?= rm

all: ${BIN}

${BIN}: ngs/*.java
javac \
ngs/ErrorMsg.java \
ngs/Statistics.java \
ngs/Fragment.java \
ngs/FragmentIterator.java \
ngs/Read.java \
ngs/ReadIterator.java \
ngs/ReadGroup.java \
ngs/ReadGroupIterator.java \
ngs/Alignment.java \
ngs/AlignmentIterator.java \
ngs/PileupEvent.java \
ngs/PileupEventIterator.java \
ngs/Pileup.java \
ngs/PileupIterator.java \
ngs/Reference.java \
ngs/ReferenceIterator.java \
ngs/ReadCollection.java \
ngs/Package.java \
-d . -classpath . -sourcepath .:itf:
javac \
ngs/itf/Refcount.java \
ngs/itf/StatisticsItf.java \
ngs/itf/FragmentItf.java \
ngs/itf/FragmentIteratorItf.java \
ngs/itf/ReadItf.java \
ngs/itf/ReadIteratorItf.java \
ngs/itf/ReadGroupItf.java \
ngs/itf/ReadGroupIteratorItf.java \
ngs/itf/AlignmentItf.java \
ngs/itf/AlignmentIteratorItf.java \
ngs/itf/PileupEventItf.java \
ngs/itf/PileupEventIteratorItf.java \
ngs/itf/PileupItf.java \
ngs/itf/PileupIteratorItf.java \
ngs/itf/ReferenceItf.java \
ngs/itf/ReferenceIteratorItf.java \
ngs/itf/ReadCollectionItf.java \
-d . -classpath . -sourcepath .:itf:
javac \
gov/nih/nlm/ncbi/ngs/DownloadManager.java \
gov/nih/nlm/ncbi/ngs/FileCreator.java \
gov/nih/nlm/ncbi/ngs/HttpManager.java \
gov/nih/nlm/ncbi/ngs/LibDependencies.java \
gov/nih/nlm/ncbi/ngs/LibManager.java \
gov/nih/nlm/ncbi/ngs/LibPathIterator.java \
gov/nih/nlm/ncbi/ngs/LibVersionChecker.java \
gov/nih/nlm/ncbi/ngs/LMProperties.java \
gov/nih/nlm/ncbi/ngs/Logger.java \
gov/nih/nlm/ncbi/ngs/Manager.java \
gov/nih/nlm/ncbi/ngs/NGS.java \
gov/nih/nlm/ncbi/ngs/Version.java \
gov/nih/nlm/ncbi/ngs/error/LibraryLoadError.java \
gov/nih/nlm/ncbi/ngs/error/LibraryNotFoundError.java \
gov/nih/nlm/ncbi/ngs/error/LibraryIncompatibleVersionError.java \
gov/nih/nlm/ncbi/ngs/error/cause/ConnectionProblemCause.java \
gov/nih/nlm/ncbi/ngs/error/cause/DownloadDisabledCause.java \
gov/nih/nlm/ncbi/ngs/error/cause/InvalidLibraryCause.java \
gov/nih/nlm/ncbi/ngs/error/cause/JvmErrorCause.java \
gov/nih/nlm/ncbi/ngs/error/cause/LibraryLoadCause.java \
gov/nih/nlm/ncbi/ngs/error/cause/OutdatedJarCause.java \
gov/nih/nlm/ncbi/ngs/error/cause/PrereleaseReqLibCause.java \
gov/nih/nlm/ncbi/ngs/error/cause/UnsupportedArchCause.java \
-d . -classpath . -sourcepath .:itf:
jar cf ngs-java.jar `find . -name "*.class"` || ( ${RM} -f ngs-java.jar && false )
javac \
examples/examples/AlignTest.java \
examples/examples/AlignSliceTest.java \
examples/examples/FragTest.java \
examples/examples/PileupTest.java \
examples/examples/RefTest.java \
examples/examples/ReadGroupTest.java \
-d . -classpath . -sourcepath .:itf:gov/nih/nlm/ncbi/ngs
jar cf `find examples -name "*.class"` || ( ${RM} -f ngs-examples.jar && false )

clean:
${RM} -f \
ngs/*.class \
ngs/itf/*.class \
examples/*.class \
gov/nih/nlm/ncbi/ngs/*.class \
gov/nih/nlm/ncbi/ngs/error/*.class \
gov/nih/nlm/ncbi/ngs/error/cause/*.class \
*.jar
20 changes: 20 additions & 0 deletions ngs-sdk/Makefile.simple
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

MAKE ?= make
DIRS = adapter dispatch language
LN ?= ln
RM ?= rm

all:
for dir in ${DIRS}; do \
${MAKE} -C $$dir -f Makefile.simple ARCH=`uname -p`; \
done
${CXX} -shared -o ${SO_NAME} ${SO_FLAGS} \
*/*.o -L./dispatch -lngs-disp
${LN} -f ${SO_NAME} ${SO_SHORT_NAME}
${LN} -f ${SO_NAME} libngs-sdk.${SO_EXT}

clean:
for dir in ${DIRS}; do \
${MAKE} -C $$dir -f Makefile.simple clean; \
done
${RM} -f libngs-sdk.*
119 changes: 119 additions & 0 deletions ngs-sdk/adapter/Makefile.depend
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
AlignmentItf.o: AlignmentItf.cpp ../ngs/adapter/AlignmentItf.hpp \
../ngs/adapter/FragmentItf.hpp ../ngs/adapter/Refcount.hpp \
../ngs/itf/Refcount.h ../ngs/itf/VTable.h ../ngs/itf/defs.h \
../ngs/adapter/defs.h ../ngs/unix/x86_64/atomic32.h \
../ngs/itf/FragmentItf.h ../ngs/itf/AlignmentItf.h \
../ngs/adapter/StringItf.hpp ../ngs/itf/StringItf.h \
../ngs/adapter/ErrorMsg.hpp ErrBlock.hpp ../ngs/itf/ErrBlock.h
${CXX} -c ${CXXFLAGS} AlignmentItf.cpp

ErrBlock.o: ErrBlock.cpp ErrBlock.hpp ../ngs/adapter/ErrorMsg.hpp \
../ngs/itf/ErrBlock.h ../ngs/itf/defs.h
${CXX} -c ${CXXFLAGS} ErrBlock.cpp

ErrorMsg.o: ErrorMsg.cpp ../ngs/adapter/ErrorMsg.hpp
${CXX} -c ${CXXFLAGS} ErrorMsg.cpp

FragmentItf.o: FragmentItf.cpp ../ngs/adapter/FragmentItf.hpp \
../ngs/adapter/Refcount.hpp ../ngs/itf/Refcount.h ../ngs/itf/VTable.h \
../ngs/itf/defs.h ../ngs/adapter/defs.h ../ngs/unix/x86_64/atomic32.h \
../ngs/itf/FragmentItf.h ../ngs/adapter/StringItf.hpp \
../ngs/itf/StringItf.h ../ngs/adapter/ErrorMsg.hpp ErrBlock.hpp \
../ngs/itf/ErrBlock.h
${CXX} -c ${CXXFLAGS} FragmentItf.cpp

PileupEventItf.o: PileupEventItf.cpp ../ngs/adapter/PileupEventItf.hpp \
../ngs/adapter/Refcount.hpp ../ngs/itf/Refcount.h ../ngs/itf/VTable.h \
../ngs/itf/defs.h ../ngs/adapter/defs.h ../ngs/unix/x86_64/atomic32.h \
../ngs/itf/PileupEventItf.h ../ngs/adapter/StringItf.hpp \
../ngs/itf/StringItf.h ../ngs/adapter/AlignmentItf.hpp \
../ngs/adapter/FragmentItf.hpp ../ngs/itf/FragmentItf.h \
../ngs/itf/AlignmentItf.h ../ngs/adapter/ErrorMsg.hpp ErrBlock.hpp \
../ngs/itf/ErrBlock.h
${CXX} -c ${CXXFLAGS} PileupEventItf.cpp

PileupItf.o: PileupItf.cpp ../ngs/adapter/PileupItf.hpp \
../ngs/adapter/PileupEventItf.hpp ../ngs/adapter/Refcount.hpp \
../ngs/itf/Refcount.h ../ngs/itf/VTable.h ../ngs/itf/defs.h \
../ngs/adapter/defs.h ../ngs/unix/x86_64/atomic32.h \
../ngs/itf/PileupEventItf.h ../ngs/itf/PileupItf.h \
../ngs/adapter/StringItf.hpp ../ngs/itf/StringItf.h \
../ngs/adapter/ErrorMsg.hpp ErrBlock.hpp ../ngs/itf/ErrBlock.h
${CXX} -c ${CXXFLAGS} PileupItf.cpp

ReadCollectionItf.o: ReadCollectionItf.cpp \
../ngs/adapter/ReadCollectionItf.hpp ../ngs/adapter/Refcount.hpp \
../ngs/itf/Refcount.h ../ngs/itf/VTable.h ../ngs/itf/defs.h \
../ngs/adapter/defs.h ../ngs/unix/x86_64/atomic32.h \
../ngs/itf/ReadCollectionItf.h ../ngs/adapter/StringItf.hpp \
../ngs/itf/StringItf.h ../ngs/adapter/ReadGroupItf.hpp \
../ngs/itf/ReadGroupItf.h ../ngs/adapter/ReferenceItf.hpp \
../ngs/itf/ReferenceItf.h ../ngs/adapter/AlignmentItf.hpp \
../ngs/adapter/FragmentItf.hpp ../ngs/itf/FragmentItf.h \
../ngs/itf/AlignmentItf.h ../ngs/adapter/ReadItf.hpp \
../ngs/itf/ReadItf.h ../ngs/adapter/ErrorMsg.hpp ErrBlock.hpp \
../ngs/itf/ErrBlock.h
${CXX} -c ${CXXFLAGS} ReadCollectionItf.cpp

ReadGroupItf.o: ReadGroupItf.cpp ../ngs/adapter/ReadGroupItf.hpp \
../ngs/adapter/Refcount.hpp ../ngs/itf/Refcount.h ../ngs/itf/VTable.h \
../ngs/itf/defs.h ../ngs/adapter/defs.h ../ngs/unix/x86_64/atomic32.h \
../ngs/itf/ReadGroupItf.h ../ngs/adapter/StringItf.hpp \
../ngs/itf/StringItf.h ../ngs/adapter/StatisticsItf.hpp \
../ngs/itf/StatisticsItf.h ../ngs/adapter/ErrorMsg.hpp ErrBlock.hpp \
../ngs/itf/ErrBlock.h
${CXX} -c ${CXXFLAGS} ReadGroupItf.cpp

ReadItf.o: ReadItf.cpp ../ngs/adapter/ReadItf.hpp \
../ngs/adapter/FragmentItf.hpp ../ngs/adapter/Refcount.hpp \
../ngs/itf/Refcount.h ../ngs/itf/VTable.h ../ngs/itf/defs.h \
../ngs/adapter/defs.h ../ngs/unix/x86_64/atomic32.h \
../ngs/itf/FragmentItf.h ../ngs/itf/ReadItf.h \
../ngs/adapter/StringItf.hpp ../ngs/itf/StringItf.h \
../ngs/adapter/ErrorMsg.hpp ErrBlock.hpp ../ngs/itf/ErrBlock.h
${CXX} -c ${CXXFLAGS} ReadItf.cpp

Refcount.o: Refcount.cpp ../ngs/adapter/Refcount.hpp \
../ngs/itf/Refcount.h ../ngs/itf/VTable.h ../ngs/itf/defs.h \
../ngs/adapter/defs.h ../ngs/unix/x86_64/atomic32.h \
../ngs/adapter/StringItf.hpp ../ngs/itf/StringItf.h \
../ngs/adapter/ErrorMsg.hpp ErrBlock.hpp ../ngs/itf/ErrBlock.h
${CXX} -c ${CXXFLAGS} Refcount.cpp

ReferenceItf.o: ReferenceItf.cpp ../ngs/adapter/ReferenceItf.hpp \
../ngs/adapter/Refcount.hpp ../ngs/itf/Refcount.h ../ngs/itf/VTable.h \
../ngs/itf/defs.h ../ngs/adapter/defs.h ../ngs/unix/x86_64/atomic32.h \
../ngs/itf/ReferenceItf.h ../ngs/adapter/StringItf.hpp \
../ngs/itf/StringItf.h ../ngs/adapter/StatisticsItf.hpp \
../ngs/itf/StatisticsItf.h ../ngs/adapter/AlignmentItf.hpp \
../ngs/adapter/FragmentItf.hpp ../ngs/itf/FragmentItf.h \
../ngs/itf/AlignmentItf.h ../ngs/adapter/PileupItf.hpp \
../ngs/adapter/PileupEventItf.hpp ../ngs/itf/PileupEventItf.h \
../ngs/itf/PileupItf.h ../ngs/adapter/ErrorMsg.hpp ErrBlock.hpp \
../ngs/itf/ErrBlock.h
${CXX} -c ${CXXFLAGS} ReferenceItf.cpp

ReferenceSequenceItf.o: ReferenceSequenceItf.cpp \
../ngs/adapter/ReferenceSequenceItf.hpp ../ngs/adapter/Refcount.hpp \
../ngs/itf/Refcount.h ../ngs/itf/VTable.h ../ngs/itf/defs.h \
../ngs/adapter/defs.h ../ngs/unix/x86_64/atomic32.h \
../ngs/itf/ReferenceSequenceItf.h ../ngs/adapter/StringItf.hpp \
../ngs/itf/StringItf.h ../ngs/adapter/ErrorMsg.hpp ErrBlock.hpp \
../ngs/itf/ErrBlock.h
${CXX} -c ${CXXFLAGS} ReferenceSequenceItf.cpp

StatisticsItf.o: StatisticsItf.cpp ../ngs/adapter/StatisticsItf.hpp \
../ngs/adapter/Refcount.hpp ../ngs/itf/Refcount.h ../ngs/itf/VTable.h \
../ngs/itf/defs.h ../ngs/adapter/defs.h ../ngs/unix/x86_64/atomic32.h \
../ngs/itf/StatisticsItf.h ../ngs/adapter/StringItf.hpp \
../ngs/itf/StringItf.h ../ngs/adapter/ErrorMsg.hpp ErrBlock.hpp \
../ngs/itf/ErrBlock.h
${CXX} -c ${CXXFLAGS} StatisticsItf.cpp

StringItf.o: StringItf.cpp ../ngs/adapter/StringItf.hpp \
../ngs/adapter/Refcount.hpp ../ngs/itf/Refcount.h ../ngs/itf/VTable.h \
../ngs/itf/defs.h ../ngs/adapter/defs.h ../ngs/unix/x86_64/atomic32.h \
../ngs/itf/StringItf.h ../ngs/adapter/ErrorMsg.hpp ErrBlock.hpp \
../ngs/itf/ErrBlock.h
${CXX} -c ${CXXFLAGS} StringItf.cpp

Loading