libdir, DESTDIR, and soname updates.

This commit is contained in:
Viral B. Shah 2014-01-05 02:07:17 +05:30
parent 945c25a691
commit 71d942f730
2 changed files with 19 additions and 2 deletions

View file

@ -1,6 +1,11 @@
# -*- mode: makefile-gmake -*-
OS := $(shell uname)
VERSION = 0.1.0
VERSION_SPLIT = $(subst ., , $(VERSION))
DESTDIR =
PREFIX = /usr/local
libdir = $(PREFIX)/lib
FC = gfortran
FFLAGS += -O3

View file

@ -26,11 +26,23 @@ all: libopenlibm.a libopenlibm.$(SHLIB_EXT)
libopenlibm.a: $(OBJS)
$(AR) -rcs libopenlibm.a $(OBJS)
libopenlibm.$(SHLIB_EXT): $(OBJS)
$(FC) -shared $(OBJS) $(LDFLAGS) -o libopenlibm.$(SHLIB_EXT)
$(FC) -shared $(OBJS) $(LDFLAGS) -o libopenlibm.$(SHLIB_EXT).$(VERSION)
ln -s libopenlibm.$(SHLIB_EXT).$(VERSION) libopenlibm.$(SHLIB_EXT).$(word 1,$(VERSION_SPLIT)).$(word 2,$(VERSION_SPLIT))
ln -s libopenlibm.$(SHLIB_EXT).$(VERSION) libopenlibm.$(SHLIB_EXT).$(word 1,$(VERSION_SPLIT))
ln -s libopenlibm.$(SHLIB_EXT).$(VERSION) libopenlibm.$(SHLIB_EXT)
clean:
rm -fr {./,*}/*{.o,~}
@for dir in $(SUBDIRS) .; do \
rm -fr $$dir/*.o $$dir/*.a $$dir/*.$(SHLIB_EXT)*; \
done
distclean:
rm -f $(OBJS) *.a *.$(SHLIB_EXT)
$(MAKE) -C test clean
install: all
mkdir -p $(DESTDIR)$(libdir)
mkdir -p $(DESTDIR)$(PREFIX)/include
cp -a libopenlibm.$(SHLIB_EXT)* libopenlibm.a $(DESTDIR)$(libdir)/
cp -a src/openlibm.h $(DESTDIR)$(PREFIX)/include/