2012-10-29 10:30:54 +01:00
|
|
|
# -*- mode: makefile-gmake -*-
|
|
|
|
|
2013-05-28 15:30:36 +02:00
|
|
|
OS := $(shell uname)
|
2014-07-10 02:25:46 +02:00
|
|
|
VERSION = 0.4
|
2014-01-04 21:37:17 +01:00
|
|
|
VERSION_SPLIT = $(subst ., , $(VERSION))
|
|
|
|
DESTDIR =
|
2014-01-07 21:54:15 +01:00
|
|
|
prefix = /usr/local
|
2014-04-08 17:49:38 +02:00
|
|
|
bindir = $(prefix)/bin
|
2014-01-07 21:54:15 +01:00
|
|
|
libdir = $(prefix)/lib
|
2014-01-07 21:57:50 +01:00
|
|
|
includedir = $(prefix)/include
|
2012-07-03 13:19:19 +02:00
|
|
|
|
|
|
|
USEGCC = 1
|
|
|
|
USECLANG = 0
|
|
|
|
|
2013-07-14 15:03:56 +02:00
|
|
|
ifeq ($(OS), Darwin)
|
|
|
|
USEGCC = 0
|
|
|
|
USECLANG = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
AR = ar
|
2012-10-31 22:33:04 +01:00
|
|
|
|
2012-07-03 13:19:19 +02:00
|
|
|
ifeq ($(USECLANG),1)
|
|
|
|
USEGCC = 0
|
|
|
|
CC = clang
|
2013-03-03 01:40:38 +01:00
|
|
|
CFLAGS_add += -fno-builtin
|
2012-07-03 13:19:19 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(USEGCC),1)
|
|
|
|
CC = gcc
|
2013-03-03 01:40:38 +01:00
|
|
|
CFLAGS_add += -fno-gnu89-inline
|
2012-07-03 13:19:19 +02:00
|
|
|
endif
|
2011-12-31 08:18:43 +01:00
|
|
|
|
2013-05-28 15:30:36 +02:00
|
|
|
ARCH := $(shell $(CC) -dumpmachine | sed "s/\([^-]*\).*$$/\1/")
|
2013-05-30 03:08:06 +02:00
|
|
|
ifeq ($(ARCH),mingw32)
|
|
|
|
$(error "the mingw32 compiler you are using fails the openblas testsuite. please see the Julia README.windows.md document for a replacement")
|
|
|
|
endif
|
2013-05-28 15:30:36 +02:00
|
|
|
|
|
|
|
CFLAGS_add += -std=c99 -Wall -O3 -I$(OPENLIBM_HOME) -I$(OPENLIBM_HOME)/include -I$(OPENLIBM_HOME)/ld80 -I$(OPENLIBM_HOME)/$(ARCH) -I$(OPENLIBM_HOME)/src -DASSEMBLER -D__BSD_VISIBLE -Wno-implicit-function-declaration
|
|
|
|
|
2011-12-31 14:56:51 +01:00
|
|
|
default: all
|
|
|
|
|
2012-05-25 05:14:58 +02:00
|
|
|
%.c.o: %.c
|
2013-03-03 01:40:38 +01:00
|
|
|
$(CC) $(CPPFLAGS) $(CFLAGS_add) $(CFLAGS) -c $< -o $@
|
2012-10-29 10:30:54 +01:00
|
|
|
|
2012-05-25 05:14:58 +02:00
|
|
|
%.S.o: %.S
|
2013-03-03 01:40:38 +01:00
|
|
|
$(CC) $(SFLAGS) $(filter -m% -B% -I% -D%,$(CFLAGS_add)) -c $< -o $@
|
2012-05-25 05:14:58 +02:00
|
|
|
|
2011-12-31 08:18:43 +01:00
|
|
|
# OS-specific stuff
|
2012-05-25 22:24:37 +02:00
|
|
|
ifeq ($(ARCH),i386)
|
2013-05-28 15:30:36 +02:00
|
|
|
override ARCH := i387
|
2012-05-25 22:24:37 +02:00
|
|
|
endif
|
2013-06-18 02:38:51 +02:00
|
|
|
ifeq ($(ARCH),i486)
|
|
|
|
override ARCH := i387
|
|
|
|
endif
|
2014-06-20 15:30:10 +02:00
|
|
|
ifeq ($(ARCH),i586)
|
|
|
|
override ARCH := i387
|
|
|
|
endif
|
2013-06-18 02:38:51 +02:00
|
|
|
ifeq ($(ARCH),i686)
|
|
|
|
override ARCH := i387
|
|
|
|
endif
|
2012-05-25 22:24:37 +02:00
|
|
|
|
|
|
|
ifeq ($(ARCH),x86_64)
|
2013-05-28 15:30:36 +02:00
|
|
|
override ARCH := amd64
|
2012-05-25 22:24:37 +02:00
|
|
|
endif
|
2012-04-09 02:03:36 +02:00
|
|
|
|
2013-05-28 14:59:02 +02:00
|
|
|
ifneq (,$(findstring MINGW,$(OS)))
|
|
|
|
override OS=WINNT
|
2013-03-03 01:40:38 +01:00
|
|
|
endif
|
2014-04-08 17:49:38 +02:00
|
|
|
|
|
|
|
#keep these if statements separate
|
2013-03-03 01:40:38 +01:00
|
|
|
ifeq ($(OS), WINNT)
|
2014-01-07 21:38:10 +01:00
|
|
|
SHLIB_EXT = dll
|
|
|
|
SONAME_FLAG = -soname
|
2014-04-08 17:49:38 +02:00
|
|
|
CFLAGS_add += -nodefaultlibs
|
2014-04-09 00:16:57 +02:00
|
|
|
shlibdir = $(bindir)
|
2014-04-08 17:49:38 +02:00
|
|
|
else
|
2014-04-09 00:16:57 +02:00
|
|
|
shlibdir = $(libdir)
|
2012-04-09 02:03:36 +02:00
|
|
|
endif
|
|
|
|
|
2011-12-31 08:18:43 +01:00
|
|
|
ifeq ($(OS), Linux)
|
|
|
|
SHLIB_EXT = so
|
2014-01-07 21:38:10 +01:00
|
|
|
SONAME_FLAG = -soname
|
2013-03-03 01:40:38 +01:00
|
|
|
CFLAGS_add+=-fPIC
|
2012-04-09 02:03:36 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS), FreeBSD)
|
|
|
|
SHLIB_EXT = so
|
2014-01-07 21:38:10 +01:00
|
|
|
SONAME_FLAG = -soname
|
2013-03-03 01:40:38 +01:00
|
|
|
CFLAGS_add+=-fPIC
|
2011-12-31 08:18:43 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS), Darwin)
|
|
|
|
SHLIB_EXT = dylib
|
2014-01-07 21:38:10 +01:00
|
|
|
SONAME_FLAG = -install_name
|
2013-03-03 01:40:38 +01:00
|
|
|
CFLAGS_add+=-fPIC
|
2012-04-09 02:03:36 +02:00
|
|
|
endif
|