Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 0e77850723
Fetching contributors…

Cannot retrieve contributors at this time

193 lines (155 sloc) 4.18 kb
# -*- makefile -*-
VERSION:=${shell cat VERSION}
#CXX:=g++-fsf-4.4 -m32
CXXFLAGS :=
#CXXFLAGS += -O3 -funroll-loops -fexpensive-optimizations -DNDEBUG
#CXXFLAGS += -ffast-math
#CXXFLAGS := -g3 -O0 -m32
CXXFLAGS :=
WARN := -Wall
WARN += -Wimplicit
#WARN += -pedantic # long long
WARN += -W
WARN += -Wredundant-decls
#WARN += -Werror
WARN += -Wmissing-prototypes
WARN += -Wunknown-pragmas
WARN += -Wunused
WARN += -Wunused
WARN += -Wendif-labels
#WARN += -Wnewline-eof
WARN += -Wno-sign-compare
WARN += -Wshadow
# Requires -O
WARN += -O -Wuninitialized
# Disabled warnings
#WARN+= -Weffc++
#WARN+= -Wunreachable-code
DEBUG:= -g3 -DDEBUG=1
#DEBUG+= -O0
#DEBUG+= -O
# DEBUG+= -D_GLIBCXX_DEBUG # Bad things on the mac? May be a gtest bug.
DEBUG+= -D_GLIBCXX_DEBUG_PEDANTIC -D_GLIBCPP_CONCEPT_CHECKS
OPT:= -O3 -funroll-loops -fexpensive-optimizations -ffast-math
OPT+= -DNDEBUG
ifdef OPTIMIZE
CXXFLAGS += ${OPT}
else
CXXFLAGS += ${DEBUG}
endif
CXXFLAGS += ${WARN}
#CFLAGS := ${CXXFLAGS}
SRCS := ais.cpp
SRCS += ais1_2_3.cpp ais4_11.cpp ais5.cpp
SRCS += ais6.cpp
SRCS += ais7_13.cpp
SRCS += ais8.cpp
# IMO Messages - Circ 289
SRCS += ais8_001_22.cpp # Area notice
# US Specific Messages
SRCS += ais8_366_22.cpp
#
SRCS += ais9.cpp ais10.cpp ais12.cpp
SRCS += ais14.cpp
#
SRCS += ais18.cpp ais19.cpp
#
SRCS += ais21.cpp
#
SRCS += ais24.cpp
OBJS := ${SRCS:.cpp=.o}
default:
@echo
@echo
@echo " Welcome to libais ${VERSION}"
@echo
@echo "Build options:"
@echo
@echo " clean - remove all objects and executables"
@echo " all - build everything"
@echo " tar - create a release source tar using VERSION"
@echo
@echo " python - build the python module"
@echo " libais.a - build a static archive library"
@echo " test_libais - Simple C++ library test"
@echo " python2 - build the python2.6 module"
@echo " python3 - build the python3.1 module"
@echo " nais2pg - Run the python 2.6 nais2pg.py program"
@echo
@echo " pull - update from github"
@echo " push - update github with local changes"
@echo
@echo "Read the README for more information"
all: python2 python3 libais.a test_libais
./test_libais
#ais.h: ais.h.in
# rm -f ais.h
# cmake -G "Unix Makefiles"
nais2pg:
make clean
make python2
PYTHONPATH=build/lib.macosx-10.6-i386-2.6 ./nais2pg.py -v -I datalogger1.ccom.nh
DIST:=libais-${shell cat VERSION}
TAR:=${DIST}.tar
tar:
rm -f ${TAR}.bz2 ${TAR}
rm -rf ${DIST}
mkdir ${DIST}
cp -p *.cpp *.h [A-Z]* *.py ${DIST}/
tar cf ${TAR} ${DIST}
bzip2 -9 ${TAR}
rm -rf ${DIST}
# Remove the NDEBUG that python tries to use
python2:
CFLAGS="-O3 -funroll-loops -fexpensive-optimizations -ffast-math" python setup.py build
# CFLAGS="-m32 -O0 -g -UNDEBUG" /sw/bin/python2.6 setup.py build
# -D_GLIBCXX_DEBUG This option does not seem to work for g++ versions 4.[0-2]
python3:
CFLAGS="-O0 -g -UNDEBUG" python3 setup.py build
libais.a: ${OBJS}
ls ${OBJS}
ar rv $@ $?
ranlib $@
clean:
-rm -rf *.o build *.a *.pyc test_libais
-rm -rf *.d *_unittest *.dSYM
#.cpp.o:
# ${CXX} -c $< ${CXXFLAGS}
test: test_libais
./test_libais
test_libais: ${OBJS} test_libais.cpp ais.h
@echo SRCS: ${SRCS}
@echo OBJS: ${OBJS}
${CXX} -o $@ ${OBJS} test_libais.cpp ${CXXFLAGS}
ais_decode_normed: ${OBJS} ais_decode_normed.o ais.h
@echo SRCS: ${SRCS}
@echo OBJS: ${OBJS}
${CXX} -o $@ ${OBJS} ais_decode_normed.o ${CXXFLAGS}
# Hard coded depends
ais.o: ais.h
ais123.o: ais.h
ais4_11.o: ais.h
ais5.o: ais.h
ais7_13.o: ais.h
ais8_001_22.o: ais.h
ais14.o: ais.h
ais18.o: ais.h
ais19.o: ais.h
ais_py.o: ais.h
test_libais.o: ais.h
test2: ais1_2_3_unittest ais8_001_22_unittest
#ais8_001_22_unittest
FINK:=/sw32
#LDFLAGS:=-L${FINK}/lib
GTESTFLAGS := ${shell gtest-config --cppflags --cxxflags --ldflags --libs}
ais8_001_22_unittest: ais8_001_22_unittest.cpp ais8_001_22.cpp ais.cpp ais8.cpp
${CXX} -m32 -g ${WARN} $^ -o $@ ${GTESTFLAGS} -lgtest_main -lpthread
./$@
ais1_2_3_unittest: ais1_2_3_unittest.cpp ais.cpp ais1_2_3.cpp
${CXX} -m32 -g ${WARN} $^ -o $@ ${GTESTFLAGS} -lgtest_main -lpthread
./$@
GIT_URL:=git@github.com:schwehr/libais.git
pull:
git pull ${GIT_URL}
push:
git push ${GIT_URL}
Jump to Line
Something went wrong with that request. Please try again.