I tried to make and install this package. However there were a couple of problems coming up, mostly related to the Makefile. I have it running now, but I want to suggest a few improvements. This is part of the "old" Makefile of the current avetanaBT package:
# Call the make all directives in both the C and Java Makefiles.
all: jar javadoc csource
csource:
make -C c
jar uvf $(BIN_DIR)/avetanaBT.jar $(BIN_DIR)/libavetanaBT.so
<comment>
I have a SUSE 9.3 which has a GNU jar implementation in the search path (/usr/bin/) that does not support the u action. You better use
$(JDK_HOME)/bin/jar
here, because you require JDK_HOME to be defined. The jar of the JDK does support the u action. In addition this line puts the .so file in the build directory within the jar file. However your loader looks for it in the root directory of the jar file. All in all this line should look like
$(JDK_HOME)/bin/jar uvf $(BIN_DIR)/avetanaBT.jar -C $(BIN_DIR) libavetanaBT.so
</comment>
# Compile the source code into Java classes.
classes: javaSourceFiles
mkdir -p build
javac -d build @javaSourceFiles
# Create the Java archive of the avetanaBT package.
jar: classes
jar cvf $(BIN_DIR)/avetanaBT.jar de javax com
<comment>
This line collects the files in ./de ./javax and ./com into the jar file. However these are the source code file (.java). The class files are in ./build/de, ./build/javax ./build/com. Thus we need the -C option.
$(JDK_HOME)/bin/jar cvf $(BIN_DIR)/avetanaBT.jar -C $(BIN_DIR) de javax com
</comment>
# Create Javadoc documentation for the avetanaBT package.
javadoc:
javadoc -d $(JAVADOC_DIR) $(JAVADOC_FLAGS) $(PACKAGE_DE) $(PACKAGE_JAVAX) $(PACKAGE_CDC)
# Call the make clean directives in both the C and Java Makefiles.
clean:
make -C c clean
rm -rf javadoc
rm -f $(BIN_DIR)/avetanaBT.jar
rm -f $(BIN_DIR)/libavetanaBT.so
rm -f javaSourceFiles
rm -f tmp*
rm -f libavetanaBT.so
rm -rf $(BIN_DIR)/build/javax
rm -rf $(BIN_DIR)/build/com
rm -rf $(BIN_DIR)/build/de
<comment>
The clean action seems out-dated too. I'm not sure how it should look like. But I guess one major action should be rm -rf $(BIN_DIR)/*
</comment>
I hope this will help you to make your module running on several platforms.
Best regards, Simon
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried to make and install this package. However there were a couple of problems coming up, mostly related to the Makefile. I have it running now, but I want to suggest a few improvements. This is part of the "old" Makefile of the current avetanaBT package:
# Call the make all directives in both the C and Java Makefiles.
all: jar javadoc csource
csource:
make -C c
jar uvf $(BIN_DIR)/avetanaBT.jar $(BIN_DIR)/libavetanaBT.so
<comment>
I have a SUSE 9.3 which has a GNU jar implementation in the search path (/usr/bin/) that does not support the u action. You better use
$(JDK_HOME)/bin/jar
here, because you require JDK_HOME to be defined. The jar of the JDK does support the u action. In addition this line puts the .so file in the build directory within the jar file. However your loader looks for it in the root directory of the jar file. All in all this line should look like
$(JDK_HOME)/bin/jar uvf $(BIN_DIR)/avetanaBT.jar -C $(BIN_DIR) libavetanaBT.so
</comment>
javaSourceFiles:
@find {de,com,javax} -iname *.java > javaSourceFiles
# Compile the source code into Java classes.
classes: javaSourceFiles
mkdir -p build
javac -d build @javaSourceFiles
# Create the Java archive of the avetanaBT package.
jar: classes
jar cvf $(BIN_DIR)/avetanaBT.jar de javax com
<comment>
This line collects the files in ./de ./javax and ./com into the jar file. However these are the source code file (.java). The class files are in ./build/de, ./build/javax ./build/com. Thus we need the -C option.
$(JDK_HOME)/bin/jar cvf $(BIN_DIR)/avetanaBT.jar -C $(BIN_DIR) de javax com
</comment>
# Create Javadoc documentation for the avetanaBT package.
javadoc:
javadoc -d $(JAVADOC_DIR) $(JAVADOC_FLAGS) $(PACKAGE_DE) $(PACKAGE_JAVAX) $(PACKAGE_CDC)
# Call the make clean directives in both the C and Java Makefiles.
clean:
make -C c clean
rm -rf javadoc
rm -f $(BIN_DIR)/avetanaBT.jar
rm -f $(BIN_DIR)/libavetanaBT.so
rm -f javaSourceFiles
rm -f tmp*
rm -f libavetanaBT.so
rm -rf $(BIN_DIR)/build/javax
rm -rf $(BIN_DIR)/build/com
rm -rf $(BIN_DIR)/build/de
<comment>
The clean action seems out-dated too. I'm not sure how it should look like. But I guess one major action should be rm -rf $(BIN_DIR)/*
</comment>
I hope this will help you to make your module running on several platforms.
Best regards, Simon