From 56811b08090fcba1eb601d09a98c903dacf6687b Mon Sep 17 00:00:00 2001 From: "Viral B. Shah" Date: Tue, 3 Jul 2012 16:49:19 +0530 Subject: [PATCH] Ability to use clang. --- Make.inc | 16 ++++++++++++++-- Makefile | 3 +++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Make.inc b/Make.inc index f015fd8..35c6ace 100644 --- a/Make.inc +++ b/Make.inc @@ -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 diff --git a/Makefile b/Makefile index d1b3c1a..b7cd5f9 100644 --- a/Makefile +++ b/Makefile @@ -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