Skip to content

Commit

Permalink
Makefile builds own CXX flags
Browse files Browse the repository at this point in the history
  • Loading branch information
jjlauer committed Oct 27, 2023
1 parent 41a6f43 commit ed2a9a9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .blaze/blaze.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void build_natives() throws Exception {
exec("make").workingDir(targetJcatDir).run();

exec("make").workingDir(targetLibHelloJDir)
.env("CXXFLAGS", "-z noexecstack")
//.env("CXXFLAGS", "-z noexecstack")
.run();

new Copy(Contexts.currentContext())
Expand Down
4 changes: 3 additions & 1 deletion native/libhelloj/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ JAVAC ?= javac
JAVA ?= java
SHAREDFILEEXT ?= so
UNAME_S := $(shell uname -s)
EXTRA_CXXFLAGS := -z noexecstack
ifeq ($(UNAME_S),Darwin)
SHAREDFILEEXT = dylib
EXTRA_CXXFLAGS =
endif

all:
$(CXX) -shared -fPIC -Wall -pedantic -O3 $(CXXFLAGS) -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -I${JAVA_HOME}/include/darwin -I${JAVA_HOME}/include/freebsd -I${JAVA_HOME}/include/openbsd -o libhelloj.$(SHAREDFILEEXT) -lc helloj_HelloLib.cpp
$(CXX) -shared -fPIC -Wall -pedantic -O3 $(CXXFLAGS) $(EXTRA_CXXFLAGS) -I${JAVA_HOME}/include -I${JAVA_HOME}/include/linux -I${JAVA_HOME}/include/darwin -I${JAVA_HOME}/include/freebsd -I${JAVA_HOME}/include/openbsd -o libhelloj.$(SHAREDFILEEXT) -lc helloj_HelloLib.cpp

jniheaders:
$(JAVAC) -h . helloj/HelloLib.java
Expand Down

0 comments on commit ed2a9a9

Please sign in to comment.