Ability to use clang.

This commit is contained in:
Viral B. Shah 2012-07-03 16:49:19 +05:30
parent 62c895488f
commit 56811b0809
2 changed files with 17 additions and 2 deletions

View file

@ -1,7 +1,19 @@
CC=gcc
OS = $(shell uname)
ARCH = $(shell uname -m)
CFLAGS= -std=c99 -Wall -O2 -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
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
default: all

View file

@ -19,7 +19,9 @@ DUPLICATE_SRCS = $(addsuffix .c,$(DUPLICATE_NAMES))
OBJS = $(patsubst %.S,%.S.o,\
$(patsubst %.c,%.c.o,$(filter-out $(addprefix src/,$(DUPLICATE_SRCS)),$(SRCS))))
all: libopenlibm.a libopenlibm.$(SHLIB_EXT)
$(MAKE) -C test
libopenlibm.a: $(OBJS)
$(QUIET_LINK)ar -rcs libopenlibm.a $(OBJS)
libopenlibm.$(SHLIB_EXT): $(OBJS)
@ -27,3 +29,4 @@ libopenlibm.$(SHLIB_EXT): $(OBJS)
cleanall:
rm -f $(OBJS) *.a *.$(SHLIB_EXT)
$(MAKE) -C test clean