-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make doesn’t mesh well with javac, which does its own dependency tracking, but we can at least avoid recompiling unchanged classes by passing the build directory with -classpath. Also move the manifest out of Makefile instead of recreating it for every build.
- Loading branch information
Timotej Lazar
committed
Feb 8, 2023
1 parent
53a61ec
commit e99a7c0
Showing
2 changed files
with
15 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Manifest-Version: 1.0 | ||
Class-Path: . | ||
Main-Class: sic.Sim |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,29 @@ | ||
OUT=out/make | ||
|
||
|
||
all: outdir sim vm asm link | ||
|
||
|
||
outdir: | ||
mkdir -p $(OUT) | ||
OUT = out/make | ||
|
||
all: sim vm asm link | ||
|
||
sim: | ||
cd src; javac -encoding UTF-8 -d "../$(OUT)" sic/Sim.java | ||
@mkdir -p "$(OUT)" | ||
cp -R img "$(OUT)" | ||
|
||
javac -encoding UTF-8 -sourcepath src -classpath "$(OUT)" -d "$(OUT)" src/sic/Sim.java | ||
|
||
vm: | ||
cd src; javac -encoding UTF-8 -d "../$(OUT)" sic/VM.java | ||
|
||
@mkdir -p "$(OUT)" | ||
javac -encoding UTF-8 -sourcepath src -classpath "$(OUT)" -d "$(OUT)" src/sic/VM.java | ||
|
||
asm: | ||
cd src; javac -encoding UTF-8 -d "../$(OUT)" sic/Asm.java | ||
|
||
@mkdir -p "$(OUT)" | ||
javac -encoding UTF-8 -sourcepath src -classpath "$(OUT)" -d "$(OUT)" src/sic/Asm.java | ||
|
||
link: | ||
cd src; javac -encoding UTF-8 -d "../$(OUT)" sic/Link.java | ||
|
||
|
||
manifest: | ||
printf "Manifest-Version: 1.0\nClass-Path: .\nMain-Class: sic.Sim\n" >"$(OUT)/MANIFEST.MF" | ||
|
||
|
||
jar: all manifest | ||
cd "$(OUT)"; jar cfm sictools.jar MANIFEST.MF * | ||
@mkdir -p "$(OUT)" | ||
javac -encoding UTF-8 -sourcepath src -classpath "$(OUT)" -d "$(OUT)" src/sic/Link.java | ||
|
||
jar: all | ||
jar --create --file "$(OUT)/sictools.jar" --manifest MANIFEST.MF -C "$(OUT)" . | ||
|
||
clean: | ||
rm -rf "$(OUT)" | ||
|
||
|
||
upload: | ||
scp "$(OUT)/sictools.jar" jure@lalg.fri.uni-lj.si:public_html/ |
e99a7c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't seem to work as expected. I changed a file and it didn't recompile it.
e99a7c0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, thanks for reporting this. I partially reverted the change in eaaf797, which should still at least reduce the time to
make all
. I hope the broken version didn’t waste too much of your time. ^^