mirror of
https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
synced 2025-04-03 17:17:13 +02:00
commit
9bd6ebcc55
2 changed files with 11 additions and 9 deletions
14
Make.inc
14
Make.inc
|
@ -4,8 +4,9 @@ OS := $(shell uname)
|
|||
VERSION = 0.1.0
|
||||
VERSION_SPLIT = $(subst ., , $(VERSION))
|
||||
DESTDIR =
|
||||
PREFIX = /usr/local
|
||||
libdir = $(PREFIX)/lib
|
||||
prefix = /usr/local
|
||||
libdir = $(prefix)/lib
|
||||
includedir = $(prefix)/include
|
||||
|
||||
FC = gfortran
|
||||
FFLAGS += -O3
|
||||
|
@ -69,28 +70,29 @@ override OS=WINNT
|
|||
endif
|
||||
#keep these if statements these separate
|
||||
ifeq ($(OS), WINNT)
|
||||
SHLIB_EXT = dll
|
||||
SONAME_FLAG = -soname
|
||||
CFLAGS_add+=-nodefaultlibs
|
||||
FFLAGS+=-nodefaultlibs
|
||||
endif
|
||||
|
||||
ifeq ($(OS), Linux)
|
||||
SHLIB_EXT = so
|
||||
SONAME_FLAG = -soname
|
||||
CFLAGS_add+=-fPIC
|
||||
FFLAGS+=-fPIC
|
||||
endif
|
||||
|
||||
ifeq ($(OS), FreeBSD)
|
||||
SHLIB_EXT = so
|
||||
SONAME_FLAG = -soname
|
||||
CFLAGS_add+=-fPIC
|
||||
FFLAGS+=-fPIC
|
||||
endif
|
||||
|
||||
ifeq ($(OS), Darwin)
|
||||
SHLIB_EXT = dylib
|
||||
SONAME_FLAG = -install_name
|
||||
CFLAGS_add+=-fPIC
|
||||
FFLAGS+=-fPIC
|
||||
endif
|
||||
|
||||
ifeq ($(OS), WINNT)
|
||||
SHLIB_EXT = dll
|
||||
endif
|
||||
|
|
6
Makefile
6
Makefile
|
@ -26,7 +26,7 @@ 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).$(VERSION)
|
||||
$(FC) -shared $(OBJS) $(LDFLAGS) -Wl,$(SONAME_FLAG),libopenlibm.$(SHLIB_EXT).$(VERSION) -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)
|
||||
|
@ -43,6 +43,6 @@ distclean:
|
|||
|
||||
install: all
|
||||
mkdir -p $(DESTDIR)$(libdir)
|
||||
mkdir -p $(DESTDIR)$(PREFIX)/include
|
||||
mkdir -p $(DESTDIR)$(includedir)
|
||||
cp -a libopenlibm.$(SHLIB_EXT)* libopenlibm.a $(DESTDIR)$(libdir)/
|
||||
cp -a src/openlibm.h $(DESTDIR)$(PREFIX)/include/
|
||||
cp -a src/openlibm.h $(DESTDIR)$(includedir)/
|
||||
|
|
Loading…
Add table
Reference in a new issue