-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
executable file
·192 lines (148 loc) · 4.66 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# $Id: Makefile,v 1.42.4.4.2.5 2004/07/22 17:48:05 amphibian Exp $
SHELL ?= /bin/sh
RELEASE_NAME ?= `date +%Y%m%d`
JAR ?= jar
#
# define build targets
#
CLIENT:=freenet/client/*.java \
freenet/client/cli/*.java
FPROXY:=freenet/client/http/*.java \
freenet/client/http/filter/*.java
TOOLS:=freenet/interfaces/servlet/TestHttpServlet.java \
freenet/node/NodeConsole.java
NODE:=freenet/node/Main.java \
freenet/interfaces/servlet/SingleHttpServletContainer.java \
freenet/interfaces/servlet/MultipleHttpServletContainer.java \
freenet/node/http/DiagnosticsServlet.java \
freenet/node/http/ColoredPixelServlet.java \
freenet/node/http/DistributionServlet.java \
freenet/node/http/NodeInfoServlet.java \
freenet/node/http/BookmarkManagerServlet.java \
freenet/node/rt/RoutingPointStore.java \
freenet/node/rt/HistoryKeepingRoutingPointStore.java
TESTS:=freenet/crypt/CryptTest.java \
freenet/diagnostics/DiagnosticsTest.java \
freenet/support/sort/SortTest.java \
freenet/support/test/FieldsTest.java \
freenet/support/test/HeapTest.java \
freenet/support/test/KeyListTest.java \
freenet/support/test/RedBlackTreeTest.java \
freenet/support/test/BoyerMooreTest.java \
freenet/support/test/URLDecoderTest.java \
freenet/node/http/DistributionTest.java
#
# detect java compiler
#
JAVAC_OPTS:=-sourcepath src -d build $(JAVAC_OPTS)
ifndef JAVAC
JAVAC:=$(shell if which jikes >/dev/null; \
then echo jikes; \
else if which kaffe >/dev/null; \
then echo kaffe at/dms/kjc/Main; \
else echo javac; \
fi \
fi)
endif
ifeq ($(shell test -f lib/freenet-ext.jar && echo yes), yes)
JAVAC_CPATH:=$(strip $(JAVAC_CPATH) lib/freenet-ext.jar)
endif
ifeq ($(shell test -f lib/junit.jar && echo yes), yes)
JAVAC_CPATH:=$(strip $(JAVAC_CPATH) lib/junit.jar)
endif
empty:=
space:= $(empty) $(empty)
JAVAC_CPATH:=$(subst $(space),:,$(JAVAC_CPATH))
ifneq ($(JAVAC_CPATH),)
ifeq ($(JAVAC), jikes)
JAVAC_OPTS:=-bootclasspath $(JAVAC_CPATH) $(JAVAC_OPTS)
else
JAVAC_OPTS:=-classpath $(JAVAC_CPATH) $(JAVAC_OPTS)
endif
endif
# set JAVA to java2 to compile without 1.1 compatability
ifneq ($(JAVA), java2)
ifeq ($(JAVAC), javac)
JAVAC_OPTS:=$(shell java -version 2>&1 | grep '1\.1' >/dev/null \
|| echo -target 1.1) \
$(JAVAC_OPTS)
endif
else
# JAVAC_OPTS:=-deprecation $(JAVAC_OPTS)
endif
#
# targets
#
all: client fproxy tools node
clean:
rm -rf lib/freenet.jar build/freenet binfred *.o
realclean: clean
rm -rf lib build tgz node_* store_* seednodes.ref freenet.log java gnu
check: tests
scripts/test.sh
lib:
mkdir lib
build:
mkdir build
#
# download targets
#
getlibs: lib
rm -f lib/freenet-ext.jar
cd lib; wget http://freenetproject.org/snapshots/freenet-ext.jar
getseeds:
rm -f seednodes.ref
wget http://freenetproject.org/snapshots/seednodes.ref
#
# dist targets
#
jar: all lib
cd build; \
$(JAR) -cmf ../src/node.manifest ../lib/freenet.jar freenet
tgz: jar
mkdir -p tgz/freenet-$(RELEASE_NAME)
cp -R lib tgz/freenet-$(RELEASE_NAME)
cp start-freenet*.sh stop-freenet.sh scripts/preconfig.sh README tgz/freenet-$(RELEASE_NAME)
if test -f seednodes.ref; then cp seednodes.ref tgz/freenet-$(RELEASE_NAME); fi
cd tgz ;\
tar c freenet-$(RELEASE_NAME) | gzip > ../freenet-$(RELEASE_NAME).tgz
rm -rf tgz/freenet-$(RELEASE_NAME)
#rpm: jar
# mkdir -p rpm/BUILD rpm/RPMS
# java -cp lib/freenet.jar freenet.config.Setup --silent fred.conf.in
# sed 's/^storePath=.*$/storePath=\/var\/spool\/fred/;\
# s/^logFile=.*$/logFile=\/var\/log\/fred/'\
# fred.conf.in > rpm/fred.conf
# rm fred.conf.in
# echo "%_topdir rpm" > rpm/.rpmmacros
# HOME=rpm rpm -bb --target=noarch rpm/fred.spec
# mv rpm/RPMS/noarch/fred*.noarch.rpm .
# rm -rf rpm/BUILD rpm/RPMS rpm/.rpmmacros
# TARGET gcj
# compiles a binary fred (named binfred) from bytecode freenet.jar
gcj: binfred
binfred: jar
CLASSPATH=lib/freenet-ext.jar \
gcj --main=freenet.node.Main \
-o binfred \
lib/freenet.jar \
lib/freenet-ext.jar
#
# compilation targets
#
client fproxy tools node tests:: build
client:: $(CLIENT)
$(JAVAC) $(JAVAC_OPTS) $(addprefix src/,$^)
fproxy:: $(FPROXY)
$(JAVAC) $(JAVAC_OPTS) $(addprefix src/,$^)
test -d build/freenet/node/http/templates || mkdir -p build/freenet/node/http/templates
cp -r src/freenet/node/http/templates build/freenet/node/http/
tools:: $(TOOLS)
$(JAVAC) $(JAVAC_OPTS) $(addprefix src/,$^)
node:: $(NODE)
$(JAVAC) $(JAVAC_OPTS) $(addprefix src/,$^)
tests:: $(TESTS)
$(JAVAC) $(JAVAC_OPTS) $(addprefix src/,$^)
%.java:
.PHONY: all clean check getlibs getseeds jar tgz \
client fproxy tools node tests %.java