File: Makefile

package info (click to toggle)
jta 2.6+dfsg-6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 1,368 kB
  • ctags: 1,534
  • sloc: java: 12,696; ansic: 1,066; makefile: 243; xml: 72; sh: 7
file content (177 lines) | stat: -rw-r--r-- 5,768 bytes parent folder | download | duplicates (3)
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
# This file is part of "JTA - Telnet/SSH for the JAVA(tm) platform".
#
# (c) Matthias L. Jugel, Marcus Mei├čner 1996-2005. All Rights Reserved.
#
# Please visit http://javatelnet.org/ for updates and contact.
#
# --LICENSE NOTICE--
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# --LICENSE NOTICE--
#

JAVA	=	java
JAR	=	jar
JAVAC	=	javac
JAVADOC =	javadoc
JAVAH 	=	javah
#JAVA	=	/q/opt/jdk1.2.2/bin/java
#JAR	=	/q/opt/jdk1.2.2/bin/jar
#JAVAC	=	/q/opt/jdk1.2.2/bin/javac
#JAVADOC	=	/q/opt/jdk1.2.2/bin/javadoc
#DEBUG	=	-g -deprecation
DEBUG	=	-g
JFLAGS	=	-classpath $(CLASSPATH):jar/org.apache.crimson.jar:jar/jdom.jar:jar/gnu-regexp-1.0.8.jar:.
SRCDIR	=	de
PKGNAME	=	jta20
VERSION	=	`java -version 2>&1 | head -1 | \
		 sed 's/^java version //' | sed 's/"//g'`
DATE	=	`date +%Y%m%d-%H%M`

.SUFFIXES:	.java .class

# compile java files to class
.java.class:
	$(JAVAC) $(DEBUG) $(JFLAGS) $<

#
# major rules to create files
#
all: 	app cont doc jar tools/mrelayd tools/relayd

run:	app
	$(JAVA) $(JFLAGS) de.mud.jta.Main

