OpenLibm/Make.inc

83 lines
1.4 KiB
PHP
Raw Normal View History

2012-10-29 10:30:54 +01:00
# -*- mode: makefile-gmake -*-
2012-05-26 03:25:13 +02:00
OS = $(shell uname)
ARCH = $(shell uname -m)
2012-07-03 13:19:19 +02:00
2012-10-29 10:30:54 +01:00
FC = gfortran
FFLAGS += -O3
2012-10-29 10:30:54 +01:00
2012-07-03 13:19:19 +02:00
USEGCC = 1
USECLANG = 0
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
2012-07-03 13:19:19 +02:00
ifeq ($(USECLANG),1)
USEGCC = 0
CC = clang
CFLAGS_add += -fno-builtin
2012-07-03 13:19:19 +02:00
endif
ifeq ($(USEGCC),1)
CC = gcc
CFLAGS_add += -fno-gnu89-inline
2012-07-03 13:19:19 +02:00
endif
2012-12-29 08:58:07 +01:00
AR = ar
2011-12-31 08:18:43 +01:00
2011-12-31 14:56:51 +01:00
default: all
%.c.o: %.c
$(CC) $(CPPFLAGS) $(CFLAGS_add) $(CFLAGS) -c $< -o $@
2012-10-29 10:30:54 +01:00
%.f.o: %.f
$(FC) $(FFLAGS) -c $< -o $@
2011-12-31 08:18:43 +01:00
%.S.o: %.S
$(CC) $(SFLAGS) $(filter -m% -B% -I% -D%,$(CFLAGS_add)) -c $< -o $@
2011-12-31 08:18:43 +01:00
clean:
rm -fr *.o *.c.o *.S.o *~ test-double test-float test-double-system test-float-system *.dSYM
2011-12-31 08:18:43 +01:00
# OS-specific stuff
2012-05-25 22:24:37 +02:00
ifeq ($(ARCH),i386)
override ARCH = i387
endif
ifeq ($(ARCH),x86_64)
override ARCH = amd64
endif
2012-05-26 03:25:13 +02:00
ifeq ($(ARCH),i686)
2012-05-30 00:11:49 +02:00
override ARCH = i387
2012-05-26 03:25:13 +02:00
endif
2013-05-28 14:59:02 +02:00
ifneq (,$(findstring MINGW,$(OS)))
override OS=WINNT
endif
#keep these if statements these separate
ifeq ($(OS), WINNT)
CFLAGS_add+=-nodefaultlibs
2012-10-29 10:30:54 +01:00
FFLAGS+=-nodefaultlibs
endif
2011-12-31 08:18:43 +01:00
ifeq ($(OS), Linux)
SHLIB_EXT = so
CFLAGS_add+=-fPIC
2012-10-29 10:30:54 +01:00
FFLAGS+=-fPIC
endif
ifeq ($(OS), FreeBSD)
SHLIB_EXT = so
CFLAGS_add+=-fPIC
2012-10-29 10:30:54 +01:00
FFLAGS+=-fPIC
2011-12-31 08:18:43 +01:00
endif
ifeq ($(OS), Darwin)
SHLIB_EXT = dylib
CFLAGS_add+=-fPIC
2012-10-29 10:30:54 +01:00
FFLAGS+=-fPIC
endif
ifeq ($(OS), WINNT)
SHLIB_EXT = dll
2011-12-31 08:18:43 +01:00
endif