From 372d8dbe170c435874499c4080c1fbbfb65b4887 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 5 Jul 2017 13:42:18 -0700 Subject: [PATCH 1/6] Added an OSX makefile --- Makefile.mac | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 Makefile.mac diff --git a/Makefile.mac b/Makefile.mac new file mode 100644 index 0000000..956def2 --- /dev/null +++ b/Makefile.mac @@ -0,0 +1,8 @@ +include Makefile + +CC=clang++ +#CXXFLAGS=-stdlib=libstdc++ +#CPPFAGS=-stdlib=libstdc++ +COPTS=-fPIC -O2 -m64 -Wall -stdlib=libc++ -std=c++11 +LDOPTS=-shared -Wl,-install_name,$(LIBRARY) +INSTDIR=$(PWD)/mac From c3c192aa75342eb4e7e68ba6ed3d3141a746cbd5 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 5 Jul 2017 20:25:04 -0700 Subject: [PATCH 2/6] rpath working on OS X --- Makefile.mac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.mac b/Makefile.mac index 956def2..318776e 100644 --- a/Makefile.mac +++ b/Makefile.mac @@ -4,5 +4,5 @@ CC=clang++ #CXXFLAGS=-stdlib=libstdc++ #CPPFAGS=-stdlib=libstdc++ COPTS=-fPIC -O2 -m64 -Wall -stdlib=libc++ -std=c++11 -LDOPTS=-shared -Wl,-install_name,$(LIBRARY) +LDOPTS=-dynamiclib -Wl,-install_name,@rpath/$(LIBRARY) INSTDIR=$(PWD)/mac From 2f341cc46cb5de8a8ccbc68a99b5807fefda99d3 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 2 Aug 2017 15:22:50 -0700 Subject: [PATCH 3/6] Overriding .so on lib ext --- Makefile.mac | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile.mac b/Makefile.mac index 318776e..c2ba658 100644 --- a/Makefile.mac +++ b/Makefile.mac @@ -3,6 +3,9 @@ include Makefile CC=clang++ #CXXFLAGS=-stdlib=libstdc++ #CPPFAGS=-stdlib=libstdc++ + +LIBRARY=$(LIBNAME).dylib.$(LIBVERSION) + COPTS=-fPIC -O2 -m64 -Wall -stdlib=libc++ -std=c++11 LDOPTS=-dynamiclib -Wl,-install_name,@rpath/$(LIBRARY) INSTDIR=$(PWD)/mac From a2347fd98c4543482c0a638e9b99c3bfff38f0b7 Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 2 Aug 2017 20:07:07 -0700 Subject: [PATCH 4/6] Fixes OSX build via conda --- Makefile.mac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile.mac b/Makefile.mac index c2ba658..9db406f 100644 --- a/Makefile.mac +++ b/Makefile.mac @@ -1,11 +1,12 @@ include Makefile CC=clang++ -#CXXFLAGS=-stdlib=libstdc++ -#CPPFAGS=-stdlib=libstdc++ LIBRARY=$(LIBNAME).dylib.$(LIBVERSION) COPTS=-fPIC -O2 -m64 -Wall -stdlib=libc++ -std=c++11 LDOPTS=-dynamiclib -Wl,-install_name,@rpath/$(LIBRARY) INSTDIR=$(PWD)/mac + +install:: + $(RM) $(INSTDIR)/lib/$(LIBNAME).so && $(LN) $(LIBRARY) $(INSTDIR)/lib/$(LIBNAME).dylib From 21720122a29422c430eb018ccb957569eec3061f Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 8 Nov 2017 09:55:18 -0700 Subject: [PATCH 5/6] Updates to makefile --- Makefile.linux64 | 5 +++-- Makefile.win32 | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile.linux64 b/Makefile.linux64 index 3a3bc2a..1503c87 100644 --- a/Makefile.linux64 +++ b/Makefile.linux64 @@ -1,6 +1,7 @@ include Makefile CC=g++ -COPTS=-fPIC -O2 -m64 -Wall -LDOPTS=-shared -Wl,-soname,$(LIBRARY) +#CXXFLAGS=-std=c++11 +COPTS=-fPIC -O2 -m64 -Wall -std=c++11 -c +LDOPTS=-shared -Wl,-install_name,$(LIBRARY) INSTDIR=$(PWD)/linux64 diff --git a/Makefile.win32 b/Makefile.win32 index 6ef3557..cd0593c 100644 --- a/Makefile.win32 +++ b/Makefile.win32 @@ -11,7 +11,7 @@ LIBRARY=$(LIBNAME).dll INSTDIR=$(PWD)/win32 -all: $(LIBRARY) +all: $(HEADERS) $(LIBRARY) %.o: %.cpp $(CC) -c $(COPTS) $< -Fo$@ @@ -26,6 +26,6 @@ $(LIBRARY): $(OBJS) install:: $(RM) $(INSTDIR)/lib/$(LIBNAME).so $(CP) $(LIBRARY:%.dll=%.lib) $(INSTDIR)/lib - + $(CP) $(HEADERS) $(INSTDIR)/include/csm clean:: $(RM) $(LIBRARY).manifest $(LIBRARY:%.dll=%.ldf) $(LIBRARY:%.dll=%.lib) $(LIBRARY:%.dll=%.exp) From 033ceb0bf064ad753946d224eac7a42058e7a84c Mon Sep 17 00:00:00 2001 From: Jay Date: Wed, 8 Nov 2017 12:57:30 -0700 Subject: [PATCH 6/6] Updates to the mac makefile --- Makefile | 6 +++--- Makefile.mac | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9ae0d29..05a62ed 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,3 @@ - - HEADERS = csm.h Error.h Warning.h Version.h Isd.h BytestreamIsd.h NitfIsd.h Plugin.h Model.h GeometricModel.h RasterGM.h CorrelationModel.h FourParameterCorrelationModel.h LinearDecayCorrelationModel.h OBJS = Version.o Plugin.o GeometricModel.o RasterGM.o CorrelationModel.o FourParameterCorrelationModel.o LinearDecayCorrelationModel.o Isd.o @@ -27,7 +25,9 @@ LD=$(CC) $(CC) -c $(COPTS) $< -o $@ $(LIBRARY): $(OBJS) - $(LD) $(COPTS) $(LDOPTS) $^ $(LIBS) -o $@ + @echo $(LIBRARY) + @echo $@ + $(LD) $(COPTS) $(LDOPTS) $^ $(LIBS) -o $(LIBRARY) all: $(HEADERS) $(LIBRARY) diff --git a/Makefile.mac b/Makefile.mac index 9db406f..c06b3cf 100644 --- a/Makefile.mac +++ b/Makefile.mac @@ -4,9 +4,12 @@ CC=clang++ LIBRARY=$(LIBNAME).dylib.$(LIBVERSION) -COPTS=-fPIC -O2 -m64 -Wall -stdlib=libc++ -std=c++11 +COPTS=-fPIC -O2 -m64 -Wall -stdlib=libc++ -std=c++11 LDOPTS=-dynamiclib -Wl,-install_name,@rpath/$(LIBRARY) INSTDIR=$(PWD)/mac +clean:: + $(RM) $(OBJS) $(LIBRARY) *~ + install:: $(RM) $(INSTDIR)/lib/$(LIBNAME).so && $(LN) $(LIBRARY) $(INSTDIR)/lib/$(LIBNAME).dylib