mirror of
https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
synced 2024-12-29 13:03:42 +01:00
support environment CFLAGS (and SFLAGS) without clobbering the essential build flags
This commit is contained in:
parent
50ce8eff11
commit
3fda504f47
1 changed files with 12 additions and 9 deletions
21
Make.inc
21
Make.inc
|
@ -9,30 +9,30 @@ FFLAGS += -O3
|
||||||
USEGCC = 1
|
USEGCC = 1
|
||||||
USECLANG = 0
|
USECLANG = 0
|
||||||
|
|
||||||
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
|
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
|
||||||
|
|
||||||
ifeq ($(USECLANG),1)
|
ifeq ($(USECLANG),1)
|
||||||
USEGCC = 0
|
USEGCC = 0
|
||||||
CC = clang
|
CC = clang
|
||||||
CFLAGS += -fno-builtin
|
CFLAGS_add += -fno-builtin
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(USEGCC),1)
|
ifeq ($(USEGCC),1)
|
||||||
CC = gcc
|
CC = gcc
|
||||||
CFLAGS += -fno-gnu89-inline
|
CFLAGS_add += -fno-gnu89-inline
|
||||||
endif
|
endif
|
||||||
AR = ar
|
AR = ar
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
%.c.o: %.c
|
%.c.o: %.c
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
|
$(CC) $(CPPFLAGS) $(CFLAGS_add) $(CFLAGS) -c $< -o $@
|
||||||
|
|
||||||
%.f.o: %.f
|
%.f.o: %.f
|
||||||
$(FC) $(FFLAGS) -c $< -o $@
|
$(FC) $(FFLAGS) -c $< -o $@
|
||||||
|
|
||||||
%.S.o: %.S
|
%.S.o: %.S
|
||||||
$(CC) $(filter -m% -B% -I% -D%,$(CFLAGS)) -c $< -o $@
|
$(CC) $(SFLAGS) $(filter -m% -B% -I% -D%,$(CFLAGS_add)) -c $< -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -fr *.o *.c.o *.S.o *~ test-double test-float test-double-system test-float-system *.dSYM
|
rm -fr *.o *.c.o *.S.o *~ test-double test-float test-double-system test-float-system *.dSYM
|
||||||
|
@ -52,25 +52,28 @@ endif
|
||||||
|
|
||||||
ifeq ($(OS), MINGW32_NT-6.1)
|
ifeq ($(OS), MINGW32_NT-6.1)
|
||||||
OS=WINNT
|
OS=WINNT
|
||||||
CFLAGS+=-nodefaultlibs
|
endif
|
||||||
|
#keep these if statements these separate
|
||||||
|
ifeq ($(OS), WINNT)
|
||||||
|
CFLAGS_add+=-nodefaultlibs
|
||||||
FFLAGS+=-nodefaultlibs
|
FFLAGS+=-nodefaultlibs
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS), Linux)
|
ifeq ($(OS), Linux)
|
||||||
SHLIB_EXT = so
|
SHLIB_EXT = so
|
||||||
CFLAGS+=-fPIC
|
CFLAGS_add+=-fPIC
|
||||||
FFLAGS+=-fPIC
|
FFLAGS+=-fPIC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS), FreeBSD)
|
ifeq ($(OS), FreeBSD)
|
||||||
SHLIB_EXT = so
|
SHLIB_EXT = so
|
||||||
CFLAGS+=-fPIC
|
CFLAGS_add+=-fPIC
|
||||||
FFLAGS+=-fPIC
|
FFLAGS+=-fPIC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OS), Darwin)
|
ifeq ($(OS), Darwin)
|
||||||
SHLIB_EXT = dylib
|
SHLIB_EXT = dylib
|
||||||
CFLAGS+=-fPIC
|
CFLAGS_add+=-fPIC
|
||||||
FFLAGS+=-fPIC
|
FFLAGS+=-fPIC
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue