OpenLibm/Make.inc

78 lines
1.6 KiB
PHP
Raw Normal View History

2012-05-26 03:25:13 +02:00
OS = $(shell uname)
ARCH = $(shell uname -m)
2012-07-03 13:19:19 +02:00
USEGCC = 1
USECLANG = 0
ifeq ($(USECLANG),1)
USEGCC = 0
CC = clang
CFLAGS= -std=c99 -Wall -O4 -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
endif
ifeq ($(USEGCC),1)
CC = gcc
CFLAGS= -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
endif
2011-12-31 08:18:43 +01:00
2011-12-31 14:56:51 +01:00
default: all
%.c.o: %.c
2012-05-25 22:26:07 +02:00
$(QUIET_CC)$(CC) $(CFLAGS) -c $< -o $@
2011-12-31 08:18:43 +01:00
%.S.o: %.S
2012-05-25 22:24:37 +02:00
$(QUIET_ASM)$(CC) $(filter -f% -m% -B% -I% -D%,$(CFLAGS)) -c $< -o $@
2011-12-31 08:18:43 +01:00
clean:
2012-05-25 05:38:33 +02:00
rm -f *.o *.c.o *.S.o *~
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
ifeq ($(OS), MINGW32_NT-6.1)
OS=WINNT
2012-05-26 03:25:13 +02:00
CFLAGS+=-nodefaultlibs
endif
2011-12-31 08:18:43 +01:00
ifeq ($(OS), Linux)
SHLIB_EXT = so
2012-05-26 03:25:13 +02:00
CFLAGS+=-fPIC
endif
ifeq ($(OS), FreeBSD)
SHLIB_EXT = so
2012-05-26 03:25:13 +02:00
CFLAGS+=-fPIC
2011-12-31 08:18:43 +01:00
endif
ifeq ($(OS), Darwin)
SHLIB_EXT = dylib
2012-05-26 03:25:13 +02:00
CFLAGS+=-fPIC
endif
ifeq ($(OS), WINNT)
SHLIB_EXT = dll
2011-12-31 08:18:43 +01:00
endif
# Colors for make
CCCOLOR="\033[34m"
LINKCOLOR="\033[34;1m"
SRCCOLOR="\033[33m"
BINCOLOR="\033[37;1m"
MAKECOLOR="\033[32;1m"
ENDCOLOR="\033[0m"
QUIET_CC = @printf ' %b %b\n' $(CCCOLOR)CC$(ENDCOLOR) $(SRCCOLOR)$@$(ENDCOLOR);
QUIET_ASM = @printf ' %b %b\n' $(CCCOLOR)ASM$(ENDCOLOR) $(SRCCOLOR)$@$(ENDCOLOR);
2011-12-31 08:18:43 +01:00
QUIET_LINK = @printf ' %b %b\n' $(LINKCOLOR)LINK$(ENDCOLOR) $(BINCOLOR)$@$(ENDCOLOR);