doc:	app
	@echo Creating source documentation ...
	@if [ ! -d doc ]; then mkdir doc; fi
	@-rm -r doc/source/*.html doc/source/de
	@$(JAVADOC) -d doc/source -version -author \
	  -sourcepath $(CLASSPATH):.:contrib \
	  `(find de -name \*.java -printf '%h\n'; \
	    (cd contrib; find * -name \*.java -printf '%h\n')) | \
	    sort | uniq | \
	    grep -v CVS | sed 's/\//./g'`; > /dev/null
	@echo Source documentation done.

tex:	app
	@echo Creating latex source documentation ...
	@$(JAVADOC) -docletpath ../tex -doclet TexDoclet \
	  -output $(PKGNAME).tex \
	  -docdir de/mud/jta `find de/mud -type d -print | \
	    grep -v CVS | grep -v '^de/mud$$' | sed 's/\//./g'`; > /dev/null
	@echo Source documentation done.

jar:	app build
	@echo Creating binary archive ...
	@if [ ! -d jar ]; then mkdir jar; fi
	@touch "Created-$(DATE)"
	@$(JAR) cvfm jar/$(PKGNAME).jar jta.manifest \
	  "Created-$(DATE)" README \
	  license/COPYING \
	  `find $(SRCDIR) -name \*.class` \
	  `find $(SRCDIR) -name \*.conf` > /dev/null
	@rm -f Created-*
	@echo Created jar/$(PKGNAME).jar

opt:
	@[ -f ../Jopt.jar ] && $(JAVA) -jar ../Jopt.jar jar/$(PKGNAME).jar
	@echo Created jar/$(PKGNAME)_o.jar

cont:
	@echo Compiling contributed software ...
	@(cd contrib; make)

dist:	all opt revision changes
	@echo Creating distribution package ...
	@if [ "$(CVSROOT)" = "" ]; then echo "Missing CVSROOT!"; exit -1; fi
	@(cvs -Q -d $(CVSROOT) export -D now -d $(PKGNAME) jta && \
	  export CLASSPATH=$(CLASSPATH):`pwd`/jar/cryptix.jar && \
	  cp REVISION CHANGES $(PKGNAME)/ && \
	  cp -r doc/source $(PKGNAME)/doc/ && \
	  touch "$(PKGNAME)/Created-$(DATE)" && \
	  sed "s/<!-- DATE -->/$(DATE)/g" < $(PKGNAME)/index.html \
	                                  > $(PKGNAME)/index.new && \
	  mv $(PKGNAME)/index.new $(PKGNAME)/index.html && \
	  echo "s/<!-- DATE -->/$(DATE)/g" > /tmp/jta.sed && \
	  (cd $(PKGNAME); make cont; \
	   rm -r contrib/de/mud/bsx contrib/de/mud/jta/plugin/BSX*; \
	   $(JAR) cvMf ../jar/contrib.jar contrib) &&\
	  (cd jar; for i in *.jar; do \
	    echo 's/<!-- SIZE-'$$i' -->/'`\ls -l $$i | \
	          awk '{printf("%dk", $$5/1024);}' `'/g'; \
	  done) >> /tmp/jta.sed && \
	  sed -f /tmp/jta.sed < $(PKGNAME)/html/download.html \
	                      > $(PKGNAME)/html/download.new && \
	  rm -f /tmp/jta.sed && \
	  mv $(PKGNAME)/html/download.new $(PKGNAME)/html/download.html && \
	  bin/users.pl > $(PKGNAME)/html/users.html.new && \
	  mv $(PKGNAME)/html/users.html.new $(PKGNAME)/html/users.html && \
	  rm -r $(PKGNAME)/tools/* \
	        $(PKGNAME)/html/users.db \
	        $(PKGNAME)/bin/users.pl && \
          (cd $(PKGNAME); $(MAKE) clean) && \
	  $(JAR) cvMf jar/$(PKGNAME)-src.jar $(PKGNAME) \
	 ) > /dev/null 
	@rm -rf $(PKGNAME) 
	@echo Created jar/$(PKGNAME)-src.jar
	@$(JAR) cvMf jar/relay.jar \
	  tools/relayd tools/mrelayd tools/*.c tools/*.exe

build:
	@echo "package de.mud.jta; public class Build implements Version { public String getDate() { return \"$(DATE)\"; } }" > de/mud/jta/Build.java

changes:
	@rcs2log > CHANGES
	@echo Created CHANGES.

revision:
	@find de -name \*.java | xargs cat | grep @version | \
	  awk 'BEGIN{ \
	         printf("%-26.26s %2.2s.%-2.2s (%10s) %s\n", \
		        "File","R","M", "Date", "Last Accessed by:"); \
	       } \
	       { \
	         split($$5,rev,"."); \
	         printf("%-26.26s %2.2s.%-2.2s (%10s) %s\n", \
		   $$4,rev[1],rev[2],$$6,$$8); \
	       }' \
	  > REVISION
	  @echo Created REVISION.

small: app
	jar cvf jar/jta20-small.jar \
		license/README \
		de/mud/jta/SmallApplet*class \
		de/mud/telnet/TelnetProtocolHandler.class \
		de/mud/terminal/VDU*class \
		de/mud/terminal/vt320*class \
		de/mud/terminal/SoftFont.class

# 
# application dependencies
#
app:
	@find $(SRCDIR) -name \*.java | sed 's/java$$/class/' | xargs make
	@echo Done.

clean:
	-find . -name \*.class -print | xargs rm > /dev/null 2>&1
	-find . -name \*~ -print | xargs rm > /dev/null 2>&1
	-rm -f tools/relayd tools/mrelayd
	cd jni && $(MAKE) clean

realclean: clean
	-rm -f jar/$(PKGNAME).jar jar/$(PKGNAME)-src.jar
	cd jni && $(MAKE) realclean