/passgen/trunk

To get this branch, use:
bzr branch /bzr/passgen/trunk
8 by Michael Gorven
Add Makefile to build project.
1
WTK=/opt/java-wtk
2
MIDP=10
3
CLDC=10
22 by Michael Gorven
Rename and bump version.
4
NAME=PassGen
17 by Michael Gorven
Specify source files in Makefile.
5
URL=http://mene.za.net
22 by Michael Gorven
Rename and bump version.
6
DIR=passgen/download
7
SOURCES=src/$(NAME).java src/MD5.java src/MD5State.java src/SuperGenPass.java
17 by Michael Gorven
Specify source files in Makefile.
8
18 by Michael Gorven
Improve Makefile and add some more build instructions.
9
MANIFEST=MANIFEST.MF
8 by Michael Gorven
Add Makefile to build project.
10
CLASSPATH=$(WTK)/lib/midpapi$(MIDP).jar:$(WTK)/lib/cldcapi$(CLDC).jar
18 by Michael Gorven
Improve Makefile and add some more build instructions.
11
VERSION := $(shell grep '^MIDlet-Version:' $(MANIFEST) | sed 's/^.*: *//')
12
LNAME := $(shell echo '$(NAME)' | tr '[:upper:]' '[:lower:]')
10 by Michael Gorven
Rework JAD generation and add source target.
13
JAD=$(NAME)-$(VERSION).jad
14
JAR=$(NAME)-$(VERSION).jar
15
SOURCE=$(NAME)-$(VERSION).zip
18 by Michael Gorven
Improve Makefile and add some more build instructions.
16
PROGUARD=$(WTK)/bin/
17
PATH += :$(WTK)/bin
8 by Michael Gorven
Add Makefile to build project.
18
10 by Michael Gorven
Rework JAD generation and add source target.
19
all: jad
8 by Michael Gorven
Add Makefile to build project.
20
17 by Michael Gorven
Specify source files in Makefile.
21
build: $(SOURCES)
16 by Michael Gorven
Reorginise build directories.
22
	rm -rf build/tmpclasses && mkdir -p build/tmpclasses
23
	javac -bootclasspath $(CLASSPATH) -source 1.3 -target 1.1 -d build/tmpclasses src/*.java
8 by Michael Gorven
Add Makefile to build project.
24
25
preverify: build
16 by Michael Gorven
Reorginise build directories.
26
	rm -rf build/classes && mkdir -p build/classes
18 by Michael Gorven
Improve Makefile and add some more build instructions.
27
	preverify -classpath $(CLASSPATH) -d build/classes build/tmpclasses
8 by Michael Gorven
Add Makefile to build project.
28
29
jar: preverify
16 by Michael Gorven
Reorginise build directories.
30
	jar cfvm build/$(JAR) $(MANIFEST) -C build/classes .
9 by Michael Gorven
Add JAD generation and almost working obfuscation.
31
32
obfuscate: jar
18 by Michael Gorven
Improve Makefile and add some more build instructions.
33
	mv build/$(JAR) build/unobf-$(JAR)
34
	java -jar $(PROGUARD)/proguard.jar -injars build/unobf-$(JAR) -outjars build/$(JAR) -libraryjars $(CLASSPATH) -microedition -overloadaggressively -keep public class $(NAME) extends javax.microedition.midlet.MIDlet
9 by Michael Gorven
Add JAD generation and almost working obfuscation.
35
14 by Michael Gorven
Fix obfuscation.
36
jad: obfuscate
16 by Michael Gorven
Reorginise build directories.
37
	cp $(MANIFEST) build/$(JAD)
38
	echo "MIDlet-Jar-Size: $$(stat -c '%s' build/$(JAR))" >> build/$(JAD)
39
	cp build/$(JAD) build/$(LNAME).jad
40
	echo "MIDlet-Jar-URL: $(URL)/$(DIR)/$(JAR)" >> build/$(JAD)
41
	echo "MIDlet-Jar-URL: $(URL)/$(LNAME).jar" >> build/$(LNAME).jad
10 by Michael Gorven
Rework JAD generation and add source target.
42
43
source:
16 by Michael Gorven
Reorginise build directories.
44
	bzr export build/$(SOURCE)
8 by Michael Gorven
Add Makefile to build project.
45
46
clean:
16 by Michael Gorven
Reorginise build directories.
47
	rm -rf build