Skip to content

Commit

Permalink
Updated makefile.clang and makefile.osx to match makefile
Browse files Browse the repository at this point in the history
for -g flag see [Issue 30](Stewori#30)
the tests targets may not work but they print an error to that effect
Moving and splitting out cleans should also work on all the systems
  • Loading branch information
CalumFreeman committed Aug 30, 2018
1 parent f826e0c commit c7e3b62
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 18 deletions.
43 changes: 34 additions & 9 deletions makefile.clang
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,26 @@ all: $(OUTPUTDIR) libJyNI libJyNI-Loader JyNI
@echo ''
@echo 'Build successful.'

debug: CFLAGS += -g
debug: all

clean:
rm -rf $(JYNIBIN)
rm -f ./JyNI-C/src/*.o
rm -f ./JyNI-C/src/Python/*.o
rm -f ./JyNI-C/src/Objects/*.o
rm -f ./JyNI-C/src/Modules/*.o
rm -f ./JyNI-Loader/JyNILoader.o

tests: build-tests run-tests

build-tests:
@echo 'building tests is not fully supported yet, this will either not work or try to install the demo extension as an actuall extension'
python ./DemoExtension/setup.py install

run-tests:
java -Djava.library.path=./build/ -cp $(JYTHON):./build/JyNI.jar org.python.util.jython ./JyNI-Demo/src/test_all.py

$(OUTPUTDIR):
mkdir $(OUTPUTDIR)

Expand Down Expand Up @@ -108,12 +128,25 @@ ifeq "$(wildcard $(JAVA_HOME) )" ""
$(eval JAVA_HOME = $(shell $(JAVA) -jar $(JYTHON) -c "from java.lang import System; print System.getProperty('java.home')[:-4]"))
endif

# assume you want debug if you are just compiling one portion of the codebase
libJyNI: CFLAGS += -g
libJyNI: $(JAVA_HOME) $(OBJECTS) JyNI-C/src/Python/dynload_shlib.o
$(CC) $(LDFLAGS) $(OBJECTS) JyNI-C/src/Python/dynload_shlib.o -o $(OUTPUTDIR)/libJyNI.so

cleanC:
rm -f ./JyNI-C/src/*.o
rm -f ./JyNI-C/src/Python/*.o
rm -f ./JyNI-C/src/Objects/*.o
rm -f ./JyNI-C/src/Modules/*.o

# assume you want debug if you are just compiling one portion of the codebase
libJyNI-Loader: CFLAGS += -g
libJyNI-Loader: $(JAVA_HOME) ./JyNI-Loader/JyNILoader.o
$(CC) $(LDFLAGS) ./JyNI-Loader/JyNILoader.o -o $(OUTPUTDIR)/libJyNI-Loader.so

cleanLoader:
rm -f ./JyNI-Loader/JyNILoader.o

$(JYNIBIN):
mkdir $(JYNIBIN)

Expand All @@ -131,13 +164,5 @@ JyNI: $(JYTHON) $(JYNIBIN)/JyNI $(JYNIBIN)/Lib
cleanJ:
rm -rf $(JYNIBIN)

clean:
rm -rf $(JYNIBIN)
rm -f ./JyNI-C/src/*.o
rm -f ./JyNI-C/src/Python/*.o
rm -f ./JyNI-C/src/Objects/*.o
rm -f ./JyNI-C/src/Modules/*.o
rm -f ./JyNI-Loader/JyNILoader.o

.PHONY: JyNI libJyNI libJyNI-Loader clean cleanJ JAVA_HOME_hint all
.PHONY: JyNI libJyNI libJyNI-Loader clean cleanC cleanLoader cleanJ JAVA_HOME_hint all debug tests run-tests build-tests

43 changes: 34 additions & 9 deletions makefile.osx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,26 @@ all: $(OUTPUTDIR) libJyNI libJyNI-Loader JyNI
@echo ''
@echo 'Build successful.'

debug: CFLAGS += -g
debug: all

clean:
rm -rf $(JYNIBIN)
rm -f ./JyNI-C/src/*.o
rm -f ./JyNI-C/src/Python/*.o
rm -f ./JyNI-C/src/Objects/*.o
rm -f ./JyNI-C/src/Modules/*.o
rm -f ./JyNI-Loader/JyNILoader.o

tests: build-tests run-tests

build-tests:
@echo 'building tests is not fully supported yet, this will either not work or try to install the demo extension as an actuall extension'
python ./DemoExtension/setup.py install

run-tests:
java -Djava.library.path=./build/ -cp $(JYTHON):./build/JyNI.jar org.python.util.jython ./JyNI-Demo/src/test_all.py

$(OUTPUTDIR):
mkdir $(OUTPUTDIR)

Expand Down Expand Up @@ -104,12 +124,25 @@ ifeq "$(wildcard $(JAVA_HOME) )" ""
$(eval JAVA_HOME = $(shell $(JAVA) -jar $(JYTHON) -c "from java.lang import System; print System.getProperty('java.home')[:-4]"))
endif

# assume you want debug if you are just compiling one portion of the codebase
libJyNI: CFLAGS += -g
libJyNI: $(JAVA_HOME) $(OBJECTS) JyNI-C/src/Python/dynload_shlib.o
$(CC) $(LDFLAGS) $(OBJECTS) JyNI-C/src/Python/dynload_shlib.o -o $(OUTPUTDIR)/libJyNI.dylib

cleanC:
rm -f ./JyNI-C/src/*.o
rm -f ./JyNI-C/src/Python/*.o
rm -f ./JyNI-C/src/Objects/*.o
rm -f ./JyNI-C/src/Modules/*.o

# assume you want debug if you are just compiling one portion of the codebase
libJyNI-Loader: CFLAGS += -g
libJyNI-Loader: $(JAVA_HOME) ./JyNI-Loader/JyNILoader.o
$(CC) $(LDFLAGS) ./JyNI-Loader/JyNILoader.o -o $(OUTPUTDIR)/libJyNI-Loader.dylib

cleanLoader:
rm -f ./JyNI-Loader/JyNILoader.o

$(JYNIBIN):
mkdir $(JYNIBIN)

Expand All @@ -127,13 +160,5 @@ JyNI: $(JYTHON) $(JYNIBIN)/JyNI $(JYNIBIN)/Lib
cleanJ:
rm -rf $(JYNIBIN)

clean:
rm -rf $(JYNIBIN)
rm -f ./JyNI-C/src/*.o
rm -f ./JyNI-C/src/Python/*.o
rm -f ./JyNI-C/src/Objects/*.o
rm -f ./JyNI-C/src/Modules/*.o
rm -f ./JyNI-Loader/JyNILoader.o

.PHONY: JyNI libJyNI libJyNI-Loader clean cleanJ JAVA_HOME_hint all
.PHONY: JyNI libJyNI libJyNI-Loader clean cleanC cleanLoader cleanJ JAVA_HOME_hint all debug tests run-tests build-tests

0 comments on commit c7e3b62

Please sign in to comment.