Skip to content

Commit 5fb40c1

Browse files
committed
build: add makefile
1 parent 1525c2e commit 5fb40c1

File tree

2 files changed

+35
-11
lines changed

2 files changed

+35
-11
lines changed

Makefile

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
ifdef JAVAC
2+
else
3+
JAVAC=~/Downloads/jdk1.6.0_45/bin/javac
4+
endif
5+
6+
ifdef WORLDSPLAYER_JAR
7+
else
8+
WORLDSPLAYER_JAR=${HOME}/.local/share/bottles/bottles/WorldsPlayer/drive_c/Program Files (x86)/Worlds Inc/WorldsPlayer - BowieFull/lib/worlds.jar
9+
endif
10+
11+
.PHONY: compile decompile install options
12+
13+
all: options
14+
15+
compile:
16+
JAVAC=${JAVAC} ./bin/compile
17+
18+
decompile:
19+
WORLDSPLAYER_JAR=${WORLDSPLAYER_JAR} ./bin/decompile
20+
21+
install:
22+
cp ./out/worlds.jar "${WORLDSPLAYER_JAR}"
23+
24+
options:
25+
@echo "JAVAC=${JAVAC}"
26+
@echo "WORLDSPLAYER_JAR=${WORLDSPLAYER_JAR}"

README.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,15 @@ This project additionally requires the
1515

1616
## Decompiling WorldsPlayer
1717

18-
To decompile WorldsPlayer, you will need to run the
19-
[`bin/decompile`](./bin/decompile) script. This script will decompile the full
20-
source tree of the WorldsPlayer Java Archive to the
18+
To decompile WorldsPlayer, you will need to run the `decompile` Make task. This
19+
task will decompile the full source tree of the WorldsPlayer Java Archive to the
2120
[`source`](./source) directory.
2221

2322
You'll additionally need to provide the location of the WorldsPlayer Java
2423
Archive as the `WORLDSPLAYER_JAR` environment variable.
2524

2625
```bash
27-
WORLDSPLAYER_JAR=/path/to/worlds.jar bin/decompile
26+
WORLDSPLAYER_JAR=/path/to/worlds.jar make decompile
2827
```
2928

3029
## Editing WorldsPlayer
@@ -33,16 +32,15 @@ You can edit the decompiled source files in any way you like.
3332

3433
## Recompiling WorldsPlayer
3534

36-
To recompile WorldsPlayer, you will need to run the
37-
[`bin/recompile`](./bin/recompile) script. This script will recompile the full
38-
source tree of the WorldsPlayer Java Archive to the
35+
To recompile WorldsPlayer, you will need to run the `compile` Make task. This
36+
task will recompile the full source tree of the WorldsPlayer Java Archive to the
3937
[`out`](./out) directory.
4038

4139
You'll additionally need to provide the location of the Java 6 compiler as the
4240
`JAVAC` environment variable.
4341

4442
```bash
45-
JAVAC=/path/to/javac bin/recompile
43+
JAVAC=/path/to/javac make compile
4644
```
4745

4846
The recompiled WorldsPlayer Java Archive will be located at
@@ -53,16 +51,16 @@ to run in the WorldsPlayer client.
5351

5452
```shell
5553
# Decompile WorldsPlayer
56-
WORLDSPLAYER_JAR=/path/to/worlds.jar bin/decompile
54+
WORLDSPLAYER_JAR=/path/to/worlds.jar make decompile
5755

5856
# Edit the source files in the source directory
5957
find source -type f -name "*.java" -exec sed -i.bak 's/this\.setName(longID);/this.setName(longID + " (" + longID + ")");/' {} \;
6058

6159
# Recompile WorldsPlayer
62-
JAVAC=/path/to/javac bin/recompile
60+
JAVAC=/path/to/javac make compile
6361

6462
# Copy worlds.jar to your WorldsPlayer client
65-
cp out/worlds.jar /path/to/worlds.jar
63+
WORLDSPLAYER_JAR=/path/to/worlds.jar make install
6664
```
6765

6866
Now that we've changed the username format from `username` to `username (username)`, we can run WorldsPlayer to verify that the change has been applied.

0 commit comments

Comments
 (0)