Skip to content

Commit

Permalink
GH-72 Add .jar manifest. Reorder .jar library files.
Browse files Browse the repository at this point in the history
  • Loading branch information
SirWumpus committed Nov 12, 2024
1 parent eb3a5f7 commit 3033c10
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*.blk binary
*.docx binary
*.gif binary
*.jar binary
*.jbf binary
*.jpg binary
*.mng binary
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.dll
*.obj
*.exe
*.jar
*.lib
*.tds
*.stackdump
Expand Down
12 changes: 12 additions & 0 deletions jni/Post4.mf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Manifest-Version: 1.0
Main-Class: post4.jni.Post4
Class-Path: post4.jni
Name: post4/jni/
Sealed: true
Specification-Title: "Forth 200x"
Specification-Version: "Draft 19-1"
Specification-Vendor: "https://forth-standard.org/"
Implementation-Title: "Post4"
Implementation-Version: "0.12.0"
Implementation-Vendor: "https://github.com/SirWumpus/post4"

12 changes: 7 additions & 5 deletions jni/makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ install: Post4.jar

# See also
# https://stackoverflow.com/questions/2937406/how-to-bundle-a-native-library-and-a-jni-library-inside-a-jar
Post4.jar: ${LIBNAME} Post4Exception$C Post4Options$C Post4Stacks$C Post4$C
mkdir -p ./post4/jni/${OS}/${CPU}
Post4.jar: ${LIBNAME} Post4Exception$C Post4Options$C Post4Stacks$C Post4$C Post4.mf ${top_srcdir}/src/post4.p4
mkdir -p ./post4/jni ./lib
cp -p *.p4 ${LIBNAME} ./lib
cp -p ${top_srcdir}/src/post4.p4 ./lib
cd ${top_srcdir}/examples && cp -p ansiterm.p4 ed.p4 rand.p4 fizzbuzz.p4 life.p4 life1d.p4 wumpus.p4 ${top_srcdir}/jni/lib
cp -p *.class ./post4/jni
cp -p ${LIBNAME} ./post4/jni/${OS}/${CPU}
jar -v -c -f $@ -e ${MAIN} post4/ -C ../src/ post4.p4 -C ./ *.p4
rm -rf post4
jar -v -c -m Post4.mf -f $@ post4/ lib/
rm -rf post4 lib

${LIBNAME}: Post4$O ../src/libpost4$A
${CC} ${CFLAGS} -shared -o $@ Post4$O ../src/libpost4$A ${LIBS}
Expand Down

0 comments on commit 3033c10

Please sign in to comment.