mirror of
https://git.planet-casio.com/Lephenixnoir/OpenLibm.git
synced 2024-12-28 20:43:41 +01:00
Merge pull request #106 from petercolberg/master
Set default optimization flag to -O2
This commit is contained in:
commit
5cd80c4b1c
4 changed files with 15 additions and 19 deletions
|
@ -22,3 +22,5 @@ arm32)
|
||||||
esac
|
esac
|
||||||
|
|
||||||
$LOADER make check
|
$LOADER make check
|
||||||
|
|
||||||
|
make clean && git status --ignored --porcelain && test -z "$(git status --ignored --porcelain)"
|
||||||
|
|
5
Make.inc
5
Make.inc
|
@ -47,9 +47,8 @@ endif
|
||||||
|
|
||||||
CFLAGS_add += -std=c99 -Wall -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 -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
|
||||||
|
|
||||||
ifneq ($(NOOPT),1)
|
# The optimization flag may be overriden with the environment variable CFLAGS.
|
||||||
CFLAGS_add += -O3
|
CFLAGS ?= -O2
|
||||||
endif
|
|
||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
|
|
15
Makefile
15
Makefile
|
@ -40,8 +40,8 @@ ifeq ($(OS),WINNT)
|
||||||
$(CC) -shared $(OBJS) $(LDFLAGS) $(LDFLAGS_add) -Wl,$(SONAME_FLAG),libopenlibm.$(SHLIB_EXT) -o libopenlibm.$(SHLIB_EXT)
|
$(CC) -shared $(OBJS) $(LDFLAGS) $(LDFLAGS_add) -Wl,$(SONAME_FLAG),libopenlibm.$(SHLIB_EXT) -o libopenlibm.$(SHLIB_EXT)
|
||||||
else
|
else
|
||||||
$(CC) -shared $(OBJS) $(LDFLAGS) $(LDFLAGS_add) -Wl,$(SONAME_FLAG),libopenlibm.$(SHLIB_EXT).$(SOMAJOR) -o libopenlibm.$(SHLIB_EXT).$(SOMAJOR).$(SOMINOR)
|
$(CC) -shared $(OBJS) $(LDFLAGS) $(LDFLAGS_add) -Wl,$(SONAME_FLAG),libopenlibm.$(SHLIB_EXT).$(SOMAJOR) -o libopenlibm.$(SHLIB_EXT).$(SOMAJOR).$(SOMINOR)
|
||||||
@-ln -sf libopenlibm.$(SHLIB_EXT).$(SOMAJOR).$(SOMINOR) libopenlibm.$(SHLIB_EXT).$(SOMAJOR)
|
ln -sf libopenlibm.$(SHLIB_EXT).$(SOMAJOR).$(SOMINOR) libopenlibm.$(SHLIB_EXT).$(SOMAJOR)
|
||||||
@-ln -sf libopenlibm.$(SHLIB_EXT).$(SOMAJOR).$(SOMINOR) libopenlibm.$(SHLIB_EXT)
|
ln -sf libopenlibm.$(SHLIB_EXT).$(SOMAJOR).$(SOMINOR) libopenlibm.$(SHLIB_EXT)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
test/test-double: libopenlibm.$(SHLIB_EXT)
|
test/test-double: libopenlibm.$(SHLIB_EXT)
|
||||||
|
@ -51,14 +51,9 @@ test/test-float: libopenlibm.$(SHLIB_EXT)
|
||||||
$(MAKE) -C test test-float
|
$(MAKE) -C test test-float
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@for dir in $(SUBDIRS) .; do \
|
rm -f amd64/*.o arm/*.o bsdsrc/*.o i387/*.o ld128/*.o ld80/*.o src/*.o
|
||||||
rm -fr $$dir/*.o $$dir/*.a $$dir/*.$(SHLIB_EXT)*; \
|
rm -f libopenlibm.a libopenlibm.$(SHLIB_EXT)*
|
||||||
done
|
$(MAKE) -C test clean
|
||||||
@rm -f test/test-double test/test-float
|
|
||||||
|
|
||||||
distclean:
|
|
||||||
-rm -f $(OBJS) *.a *.$(SHLIB_EXT) libopenlibm.*
|
|
||||||
-$(MAKE) -C test clean
|
|
||||||
|
|
||||||
openlibm.pc: openlibm.pc.in Make.inc Makefile
|
openlibm.pc: openlibm.pc.in Make.inc Makefile
|
||||||
echo "prefix=${prefix}" > openlibm.pc
|
echo "prefix=${prefix}" > openlibm.pc
|
||||||
|
|
|
@ -12,22 +12,22 @@ all: test-double test-float # test-double-system test-float-system
|
||||||
bench: bench-syslibm bench-openlibm
|
bench: bench-syslibm bench-openlibm
|
||||||
|
|
||||||
test-double: test-double.c libm-test.c
|
test-double: test-double.c libm-test.c
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) -g $@.c -D__BSD_VISIBLE -I ../include -I../src $(OPENLIBM_LIB) -o $@
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $@.c -D__BSD_VISIBLE -I ../include -I../src $(OPENLIBM_LIB) -o $@
|
||||||
|
|
||||||
test-float: test-float.c libm-test.c
|
test-float: test-float.c libm-test.c
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) -g $@.c -D__BSD_VISIBLE -I ../include -I../src $(OPENLIBM_LIB) -o $@
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $@.c -D__BSD_VISIBLE -I ../include -I../src $(OPENLIBM_LIB) -o $@
|
||||||
|
|
||||||
test-double-system: test-double.c libm-test.c
|
test-double-system: test-double.c libm-test.c
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) -g $< -DSYS_MATH_H -lm -o $@
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $< -DSYS_MATH_H -lm -o $@
|
||||||
|
|
||||||
test-float-system: test-float.c libm-test.c
|
test-float-system: test-float.c libm-test.c
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) -g $< -DSYS_MATH_H -lm -o $@
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $< -DSYS_MATH_H -lm -o $@
|
||||||
|
|
||||||
bench-openlibm: libm-bench.cpp
|
bench-openlibm: libm-bench.cpp
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) -O2 $< $(OPENLIBM_LIB) -o $@
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $< $(OPENLIBM_LIB) -o $@
|
||||||
|
|
||||||
bench-syslibm: libm-bench.cpp
|
bench-syslibm: libm-bench.cpp
|
||||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) -O2 $< -lm -o $@
|
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_add_TARGET_$(ARCH)) $(LDFLAGS) $< -lm -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -fr test-double test-float test-double-system test-float-system bench-openlibm bench-syslibm *.dSYM
|
rm -fr test-double test-float test-double-system test-float-system bench-openlibm bench-syslibm *.dSYM
|
||||||
|
|
Loading…
Reference in a new issue