aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-11-14 02:28:30 +0100
committerMattias Andrée <maandree@operamail.com>2014-11-14 02:28:30 +0100
commitd62d707f71098d6c2ee168c5fd3b42afe52f93b5 (patch)
treeb71438ed574edb6af6c52ddf15a11c68556dcf6a
parentm (diff)
downloadjlibgamma-d62d707f71098d6c2ee168c5fd3b42afe52f93b5.tar.gz
jlibgamma-d62d707f71098d6c2ee168c5fd3b42afe52f93b5.tar.bz2
jlibgamma-d62d707f71098d6c2ee168c5fd3b42afe52f93b5.tar.xz
misc m makefile1.0.1
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--Makefile25
1 files changed, 15 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index fb343a4..9712844 100644
--- a/Makefile
+++ b/Makefile
@@ -76,24 +76,29 @@ C_OPTIMISE ?= -Og -g
JAVA_OPTIMISE ?= -O
# Warning flags for C code, set to empty if you are not using GCC
-C_WARN = -Wall -Wextra -pedantic
-## TODO add more warnings
-
-# Warning flags for Java code.
+C_WARN = -Wall -Wextra -pedantic -Wdouble-promotion -Wformat=2 -Winit-self -Wmissing-include-dirs \
+ -Wtrampolines -Wfloat-equal -Wshadow -Wmissing-prototypes -Wmissing-declarations \
+ -Wredundant-decls -Wnested-externs -Winline -Wno-variadic-macros -Wswitch-default \
+ -Wsync-nand -Wunsafe-loop-optimizations -Wcast-align -Wstrict-overflow \
+ -Wdeclaration-after-statement -Wundef -Wbad-function-cast -Wcast-qual -Wwrite-strings \
+ -Wlogical-op -Waggregate-return -Wstrict-prototypes -Wold-style-definition -Wpacked \
+ -Wvector-operation-performance -Wunsuffixed-float-constants -Wnormalized=nfkc
+
+# Warning flags for Java code
JAVA_WARN = -Xlint:all
# Addition flags to use when compiling C code with JNI support
-CC_JNI_FLAGS = -I$(JAVA_HOME)/include
+CC_JNI_FLAGS = -I"$(JAVA_HOME)/include" -I"$(shell echo "$(JAVA_HOME)"/include/*/)"
-# Addition flags to use when linking natvie objets with JNI support
+# Addition flags to use when linking native objets with JNI support
LD_JNI_FLAGS =
# Flags to use when compiling C code
-CC_FLAGS = -std=$(STD) $(C_OPTIMISE) $(CFLAGS) $(PIC) $(CPPFLAGS) $(C_WARN)
+CC_FLAGS = -std=$(STD) $(C_OPTIMISE) $(PIC) $(C_WARN)
# Flags to use when linking native objects
-LD_FLAGS = -lgamma -std=$(STD) $(C_OPTIMISE) $(LDFLAGS) $(C_WARN)
+LD_FLAGS = -lgamma -std=$(STD) $(C_OPTIMISE) $(C_WARN)
# Flags to use when compiling Java code
JAVAC_FLAGS = $(JAVACFLAGS) $(JAVA_OPTIMISE) $(JAVA_WARN)
@@ -148,11 +153,11 @@ obj/libgamma_%.h: obj/libgamma/%.class
$$(echo "$<" | sed -e 's:^obj/::' -e 's:.class$$::' | sed -e 's:/:.:g')
obj/libgamma_%.o: src/libgamma_%.c obj/libgamma_%.h
- $(CC) $(CC_FLAGS) $(CC_JNI_FLAGS) -iquote"obj" -c -o $@ $<
+ $(CC) $(CC_JNI_FLAGS) $(CC_FLAGS) -iquote"obj" -c -o $@ $< $(CFLAGS) $(CPPFLAGS)
bin/libgamma-java.$(SO).$(LIB_VERSION): $(foreach O,$(JAVA_H),obj/libgamma_$(O).o)
@mkdir -p bin
- $(CC) $(LD_FLAGS) $(LD_JNI_FLAGS) $(SHARED) $(LDSO) -o $@ $^
+ $(CC) $(LD_JNI_FLAGS) $(LD_FLAGS) $(SHARED) $(LDSO) -o $@ $^ $(LDFLAGS)
bin/libgamma-java.$(SO).$(LIB_MAJOR):
@mkdir -p bin