From 3ce34980d7ba2bddbf3e9a1bd6f98cbc855bddc2 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 19 Oct 2024 18:21:54 +0200 Subject: First commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d79bd06 --- /dev/null +++ b/Makefile @@ -0,0 +1,96 @@ +.POSIX: + +CONFIGFILE = config.mk +include $(CONFIGFILE) + +OS = linux +# Linux: linux +# Mac OS: macos +# Windows: windows +include mk/$(OS).mk + + +LIB_MAJOR = 1 +LIB_MINOR = 0 +LIB_VERSION = $(LIB_MAJOR).$(LIB_MINOR) +LIB_NAME = tellurian + + +OBJ_PUBLIC =\ + libtellurian_sea_level.o\ + libtellurian_sea_level_radians.o\ + libtellurian_coarse_distance.o\ + libtellurian_coarse_distance_radians.o\ + libtellurian_distance.o\ + libtellurian_distance_radians.o\ + libtellurian_azimuth.o\ + libtellurian_azimuth_radians.o\ + libtellurian_end_point.o\ + libtellurian_end_point_radians.o\ + libtellurian_normal_gravity.o\ + libtellurian_normal_gravity_radians.o\ + libtellurian_elevated_gravity.o\ + libtellurian_elevated_gravity_radians.o\ + libtellurian_meridan_radius.o\ + libtellurian_meridan_radius_radians.o\ + libtellurian_transverse_radius.o\ + libtellurian_transverse_radius_radians.o\ + libtellurian_azimuthal_radius.o\ + libtellurian_azimuthal_radius_radians.o\ + libtellurian_gaussian_radius.o\ + libtellurian_gaussian_radius_radians.o + +OBJ =\ + $(OBJ_PUBLIC)\ + libtellurian_vincenty_inverse__.o + +HDR =\ + libtellurian.h\ + common.h + +LOBJ = $(OBJ:.o=.lo) + + +all: libtellurian.a libtellurian.$(LIBEXT) +$(OBJ): $(HDR) +$(LOBJ): $(HDR) + +.c.o: + $(CC) -c -o $@ $< $(CFLAGS) $(CPPFLAGS) + +.c.lo: + $(CC) -fPIC -c -o $@ $< $(CFLAGS) $(CPPFLAGS) + +libtellurian.a: $(OBJ) + @rm -f -- $@ + $(AR) rc $@ $(OBJ) + $(AR) ts $@ > /dev/null + +libtellurian.$(LIBEXT): $(LOBJ) + $(CC) $(LIBFLAGS) -o $@ $(LOBJ) $(LDFLAGS) + +install: libtellurian.a libtellurian.$(LIBEXT) + mkdir -p -- "$(DESTDIR)$(PREFIX)/lib" + mkdir -p -- "$(DESTDIR)$(PREFIX)/include" + cp -- libtellurian.a "$(DESTDIR)$(PREFIX)/lib/" + cp -- libtellurian.$(LIBEXT) "$(DESTDIR)$(PREFIX)/lib/libtellurian.$(LIBMINOREXT)" + $(FIX_INSTALL_NAME) "$(DESTDIR)$(PREFIX)/lib/libtellurian.$(LIBMINOREXT)" + ln -sf -- libtellurian.$(LIBMINOREXT) "$(DESTDIR)$(PREFIX)/lib/libtellurian.$(LIBMAJOREXT)" + ln -sf -- libtellurian.$(LIBMAJOREXT) "$(DESTDIR)$(PREFIX)/lib/libtellurian.$(LIBEXT)" + cp -- libtellurian.h "$(DESTDIR)$(PREFIX)/include/" + +uninstall: + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libtellurian.a" + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libtellurian.$(LIBMAJOREXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libtellurian.$(LIBMINOREXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/lib/libtellurian.$(LIBEXT)" + -rm -f -- "$(DESTDIR)$(PREFIX)/include/libtellurian.h" + +clean: + -rm -f -- *.o *.a *.lo *.su *.so *.so.* *.dll *.dylib + -rm -f -- *.gch *.gcov *.gcno *.gcda *.$(LIBEXT) + +.SUFFIXES: +.SUFFIXES: .lo .o .c + +.PHONY: all install uninstall clean -- cgit v1.2.3-70-g09d2