-
Notifications
You must be signed in to change notification settings - Fork 11
/
Makefile
85 lines (68 loc) · 2.41 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# Simple Makefile for creating a native binary and a legacy jar file with gcj.
GCJ=gcj
GCJ_FLAGS=-g -O2
#JAVAC=$(GCJ) -C
#JAVAC_FLAGS=$(GCJ_FLAGS)
JAVAC=jikes-classpath
JAVAC_FLAGS=-g -O -source 1.5
JAR=fastjar
PROGRAM=snark
MAINCLASS=org.torrent.snark.Snark
SOURCES= \
org/klomp/snark/BitField.java \
org/klomp/snark/ConnectionAcceptor.java \
org/klomp/snark/CoordinatorListener.java \
org/klomp/snark/HttpAcceptor.java \
org/klomp/snark/MetaInfo.java \
org/klomp/snark/Message.java \
org/klomp/snark/Peer.java \
org/klomp/snark/PeerID.java \
org/klomp/snark/PeerAcceptor.java \
org/klomp/snark/PeerCheckerTask.java \
org/klomp/snark/PeerConnectionIn.java \
org/klomp/snark/PeerConnectionOut.java \
org/klomp/snark/PeerListener.java \
org/klomp/snark/PeerMonitorTask.java \
org/klomp/snark/PeerCoordinator.java \
org/klomp/snark/PeerState.java \
org/klomp/snark/Request.java \
org/klomp/snark/Snark.java \
org/klomp/snark/SnarkShutdown.java \
org/klomp/snark/ShutdownListener.java \
org/klomp/snark/Storage.java \
org/klomp/snark/StorageListener.java \
org/klomp/snark/Tracker.java \
org/klomp/snark/TrackerClient.java \
org/klomp/snark/TrackerInfo.java \
org/klomp/snark/bencode/BEValue.java \
org/klomp/snark/bencode/BEncoder.java \
org/klomp/snark/bencode/BDecoder.java \
org/klomp/snark/bencode/InvalidBEncodingException.java
STATIC_SOURCES=$(SOURCES) org/klomp/snark/StaticSnark.java
STATIC_MAINCLASS=org.torrent.snark.StaticSnark
GNOME_SOURCES=$(SOURCES) org/klomp/snark/SnarkGnome.java \
org/klomp/snark/GnomeInfoWindow.java \
org/klomp/snark/GnomePeerList.java
GNOME_MAINCLASS=org.klomp.snark.SnarkGnome
$(PROGRAM): $(SOURCES)
$(GCJ) $(GCJ_FLAGS) --main=$(MAINCLASS) -o $(PROGRAM) $(SOURCES)
$(PROGRAM)-static: $(STATIC_SOURCES)
$(GCJ) $(GCJ_FLAGS) -static --main=$(STATIC_MAINCLASS) \
-o $(PROGRAM)-static $(STATIC_SOURCES)
$(PROGRAM)-gnome: $(GNOME-SOURCES)
$(JAVAC) $(JAVAC_FLAGS) \
-classpath /usr/share/java/gtk2.8.jar:/usr/share/java/gnome2.12.jar \
-d dist/classes $(GNOME_SOURCES)
$(PROGRAM).jar: $(PROGRAM)-classes Manifest
$(JAR) cfm $(PROGRAM).jar Manifest -C dist/classes/ .
Manifest:
echo "Main-Class: $(MAINCLASS)" > Manifest
classes:
mkdir dist
mkdir dist/classes
$(PROGRAM)-classes: classes $(SOURCES)
$(JAVAC) $(JAVAC_FLAGS) -d dist/classes $(SOURCES)
all: $(PROGRAM) $(PROGRAM)-static $(PROGRAM).jar
clean:
rm -rf dist Manifest $(PROGRAM) $(PROGRAM)-static $(PROGRAM).jar
.PHONY : all clean $(PROGRAM)-classes